File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Keep secrets and local config out of the build context / image layers (F-012)
2+ secrets /
3+ * .env
4+ .env *
5+ config.json
6+
7+ # VCS / CI
8+ .git /
9+ .github /
10+ .gitignore
11+
12+ # Local bind-mount data — provided at runtime, never baked into the image
13+ mounts /
14+
15+ # Python / build noise
16+ __pycache__ /
17+ * .py [cod ]
18+ * .egg-info /
19+ .pytest_cache /
20+ .coverage
21+ htmlcov /
22+ .venv /
23+ venv /
24+
25+ # Editor / OS
26+ .vscode /
27+ .idea /
28+ .DS_Store
Original file line number Diff line number Diff line change 11name : Check Commit Messages with Commitlint
22on : [pull_request]
3+ permissions :
4+ contents : read
5+
36jobs :
47 commitlint :
58 runs-on : ubuntu-latest
69 steps :
7- - uses : actions/checkout@v3
10+ - uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
811 with :
912 fetch-depth : 0
10- - uses : wagoid/commitlint-github-action@v5
13+ - uses : wagoid/commitlint-github-action@9763196e10f27aef304c9b8b660d31d97fce0f99 # v5
Original file line number Diff line number Diff line change 11# github action to run commit-msg hook on pull request commits and push commits to master branch
22name : Validate sample config
33on : pull_request
4+ permissions :
5+ contents : read
6+
47jobs :
58 config-validator :
69 runs-on : ubuntu-latest
710 steps :
8- - uses : actions/checkout@v3
11+ - uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
912 - name : Run config-validator
1013 run : python scripts/validator.py config.json.sample
Original file line number Diff line number Diff line change 44 tags :
55 - v*
66
7+ permissions :
8+ contents : read
9+
710jobs :
811 build :
912 runs-on : ubuntu-latest
1013 steps :
1114 - name : Check out the repo
12- uses : actions/checkout@v3
15+ uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
1316 - name : Set up QEMU
14- uses : docker/setup-qemu-action@v2
17+ uses : docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
1518 - name : Set up Docker Buildx
16- uses : docker/setup-buildx-action@v2
19+ uses : docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
1720 - name : Docker metadata
1821 id : meta
19- uses : docker/metadata-action@v4
22+ uses : docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4
2023 with :
2124 images : |
2225 browserstack/enigma
@@ -25,12 +28,12 @@ jobs:
2528 type=semver,pattern=v{{major}}.{{minor}}
2629 type=semver,pattern=v{{major}}
2730 - name : Login to DockerHub
28- uses : docker/login-action@v2
31+ uses : docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
2932 with :
3033 username : ${{ secrets.DOCKERHUB_USERNAME }}
3134 password : ${{ secrets.DOCKERHUB_TOKEN }}
3235 - name : Build and push
33- uses : docker/build-push-action@v4
36+ uses : docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4
3437 with :
3538 context : .
3639 push : true
Original file line number Diff line number Diff line change 11# github action to run commit-msg hook on pull request commits and push commits to master branch
22name : Pre Commit Hook
33on : [pull_request]
4+ permissions :
5+ contents : read
6+
47jobs :
58 commit-msg-hook :
69 runs-on : ubuntu-latest
710 steps :
8- - uses : actions/checkout@v3
11+ - uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
912 - name : Run commit-msg hook
1013 run : |
1114 pip install pre-commit==2.21.0
Original file line number Diff line number Diff line change 2121 image : returntocorp/semgrep:1.166.0
2222 if : (github.actor != 'dependabot[bot]')
2323 steps :
24- - uses : actions/checkout@v4
24+ - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2525 - run : semgrep --error --config "p/cwe-top-25" --config "p/owasp-top-ten" --config "p/r2c-security-audit"
Original file line number Diff line number Diff line change 11name : Unit Tests and Lint
22on : [push]
3+ permissions :
4+ contents : read
5+
36jobs :
47 build :
58 runs-on : ubuntu-latest
69 strategy :
710 matrix :
811 python-version : ['3.9', '3.10', '3.11']
912 steps :
10- - uses : actions/checkout@v3
13+ - uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
1114 - name : Set up Python ${{ matrix.python-version }}
12- uses : actions/setup-python@v4
15+ uses : actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
1316 with :
1417 python-version : ${{ matrix.python-version }}
1518 - name : Install dependencies
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ RUN apt update && apt install -y netcat dnsutils libmariadb-dev
1919RUN mkdir -p /ebs/logs && touch /ebs/logs/engima.log && chmod 777 /ebs/logs/engima.log
2020
2121ARG APPUID=1001
22- RUN useradd -rm -d /home/app -s /bin/bash -g root -G sudo - u "$APPUID" app
22+ RUN useradd -rm -d /home/app -s /bin/bash -g root -u "$APPUID" app
2323WORKDIR /srv/code/dev
2424RUN mkdir -p logs
2525RUN mkdir -p db
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ services:
1818 - ./mounts/logs:/ebs/logs
1919 ports :
2020 - 8000:8000
21+ security_opt :
22+ - no-new-privileges:true
2123 depends_on :
2224 - db
2325 db :
@@ -54,6 +56,8 @@ services:
5456 - ./mounts/logs:/ebs/logs
5557 env_file :
5658 - ./secrets/ops_app_celery.env
59+ security_opt :
60+ - no-new-privileges:true
5761 depends_on :
5862 - db
5963 - redis
Original file line number Diff line number Diff line change 11CELERY_BROKER_URL = redis://redis:6379
22CELERY_RESULT_BACKEND = redis://redis:6379
3- C_FORCE_ROOT = true
43MYSQL_ROOT_PASSWORD = testtest
54MYSQL_DATABASE = enigma
65MYSQL_ROOT_HOST = %
You can’t perform that action at this time.
0 commit comments