ramagopalb/devsecops-pipeline-security

GitHub: ramagopalb/devsecops-pipeline-security

一个综合性的 DevSecOps 流水线安全框架,集成 IaC 扫描、SCA、SAST、密钥检测、策略即代码、SBOM 生成和 Kubernetes 加固等多维度安全检测能力。

Stars: 0 | Forks: 0

# DevSecOps Pipeline 安全框架 一个全面的 DevSecOps 流水线安全框架,展示了安全的 CI/CD 实践,包括 IaC 扫描、软件组成分析(SCA)、SAST、 secrets 检测、策略即代码执行、SBOM 生成和 Kubernetes 安全加固。 ## 功能 - **IaC Security Scanner** - 根据安全基准(CIS、SOC 2)验证 Terraform 和 Kubernetes 清单 - **SCA Engine** - 扫描依赖项中的已知 CVE,并基于严重性进行策略控制 - **SAST Scanner** - 静态分析常见安全反模式(硬编码密钥、SQL 注入、eval 使用) - **Secrets Detector** - 识别源代码中泄露的凭证、API 密钥和令牌 - **Policy-as-Code Engine** - 用于部署和容器安全的 OPA/Rego 风格策略评估 - **SBOM Generator** - 以 CycloneDX 格式生成软件物料清单 - **Kubernetes Hardener** - 验证 K8s 清单的安全最佳实践(runAsNonRoot、资源限制、网络策略) - **Pipeline Orchestrator** - 将所有扫描器链接到单个管道中,并提供可配置的严重性阈值 ## 项目结构 ``` devsecops-pipeline-security/ ├── README.md ├── requirements.txt ├── src/ │ ├── __init__.py │ ├── iac_scanner.py # Infrastructure-as-Code security scanner │ ├── sca_engine.py # Software Composition Analysis │ ├── sast_scanner.py # Static Application Security Testing │ ├── secrets_detector.py # Secrets and credential detection │ ├── policy_engine.py # Policy-as-code evaluation engine │ ├── sbom_generator.py # SBOM generation (CycloneDX) │ ├── k8s_hardener.py # Kubernetes manifest security validator │ └── pipeline.py # Pipeline orchestrator ├── policies/ │ ├── container_policy.json # Container security policies │ └── deploy_policy.json # Deployment policies ├── tests/ │ ├── __init__.py │ ├── test_iac_scanner.py │ ├── test_sca_engine.py │ ├── test_sast_scanner.py │ ├── test_secrets_detector.py │ ├── test_policy_engine.py │ ├── test_sbom_generator.py │ ├── test_k8s_hardener.py │ └── test_pipeline.py └── .github/ └── workflows/ └── security-pipeline.yml ``` ## 快速开始 ``` pip install -r requirements.txt pytest tests/ -v ``` ## 使用方法 ``` from src.pipeline import SecurityPipeline pipeline = SecurityPipeline(severity_threshold="high") results = pipeline.run( source_dir="./app", iac_dir="./terraform", k8s_dir="./k8s", deps_file="requirements.txt" ) print(results.summary()) ``` ## 作者 Ram Gopal Reddy Basireddy - [GitHub](https://github.com/ramagopalb)
标签:Chrome Headless, CI/CD安全, CIS, CycloneDX, DevSecOps, ECS, Groq API, IaC安全, K8s加固, Kubernetes安全, Llama, LLM防护, OPA, Rego, SAST, SBOM, Secrets检测, SOC2, Terraform, Web截图, 上游代理, 代码安全, 子域名突变, 安全扫描, 安全管道, 安全规则引擎, 容器安全, 时序注入, 漏洞枚举, 盲注攻击, 硬件无关, 策略即代码, 聊天机器人安全, 跌倒检测, 软件物料清单, 逆向工具, 静态应用安全测试, 靶场