This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from freedomofpress/oh_my_syslog
Adds initial scripts to use rsyslog for logging in workstation
- Loading branch information
Showing
19 changed files
with
471 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
--- | ||
common-steps: | ||
- &install_packaging_dependencies | ||
run: | ||
name: Install Debian packaging dependencies and download wheels | ||
command: | | ||
mkdir ~/packaging && cd ~/packaging | ||
git config --global --unset url.ssh://[email protected] | ||
git clone https://github.com/freedomofpress/securedrop-debian-packaging.git | ||
cd securedrop-debian-packaging | ||
make install-deps | ||
PKG_DIR=~/project make requirements | ||
- &verify_requirements | ||
run: | ||
name: Ensure that build-requirements.txt and requirements.txt are in sync. | ||
command: | | ||
cd ~/project | ||
# Return 1 if unstaged changes exist (after `make requirements` in the | ||
# previous run step), else return 0. | ||
git diff --quiet | ||
- &make_source_tarball | ||
run: | ||
name: Tag and make source tarball | ||
command: | | ||
cd ~/project | ||
./update_version.sh 1000.0 # Dummy version number, doesn't matter what we put here | ||
python3 setup.py sdist | ||
- &build_debian_package | ||
run: | ||
name: Build debian package | ||
command: | | ||
cd ~/packaging/securedrop-debian-packaging | ||
export PKG_VERSION=1000.0 | ||
export PKG_PATH=/home/circleci/project/dist/securedrop-log-$PKG_VERSION.tar.gz | ||
make securedrop-log | ||
version: 2 | ||
jobs: | ||
test: | ||
|
@@ -9,8 +48,19 @@ jobs: | |
name: Run tests | ||
command: python3 -m unittest | ||
|
||
build-buster: | ||
docker: | ||
- image: circleci/python:3.7-buster | ||
steps: | ||
- checkout | ||
- *install_packaging_dependencies | ||
- *verify_requirements | ||
- *make_source_tarball | ||
- *build_debian_package | ||
|
||
workflows: | ||
version: 2 | ||
per_pr: | ||
jobs: | ||
- test | ||
- build-buster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
DEFAULT_GOAL: help | ||
SHELL := /bin/bash | ||
|
||
# Bandit is a static code analysis tool to detect security vulnerabilities in Python applications | ||
# https://wiki.openstack.org/wiki/Security/Projects/Bandit | ||
.PHONY: bandit | ||
bandit: ## Run bandit with medium level excluding test-related folders | ||
pip install --upgrade pip && \ | ||
pip install --upgrade bandit!=1.6.0 && \ | ||
bandit -ll --recursive . --exclude tests,.venv | ||
|
||
.PHONY: safety | ||
safety: ## Runs `safety check` to check python dependencies for vulnerabilities | ||
pip install --upgrade safety && \ | ||
for req_file in `find . -type f -name '*requirements.txt'`; do \ | ||
echo "Checking file $$req_file" \ | ||
&& safety check --full-report -r $$req_file \ | ||
&& echo -e '\n' \ | ||
|| exit 1; \ | ||
done | ||
|
||
.PHONY: update-pip-requirements | ||
update-pip-requirements: ## Updates all Python requirements files via pip-compile. | ||
pip-compile --generate-hashes --output-file requirements.txt requirements.in | ||
|
||
|
||
# Explaination of the below shell command should it ever break. | ||
# 1. Set the field separator to ": ##" and any make targets that might appear between : and ## | ||
# 2. Use sed-like syntax to remove the make targets | ||
# 3. Format the split fields into $$1) the target name (in blue) and $$2) the target descrption | ||
# 4. Pass this file as an arg to awk | ||
# 5. Sort it alphabetically | ||
# 6. Format columns with colon as delimiter. | ||
.PHONY: help | ||
help: ## Print this message and exit. | ||
@printf "Makefile for developing and testing the SecureDrop Logging system.\n" | ||
@printf "Subcommands:\n\n" | ||
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) \ | ||
| sort \ | ||
| column -s ':' -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
redis==3.3.11 --hash=sha256:022f124431ae16ee3a3a69c8016e3e2b057b4f4e0bfa7787b6271d893890c3cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
redis==3.3.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# | ||
# pip-compile --generate-hashes --output-file=requirements.txt requirements.in | ||
# | ||
redis==3.3.11 \ | ||
--hash=sha256:3613daad9ce5951e426f460deddd5caf469e08a3af633e9578fc77d362becf62 \ | ||
--hash=sha256:8d0fc278d3f5e1249967cba2eb4a5632d19e45ce5c09442b8422d15ee2c22cc2 |
Oops, something went wrong.