Skip to content

Commit 6754d6d

Browse files
Migrate OWASP Nest to Zappa for serverless deployment (#2431)
* Install zappa and initial example configuration * add temporary IaC code for testing * Update code * Remove IAM and let Zappa manage it * add README * add RDS proxy, pre-commit hooks, clean-up code * feat: add ecs tasks * refactor/clean cache module * refactor/clean database module * refactor/clean ecs module * refactor/clean networking module * address Sonar Qube bot suggestions * keep some Sonar Qube bot suggestions but add #NOSONAR * add terraform dictionary * refactor/clean security module * fix pre-commit hooks and add terraform_validate * add SHA hash and remove terraform_validate * refactor/clean storage module * Update docs * add S3 support for load-data task * Update README and necessary examples * coderabbit suggestions * Update code: install awscli before invoking aws in task * update README * NOSONAR * update README * fix spell check * Update README * fix: typo * remove immutable tagged images * fix: load-data task fail due to no permissions * fix spell check: add PYTHONPATH * add AWS CLI * add set -e * Update code --------- Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
1 parent 3781d46 commit 6754d6d

44 files changed

Lines changed: 2774 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run-ci-cd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ jobs:
5252
restore-keys: |
5353
pre-commit-${{ runner.os }}-
5454
55+
- name: Setup TFLint
56+
uses: terraform-linters/setup-tflint@dfcb455ed8d56b55edf6447a37379108181a6707
57+
with:
58+
tflint_version: v0.59.1
59+
5560
- name: Run pre-commit
5661
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
5762

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,19 @@ __pycache__
3131
*.log
3232
*.pdf
3333
*.pem
34+
*.tfstate
35+
*.tfstate.*
36+
**/.terraform/
3437
backend-sbom-local.cdx.json
38+
backend/*nest-backend-dev*.tar.gz
39+
backend/*nest-backend-dev*.zip
40+
backend/*nest-backend-staging*.tar.gz
41+
backend/*nest-backend-staging*.zip
3542
backend/data/backup*
3643
backend/fuzzing_results/
3744
backend/generated_videos/
3845
backend/staticfiles
46+
backend/zappa_settings.json
3947
design/
4048
frontend-sbom-local.cdx.json
4149
frontend/.next
@@ -50,7 +58,7 @@ frontend/pnpm-debug.log*
5058
frontend/test-results/
5159
frontend/yarn-debug.log*
5260
frontend/yarn-error.log*
53-
infrastructure/
61+
infrastructure/terraform.tfvars
5462
logs
5563
node_modules/
5664
semgrep-security-report.txt

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ repos:
4444
language_version: python3
4545
pass_filenames: true
4646

47+
- repo: https://github.com/antonbabenko/pre-commit-terraform
48+
rev: v1.104.0
49+
hooks:
50+
- id: terraform_fmt
51+
files: ^infrastructure/.*\.tf$
52+
- id: terraform_tflint
53+
files: ^infrastructure/.*\.tf$
54+
4755
- repo: https://github.com/astral-sh/ruff-pre-commit
4856
rev: v0.15.2
4957
hooks:

backend/poetry.lock

Lines changed: 230 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ dependencies.strawberry-graphql = { extras = [ "django" ], version = "^0.291.0"
4747
dependencies.strawberry-graphql-django = "^0.75.0"
4848
dependencies.thefuzz = "^0.22.1"
4949
dependencies.pyparsing = "^3.2.3"
50+
dependencies.zappa = "^0.60.2"
5051
group.fuzz.dependencies.schemathesis = "^4.10.2"
5152
group.test.dependencies.pytest = "^9.0.1"
5253
group.test.dependencies.pytest-cov = "^7.0"

0 commit comments

Comments
 (0)