A minimal Flask API demonstrating the full ASCEND four-layer pipeline on GitHub Actions. Use this as a reference for Python service integration.
- Layer 1: SAST findings caught by Bandit / Semgrep / SonarQube (intentional demonstrative issues plus a hardened version).
- Layer 2: Container image scanning with Trivy, IaC scanning with Checkov.
- Layer 3: DAST with OWASP ZAP against a deployed staging instance.
- Layer 4: AI sync integration webhook.
sample-python-app/
├── .github/
│ └── workflows/
│ └── ascend.yml # Full pipeline
├── app/
│ ├── __init__.py
│ ├── main.py # Flask app
│ ├── auth.py # Token validation
│ └── database.py # DB access (parameterized queries)
├── tests/
│ ├── test_main.py
│ └── test_auth.py
├── terraform/
│ ├── main.tf # AWS infrastructure
│ └── variables.tf
├── Dockerfile
├── requirements.txt
├── requirements-dev.txt
├── .gitignore
└── README.md
- Python 3.11+
- Docker
- Terraform (if deploying infrastructure)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Run the app
FLASK_APP=app.main flask run
# Run tests
pytest tests/docker build -t sample-python-app:local .
docker run -p 5000:5000 sample-python-app:local# SAST
bandit -r app/
semgrep --config=p/owasp-top-ten app/
# SCA
pip-audit
# Secret scan
trufflehog filesystem . --only-verified- Push this directory to a GitHub repository.
- Configure secrets at
Settings → Secrets and variables → Actions:SONAR_TOKENSONAR_HOST_URLSNYK_TOKEN
- Enable GitHub Advanced Security (available on all public repos).
- Push a commit to the default branch.
The pipeline will run. Layer 1 findings surface as PR comments via GitHub Code Scanning.
The sample app is deliberately clean of high-severity issues. To see the pipeline react to findings, check out the demo-vulns branch which intentionally introduces:
- A hardcoded secret (caught by TruffleHog).
- A SQL injection via string concatenation (caught by Semgrep + Bandit).
- A dependency with a known CVE (caught by Snyk).
- A Dockerfile running as root (caught by Trivy + Checkov).
- An unauthenticated admin endpoint (caught by DAST in Layer 3).
Merge attempts on demo-vulns will be blocked at each corresponding gate.