A minimal FastAPI application demonstrating a Secure SDLC (SSDL) with multiple security controls integrated into CI/CD.
- Health and Echo endpoints (
/health,/echo) - Structured JSON logging
- Unit tests with
pytestand coverage threshold (>=80%) - Tooling via pre-commit: Black, isort, Flake8, Mypy, Bandit, detect-secrets
- SCA: Dependabot for pip, Docker, Terraform, GitHub Actions
- SAST: SonarCloud via GitHub Action
- IaC: Terraform for ECR, ECS Fargate, ALB, Security Groups + Checkov scan
- Container security: Trivy scan in pipeline
- DAST: OWASP ZAP baseline scan workflow
- Python 3.11+
- Docker (optional for container runs)
python -m pip install -U pip
python -m pip install -e .[dev]
make runOpen http://127.0.0.1:8000/docs
docker compose up --buildmake format
make lint
make type-check
make test
make security-scan
make precommitci.yml: runs formatting, linting, typing, bandit, pip-audit, tests, coverage, SonarClouddeploy.yml: on main, builds image, scans with Trivy, pushes to ECR, Terraform apply with OIDCdast-zap.yml: nightly + PR ZAP baseline scan against ephemeral container- Checkov is run over
infra/as part of CI
Variables (see infra/variables.tf):
region(defaultus-east-1)name(defaultssdlc-demo)image_tag(set to Docker tag pushed to ECR)
Apply:
cd infra
terraform init
terraform plan -var="image_tag=<tag>"
terraform apply -auto-approve -var="image_tag=<tag>"- RASP integration placeholder
- Application fuzzing hooks (e.g.,
pytestproperty-based tests / fuzzers)