Phoenix Autonomous SDLC Flow commented on issue #7 at GitLab AI Hackathon / Participants / Aden1ke

Phoenix Autonomous SDLC Flow
2026-03-24T15:41:17Z

✅ Eco-Cop scan implementation complete!

I've implemented the scripts/eco_cop.py script to enable policy violation and cloud waste scanning.

Merge Request: !13 (merged)

What was implemented

The script provides a complete eco-cop scan that checks for:

1. Cloud Waste Detection

Flags wasteful instance types (x1, p4d, u-series)

Validates large instances have justification

Checks auto-scaling configuration for non-prod environments

Prevents production configs on unprotected branches

2. Policy Compliance

Scans for hardcoded secrets (AWS keys, DB credentials, private keys, Stripe keys)

Enforces required files (README.md, SECURITY.md, .gitignore)

Blocks forbidden file patterns (.pem, .env, .key, tfstate)

Validates branch naming conventions

3. Build Size Validation

Checks artifact directories for oversized files

Validates Docker image sizes

Configurable size limits

4. Environment Access Control

Prevents sensitive CI variables in non-protected environments

Enforces deployment restrictions for production/staging

Validates environment configurations

Usage

# Run the scan
python scripts/eco_cop.py

The script will generate:

Console output with detailed violation reports

gatekeeper-report.json - structured JSON report

gatekeeper-report-junit.xml - JUnit format for GitLab integration

Example Output

============================================================
ECO-GATEKEEPER REPORT
Trigger : manual
Branch : main
Commit : 6d17fb7e
============================================================

BLOCKED — 2 violation(s) must be resolved:

[1] POLICY_COMPLIANCE
Potential hardcoded AWS key found in 'demo/broken_app/eco-cop_demo.py'.
-> Pattern matched: 'AKIA'. Move secrets to CI/CD variables or a vault.

[2] POLICY_COMPLIANCE
Potential hardcoded AWS secret key found in 'demo/broken_app/eco-cop_demo.py'.
-> Pattern matched: 'wJalrXUtnFEMI'. Move secrets to CI/CD variables or a vault.

============================================================
RESULT: PIPELINE FAILED — fix violations above before merging.
============================================================

The implementation reuses the existing battle-tested eco-gatekeeper agent to ensure consistency and avoid code duplication.