BalayogeshGopi/devsecops-aws-demo

GitHub: BalayogeshGopi/devsecops-aws-demo

基于 AWS 的端到端 DevSecOps 参考项目,演示如何通过 Terraform、GitHub Actions、安全扫描工具和 Kubernetes 实现安全、自动化的云原生应用交付与成本治理。

Stars: 0 | Forks: 0

# devsecops-aws-demo [![CI](https://static.pigsec.cn/wp-content/uploads/repos/cas/ad/ad5834178f7599af9fdda11629d49cae07f2997beec49821b2920eff5bfd50e7.svg)](https://github.com/BalayogeshGopi/devsecops-aws-demo/actions/workflows/ci.yml) [![Security](https://static.pigsec.cn/wp-content/uploads/repos/cas/31/3182eccd67715b6b1bf46236ece7b7252dafc1e332af959acd19e63f1f3698a5.svg)](https://github.com/BalayogeshGopi/devsecops-aws-demo/actions/workflows/security.yml) ![License](https://img.shields.io/github/license/BalayogeshGopi/devsecops-aws-demo) ![Terraform](https://img.shields.io/badge/IaC-Terraform-7B42BC?logo=terraform&logoColor=white) ![AWS](https://img.shields.io/badge/Cloud-AWS-232F3E?logo=amazonwebservices&logoColor=white) 在 **AWS** 上的端到端 **DevSecOps 参考项目**,展示了我设计和保护云原生平台的方式:Infrastructure as Code、安全的 CI/CD pipeline、自动化安全扫描、容器/Kubernetes 部署以及 FinOps 成本可视化。 ## 🧭 本仓库展示的内容 | 领域 | 工具 | 位置 | | --- | --- | --- | | Infrastructure as Code | Terraform (AWS VPC + ECR) | [`terraform/`](terraform/) | | 示例应用 | Python · FastAPI | [`app/`](app/) | | CI (构建 + 测试 + lint) | GitHub Actions | [`.github/workflows/ci.yml`](.github/workflows/ci.yml) | | DevSecOps 扫描 | Trivy · tfsec · Gitleaks · Bandit | [`.github/workflows/security.yml`](.github/workflows/security.yml) | | 部署 (OIDC → ECR → EKS) | GitHub Actions · AWS OIDC | [`.github/workflows/deploy.yml`](.github/workflows/deploy.yml) | | 容器部署 | Docker · Kubernetes · Helm | [`k8s/helm/app/`](k8s/helm/app/) | | FinOps 成本报告 | Python · AWS Cost Explorer | [`finops/`](finops/) | ## 🏗️ 架构 ``` Developer ──push──▶ GitHub │ ┌────────────┴─────────────┐ ▼ ▼ CI pipeline Security pipeline (lint · test · build) (Trivy · tfsec · Gitleaks · Bandit) │ │ ▼ ▼ Docker image ──▶ Amazon ECR ──▶ Kubernetes (Helm) ──▶ Users │ ▼ FinOps cost reporting ``` ## 🚀 快速开始 ### 1. 在本地运行应用 ``` cd app python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt uvicorn main:app --reload # 打开 http://127.0.0.1:8000/health ``` ### 2. 运行测试 ``` cd app pip install -r requirements-dev.txt pytest -q ``` ### 3. 配置基础设施 (Terraform) ``` cd terraform terraform init terraform plan terraform apply # creates a demo VPC + ECR repository ``` ### 4. 使用 Helm 部署 ``` helm upgrade --install demo ./k8s/helm/app \ --set image.repository= \ --set image.tag=latest ``` ### 5. 生成 FinOps 成本报告 ``` cd finops pip install -r requirements.txt python cost_report.py --days 30 ``` ## 🔐 pipeline 中的安全控制 - **Trivy** — 容器镜像 + 文件系统漏洞扫描 - **tfsec** — Terraform 静态安全分析 - **Gitleaks** — 密钥检测 - **Bandit** — Python SAST - 遇到 **HIGH/CRITICAL** 级别的发现时使构建失败(可配置) ## 📄 许可证 MIT — 请查看 [LICENSE](LICENSE)。
标签:DevSecOps, 上游代理, 云财务运营, 子域名突变, 安全扫描, 时序注入, 漏洞利用检测, 请求拦截, 逆向工具