A production-grade cloud security engineering portfolio — built phase by phase, hardened layer by layer.
Aegis is a FastAPI service hardened across six sequential security engineering phases — from container security to infrastructure as code. Every decision is documented, every control is tested, and every pipeline gate is enforced automatically.
This is not a tutorial project. It is a demonstration of how security is built into a system from day one.
| Control Area | Implementation | Status |
|---|---|---|
| Container Hardening | Multi-stage build, non-root UID 1001, health checks, digest pinning | ✅ |
| Secrets Management | .env injection, Redis auth, no secrets in image layers |
✅ |
| IAM Least Privilege | Custom policies, NotPrincipal deny, EC2 instance role | ✅ |
| Audit Logging | CloudTrail multi-region trail, CloudWatch alerts, root usage alarm | ✅ |
| SAST | Semgrep (p/python, p/secrets, p/owasp-top-ten) | ✅ |
| Secret Scanning | Gitleaks — 63 commits clean | ✅ |
| SBOM | Syft CycloneDX — 510 components inventoried | ✅ |
| Dependency Scan | Grype — 0 CRITICAL findings | ✅ |
| Image Signing | Cosign sign-blob (tarball), keypair committed | ✅ |
| Policy Enforcement | OPA/Rego gate — blocks non-root containers at CI | ✅ |
| DAST | OWASP ZAP baseline — 0 failures, 65 passes | ✅ |
| IaC Security | Terraform + Checkov 32/32, pre-commit hook, blocking CI gate | ✅ |
| Attack Surface | Idempotent hashing, bcrypt 4.3.0 pinned, input hardening | ✅ |
| Middleware | RBAC + CSP headers enforced at request layer | ✅ |
Every push triggers a fully automated security pipeline. No manual gates. test → sast → sbom → dast → trivy-scan
| Job | Tools | Gate Type |
|---|---|---|
test |
pytest — 57 tests | Blocking |
sast |
Semgrep, Gitleaks, OPA/Rego | Blocking |
sbom |
Syft (CycloneDX), Grype, Cosign | Blocking |
dast |
OWASP ZAP baseline | Blocking |
trivy-scan |
Trivy image CVE scan | Blocking |
All 5 GitHub Actions are SHA-pinned to immutable commit hashes — no floating tags, no supply chain drift.
┌─────────────────────────────────────────┐ │ GitHub Actions │ │ test → sast → sbom → dast → trivy │ └────────────────┬────────────────────────┘ │ ┌────────────────▼────────────────────────┐ │ FastAPI Application │ │ RBAC middleware │ CSP headers │ │ bcrypt auth │ idempotent hashing │ └───────┬──────────────────────┬──────────┘ │ │ ┌───────▼──────┐ ┌────────▼─────────┐ │ PostgreSQL │ │ Redis │ │ (app data) │ │ (auth + cache) │ └──────────────┘ └──────────────────┘ ┌─────────────────────────────────────────┐ │ AWS Infrastructure │ │ S3 (encrypted, versioned, logged) │ │ IAM least-privilege roles + policies │ │ CloudTrail multi-region audit trail │ │ CloudWatch metrics + root usage alarm │ └─────────────────────────────────────────┘ ┌─────────────────────────────────────────┐ │ Terraform (IaC) │ │ Checkov 32/32 │ pre-commit hook │ │ Blocking CI gate │ audit-ready state │ └─────────────────────────────────────────┘
Multi-stage Dockerfile, non-root user (UID 1001), health checks, Redis password auth, image digest pinning, Trivy CVE scanning.
Least-privilege IAM users, custom S3-readonly policy, EC2 instance role, S3 Block Public Access + NotPrincipal deny, CloudTrail multi-region trail, CloudWatch log streaming, root account usage alarm.
SHA-pinned actions, Semgrep SAST, Gitleaks secret scanning, Syft SBOM (510 components, CycloneDX), Grype vulnerability scan, Cosign image signing, OPA/Rego policy gate, OWASP ZAP DAST.
Terraform S3 module (encryption, versioning, logging, public access block), Checkov 32/32 passing, pre-commit hook, blocking CI gate. Infrastructure is reproducible and audit-ready.
Idempotent hashing for attack surface reduction, bcrypt 4.3.0 pinned, runtime stability hardened as prerequisite for production monitoring. Common attack vectors mitigated at the code layer.
57 passing tests. 12 Architecture Decision Records. Zero critical CVEs. Six phases documented.
| ADR | Decision |
|---|---|
| ADR-001 | Multistage Docker Build Strategy |
| ADR-002 | Container Vulnerability Assessment |
| ADR-003 | Third-Party Image CVE Assessment |
| ADR-004 | CI/CD Security Pipeline Design |
| ADR-005 | IAM Hardening Strategy |
| ADR-006 | IAM Roles and Trust Policies |
| ADR-007 | CloudTrail Detective Controls |
| ADR-008 | CI/CD Hardening Strategy |
| ADR-009 | Supply Chain Security (SBOM + Cosign) |
| ADR-010 | DAST Integration |
| ADR-011 | IaC Governance (Terraform + Checkov) |
| ADR-012 | Threat Hardening — Idempotent Hashing + Bcrypt Pin |
| Layer | Technology |
|---|---|
| API | FastAPI (Python) |
| Database | PostgreSQL |
| Cache / Auth | Redis |
| Infrastructure | AWS (S3, IAM, CloudTrail, CloudWatch) |
| IaC | Terraform + Checkov |
| Container | Docker (multi-stage, hardened) |
| CI/CD | GitHub Actions (SHA-pinned) |
| SAST | Semgrep |
| Secret Scan | Gitleaks |
| SBOM | Syft (CycloneDX) |
| Dependency Scan | Grype |
| Image Signing | Cosign |
| Policy | OPA / Rego |
| DAST | OWASP ZAP |
| CVE Scan | Trivy |
Prerequisites: Docker, Docker Compose, Python 3.11+
git clone https://github.com/JayKnowSo/aegis-api-gateway.git
cd aegis-api-gateway
cp .env.example .env
docker compose up -d
pytest tests/ -vsemgrep --config=p/python --config=p/secrets .
gitleaks detect --source . -v
syft . -o cyclonedx-json > sbom.json
grype sbom:sbom.json
trivy image aegis-api-gateway:latest
checkov -d terraform/Found a vulnerability? Open a GitHub Issue with the label security.
Built by Jemel Padilla — Cloud Security Engineer Orlando, FL · github.com/JayKnowSo