Policy validation engine & approval gates for infrastructure changes
Infrastructure Change Quality Gate is a DevSecOps compliance and governance automation tool for enforcing formal change management processes around infrastructure changes. It provides a lightweight policy validation engine, risk-based approval gates, CI/CD validation, and audit evidence generation for infrastructure change requests.
The project is designed as a portfolio-grade implementation of ISO 27001-aligned change management controls, with practical examples for infrastructure, access management and RBAC/IAM governance use cases.
It demonstrates:
- automated validation of Markdown-based change requests
- risk classification and approval requirements
- rollback, test plan and freeze-window checks
- GitHub Actions quality gates
- local Markdown audit evidence reporting
- integration-oriented governance examples such as RBAC-Lite
This repository implements a formal change management process for critical infrastructure. The system is based on ISO 27001 change management controls and provides an automated quality gate that validates change requests before merge.
The validator is a modular, generic policy engine that can be used as a standalone tool or integrated with governance frameworks like RBAC-Lite.
flowchart LR
A[Developer] --> B[PR + Change Request]
B --> C{GATE 1\nAutomated Validation\nCI/CD Script}
C -->|Pass| D{GATE 2\nManual Review\nReview Policy}
C -->|Fail| X[β Rejected]
D -->|Approved| E{GATE 3\nDeployment Condition\nTime Windows}
D -->|Rejected| X
E -->|Clear| F[β
Merge]
E -->|Blocked| Y[βΈ Postponed]
| Gate | Name | Description |
|---|---|---|
| 1 | Automated validation (CI/CD) | Python script checks change request structure, risk level, rollback plan, and freeze windows |
| 2 | Manual review | Number of reviewers based on risk level (1-3 persons) |
| 3 | Deployment condition | Time window check, staging validation, communication plan for critical changes |
| Class | Level | Approvers | Examples |
|---|---|---|---|
| 1 | Low | 1 | Documentation, minor configurations |
| 2 | Medium | 2 | Infrastructure config, CI/CD changes, access management |
| 3 | Critical | 3 + CISO | Network architecture, database migrations, security |
| Control | Description |
|---|---|
| A.12.1.2 | Change Management β Changes are documented, classified, and approved |
| A.14.2.2 | System Change Control β Formal, auditable change process |
| A.12.4.1 | Event Logging β Automated audit trail via CI/CD |
.
βββ .github/workflows/ # CI/CD quality gate and audit evidence workflows
βββ docs/ # Documentation and governance
β βββ integrations/
β β βββ rbac-lite.md # RBAC-Lite integration example
β βββ risk-matrix.md
β βββ change-classification.md
βββ templates/ # Change request templates
β βββ change-request-template.md
β βββ rollback-plan-template.md
βββ validation/ # Automated validation engines
β βββ pre-merge-checks/
β β βββ validate-change-request.py # Legacy validator (entry point)
β βββ pre_merge_checks/
β βββ cli.py # Modular CLI validator
βββ scripts/ # Audit and reporting tools
β βββ generate-audit-report.sh # Local audit evidence report generator
βββ examples/ # Pre-filled examples
β βββ rbac-lite-partner-access-change.md
βββ reports/ # Generated audit evidence (ignored by Git)
- Copy
templates/change-request-template.mdto PR description - Fill in all required fields
- CI/CD runs automated validation
- Request review according to risk level
- Merge only after passing all gates
Test the policy engine in under 2 minutes on your local machine.
- Python 3.8+
- Git
- Bash or Git Bash (Windows)
1. Clone and enter the repo
git clone https://github.com/Jonnenpijonne/infrastructure-change-quality-gate.git
cd infrastructure-change-quality-gate2. Test a valid Class 2 change request (should PASS)
python validation/pre-merge-checks/validate-change-request.py \
examples/rbac-lite-partner-access-change.md3. Test with the modular CLI validator
python validation/pre_merge_checks/cli.py \
examples/rbac-lite-partner-access-change.md4. Run unit tests
python -m pytest -qExpected output: QUALITY GATE: PASSED
5. Generate local audit evidence report
scripts/generate-audit-report.sh examples/rbac-lite-partner-access-change.mdExpected output location: reports/gatehouse-audit-evidence-report.md
- β Required sections present
- β All mandatory fields filled
- β Risk class defined and justified (1-3)
- β Rollback plan present (Class 2-3)
- β Sufficient approvers named (1-3 based on risk)
- β Test plan present (Class 2-3)
- β Freeze period checked (Class 3)
- β JSON output for CI/CD integration
RBAC-Lite is a lightweight WordPress-based multi-tenant access-control plugin for partner, reseller or subsidiary environments. It focuses on partner isolation, user-to-partner assignment, audit logging and NDA/terms enforcement.
In this repository, RBAC-Lite is used as an example governance use case for validating access-management and tenant-isolation related infrastructure changes before merge.
- The validator is generic and policy-agnostic. RBAC-Lite is one example integration, not hardcoded logic.
- Risk classification boundary:
- Risk Class 2 = validator repository (this project) governance/integration example
- Risk Class 3 = real production RBAC-Lite tenant isolation / partner isolation code changes
- The validator does not replace RBAC-Lite; it validates whether RBAC-Lite-related changes meet governance and approval requirements before merge.
- Documentation:
docs/integrations/rbac-lite.md - Example change request:
examples/rbac-lite-partner-access-change.md - Related repository: RBAC-Lite
python validation/pre-merge-checks/validate-change-request.py \
examples/rbac-lite-partner-access-change.mdThis repository generates local Markdown audit evidence reports to document change validation and approval trails. Reports are suitable for compliance evidence and governance audits.
scripts/generate-audit-report.sh examples/rbac-lite-partner-access-change.mdOutput:
reports/gatehouse-audit-evidence-report.md
The report includes:
- Validator JSON output (structured validation results)
- Risk classification details
- Approval chain and reviewer evidence
- Test plan and rollback plan summary
- Audit trail metadata
The reports/ directory is ignored by Git because audit evidence reports are generated artifacts, not source code. Each time you run validation, a new audit evidence report is created with:
- Validation timestamp
- Pass/fail status with detailed findings
- Governance compliance checkpoints
This repository includes automated CI/CD workflows for continuous quality gate enforcement and audit evidence generation.
| Workflow | Path | Purpose |
|---|---|---|
| Quality Gate | .github/workflows/quality-gate.yml |
Runs automated validator on all PR change requests |
| Quality Gate Demo | .github/workflows/quality-gate-demo.yml |
Demonstrates validator with example inputs |
| Audit Evidence Report | .github/workflows/audit-evidence-report.yml |
Generates and publishes audit evidence as workflow summary |
| Compliance Check | .github/workflows/compliance-check.yml |
Verifies ISO 27001 compliance gates |
| CodeQL / Python Quality | .github/workflows/codeql-python.yml |
Security scanning and code quality analysis |
The audit evidence workflow:
- Runs the validator on change requests
- Generates a Markdown audit evidence report
- Writes the report to GitHub Actions Summary (visible in workflow run details)
- Uploads
reports/as an artifact with 90-day retention for audit evidence archival
This ensures every change is documented with auditable proof of validation and approval.
| Branch | Purpose |
|---|---|
main |
Default branch and current source of truth. Contains the validated portfolio-ready baseline. |
develop |
Legacy/development branch, retained only if active development requires it. |
demo/johtoportaalle |
Legacy leadership/demo branch. May be updated or removed if no longer needed. |
test/compliance-kit-demo |
Legacy compliance kit test/demo branch. May be updated or removed if no longer needed. |
Current development should normally start from
mainunless a specific demo or test branch is intentionally maintained.
MIT License. See LICENSE file for details.
A DevSecOps governance and quality gate engine for infrastructure changes, designed as a portfolio artifact demonstrating:
- ποΈ Formal change management & compliance automation
- π ISO 27001 aligned governance controls
- π Audit evidence and compliance documentation
- π Integration with governance frameworks (RBAC-Lite example)
- π CI/CD-native policy enforcement
- π‘οΈ Role-based approval workflows
- π Automated audit trail generation
Suitable for DevSecOps, governance, operational security, IAM/RBAC, audit evidence, and compliance automation roles.