Self-Hosted DevSecOps for Kubernetes β Scan Every Push. Block Misconfigurations Before They Reach Production.
A self-hosted DevSecOps platform that scans every Git push and blocks security misconfigurations, hardcoded secrets, and infrastructure vulnerabilities before they reach production.
π Quick Start Β· π Documentation Β· π‘οΈ SecTL Engine Β· πΊοΈ Roadmap Β· π€ Contributing
Real-time overview of connected repositories, scan history, and security posture at a glance.
Add, remove, and monitor repositories β each automatically webhook-connected to the scan pipeline.
Per-repository scan summary with status indicators and quick-action controls.
Scan history list with PASS/FAIL status, timestamps, and scan type breakdown.
Detailed findings view β rule ID, severity, file path, description, and remediation guidance per violation.
High-level scan result summary grouped by severity (CRITICAL β LOW) with finding counts.
Manually trigger a scan from the dashboard, or let the GitHub webhook fire it automatically on every push.
ZeroTrustOps scans every Git push, detects misconfigurations and secrets, and blocks insecure infrastructure before it reaches production.
Powered by a custom enforcement engine (SecTL), along with Gitleaks for secrets detection, it provides an end-to-end DevSecOps pipeline with automated scanning, CI/CD enforcement, and a real-time dashboard β all running locally with a single command.
Every push is treated as a security checkpoint. If it fails, it never deploys.
git push
βββ GitHub webhook triggers the scan pipeline
βββ Repository is cloned into an isolated scan environment
β
βββ π Static Analysis (SecTL)
β βββ Scans IaC: Kubernetes, Terraform, Helm
β βββ Detects misconfigurations (RBAC, networking, privilege escalation)
β βββ Applies 70+ security rules
β βββ Assigns severity levels (CRITICAL β LOW)
β
βββ π Secrets Detection (Gitleaks)
β βββ Identifies API keys, tokens, passwords, and exposed credentials
β
βββ π§ Findings Processing
β βββ Normalizes results (rule_id, severity, file path)
β βββ Deduplicates issues
β βββ Attaches precise remediation guidance
β
βββ π¦ Enforcement Engine (CI/CD Gate)
β βββ Evaluates findings against severity thresholds
β βββ Returns binary decision β PASS / FAIL
β
βββ ποΈ Persistence Layer
β βββ Stores scan results, history, and findings in PostgreSQL
β
βββ π Real-time Feedback Loop
βββ Updates dashboard instantly
βββ Displays repo status (PASS / FAIL)
βββ Shows severity breakdown
βββ Provides actionable fixes per finding
- π« Blocks insecure Kubernetes deployments before they ever reach your cluster
- π Prevents secrets from leaving your repo by detecting hardcoded credentials on every push
- π¦ Fails CI instantly on critical issues with a clear PASS/FAIL security gate
- π‘οΈ Enforces security policies at deployment time using admission control (Kyverno)
- π Detects misconfigurations across IaC and containers (Kubernetes, Terraform, Helm, images)
- π Gives actionable insights, not just logs β every finding includes exact fixes and context
| Component | Technology | Role |
|---|---|---|
| SecTL CLI | Go 1.21+ | Custom static analysis engine β 70+ built-in rules |
| Platform API | Python / FastAPI | Webhook receiver, scan orchestrator, REST API |
| Dashboard | React + Vite | Real-time scan results and repository management |
| Database | PostgreSQL 16 | Persistent storage for repos, scans, and findings |
| Secrets Scanner | Gitleaks | Detects hardcoded secrets and credentials |
All services run in Docker Compose and communicate over an internal bridge network.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Docker Compose Network β
β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββ β
β β React β β FastAPI β β PostgreSQL β β
β β Dashboard βββββΊβ Backend βββββΊβ 16 β β
β β :3000 β β :8000 β β :5432 β β
β ββββββββββββββββ ββββββββ¬ββββββββ βββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β SecTL CLI β β
β β + Gitleaks β β
β βββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β²
β GitHub Webhook (ngrok tunnel)
β
βββββββ΄βββββββ
β GitHub β
β Repos β
ββββββββββββββ
SecTL is a purpose-built CLI tool written in Go. It scans Infrastructure-as-Code files for security misconfigurations and produces a binary PASS/FAIL exit code suitable for use as a CI/CD gate.
| Type | Target | Coverage |
|---|---|---|
k8s |
Kubernetes manifests | Pods, Deployments, RBAC, Ingress, ConfigMaps, ServiceAccounts |
terraform |
Infrastructure as Code | AWS, GCP, Azure β S3, IAM, Security Groups, RDS, EKS, CloudTrail |
helm |
Helm charts | Chart.yaml, values.yaml, rendered templates |
posture |
Live AWS account | IAM root keys, MFA enforcement, password policy, S3 bucket posture |
supply-chain |
Container images | Digest pinning, :latest tag detection, EOL base images |
| Rule ID | Severity | Description |
|---|---|---|
| K8S-001 | π΄ CRITICAL | hostPID enabled β container sees all host processes |
| K8S-004 | π΄ CRITICAL | Privileged container β full host device access |
| K8S-020 | π΄ CRITICAL | RBAC wildcard apiGroups (*) |
| K8S-024 | π΄ CRITICAL | Binding to cluster-admin role |
| K8S-025 | π΄ CRITICAL | Binding to unauthenticated/anonymous subject |
| K8S-031 | π HIGH | Hardcoded secret in environment variable |
| K8S-005 | π HIGH | allowPrivilegeEscalation not set to false |
| Rule ID | Severity | Description |
|---|---|---|
| TF-S3-010 | π΄ CRITICAL | S3 bucket ACL set to public |
| TF-IAM-001 | π΄ CRITICAL | IAM policy allows Action: * (all actions) |
| TF-SG-001 | π΄ CRITICAL | Security group: sensitive port open to internet |
| TF-RDS-002 | π΄ CRITICAL | RDS instance publicly accessible |
| TF-EKS-002 | π HIGH | EKS API server publicly accessible |
π Full rule list:
sectl rulesβ filter with--source k8s,--source terraform,--severity critical
# Scan Kubernetes manifests
sectl scan ./manifests --type k8s
# Scan Terraform β fail CI on HIGH or above
sectl scan ./infra --type terraform --severity high --fail-on-findings
# Scan Helm chart
sectl scan ./charts/myapp --type helm
# Verify container images (digest, EOL, latest tag)
sectl verify nginx:latest myapp:1.0.0
# Audit live AWS account posture
sectl audit --provider aws --region us-east-1
# JSON output for programmatic use
sectl scan ./manifests --type k8s --output json
# SARIF output for GitHub Security tab
sectl scan ./manifests --type k8s --output sarif| Dependency | Minimum Version | Notes |
|---|---|---|
| Docker | 24+ | With Docker Compose plugin |
| Docker Compose | 2.x | Bundled with Docker Desktop |
| Go | 1.21+ | For compiling SecTL |
| Git | Any | For cloning and webhook use |
# 1. Clone the repository
git clone https://github.com/Debasish-87/ZeroTrustOps-Platform.git
cd ZeroTrustOps-Platform
# 2. Run the one-command installer
bash setup.shThe setup.sh script will automatically:
- β Verify all prerequisites are installed
- βοΈ Compile the SecTL binary from source
- π³ Build and start all Docker containers
- π©Ί Wait for all services to pass health checks
| Service | URL | Description |
|---|---|---|
| π Dashboard | http://localhost:3000 | React UI β main interface |
| β‘ API | http://localhost:8000 | FastAPI backend |
| π API Reference | http://localhost:8000/docs | Swagger / OpenAPI docs |
# Step 1: Expose the local platform publicly via ngrok
ngrok http 8000In your GitHub repository β Settings > Webhooks > Add webhook:
| Field | Value |
|---|---|
| Payload URL | https://<your-ngrok-url>/webhook/github |
| Content type | application/json |
| Events | β Push events |
Every subsequent git push will automatically trigger a full scan.
bash uninstall.shRemoves all containers, volumes, images, networks, and the
sectlbinary. Source code is not affected.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/health |
Health check β all services | β |
GET |
/api/stats |
Dashboard overview counts | β |
GET |
/api/repos |
List all connected repositories | β |
POST |
/api/repos |
Add a new repository | β |
DELETE |
/api/repos/:id |
Remove a repository | β |
GET |
/api/scans |
List recent scans | β |
GET |
/api/scans/:id |
Scan detail with all findings | β |
POST |
/api/scans/trigger |
Manually trigger a scan | β |
POST |
/webhook/github |
GitHub push webhook receiver | HMAC |
curl -X POST http://localhost:8000/api/scans/trigger \
-H "Content-Type: application/json" \
-d '{"repo_id": 1}'curl http://localhost:8000/api/scans/42 | jq '.findings[] | select(.severity == "CRITICAL")'ZeroTrustOps-Platform/
βββ setup.sh # One-command installer
βββ uninstall.sh # Complete cleanup script
βββ docker-compose.yml # Service orchestration
β
βββ sectl/ # Security CLI (Go)
β βββ main.go
β βββ cmd/ # scan, audit, verify, rules commands
β β βββ audit.go
β β βββ helpers.go
β β βββ root.go
β β βββ rules.go
β β βββ scan.go
β β βββ verify.go
β βββ internal/
β βββ scanner/ # K8s, Terraform, Helm analyzers + unit tests
β β βββ finding.go
β β βββ helm.go
β β βββ k8s.go
β β βββ k8s_test.go
β β βββ terraform.go
β β βββ terraform_test.go
β βββ posture/ # Live AWS account audit
β β βββ aws.go
β βββ supply/ # Container image supply chain checks
β β βββ chain.go
β βββ report/ # Table, JSON, SARIF output renderers
β βββ render.go
β
βββ platform/
β βββ api/ # FastAPI backend
β β βββ main.py # Webhook handler, scan engine, REST API
β β βββ requirements.txt
β β βββ Dockerfile
β βββ web/ # React dashboard
β β βββ src/
β β β βββ pages/ # Dashboard, Repositories, Scans, Setup
β β β β βββ Dashboard.jsx
β β β β βββ Repositories.jsx
β β β β βββ ScanDetail.jsx
β β β β βββ Scans.jsx
β β β β βββ Setup.jsx
β β β βββ components/
β β β β βββ Layout.jsx
β β β βββ App.jsx
β β β βββ main.jsx
β β βββ Dockerfile
β βββ db/
β βββ init.sql # PostgreSQL schema
β
βββ manifests/
βββ dev/ # Hardened Kubernetes deployment example
β βββ deployment.yaml
β βββ service.yaml
βββ kyverno-policies/ # Admission control enforcement policies
βββ disallow-latest-tag.yaml
βββ disallow-privileged.yaml
βββ require-resource-limits.yaml
Three cluster-wide admission control policies are included. All run in Enforce mode β they actively block non-compliant resources from entering the cluster.
| Policy | Mode | Enforcement |
|---|---|---|
disallow-latest-tag |
Enforce | Blocks containers using :latest or untagged images |
disallow-privileged |
Enforce | Blocks privileged containers, privilege escalation, host namespaces |
require-resource-limits |
Enforce | Requires CPU and memory requests and limits on all containers |
# Apply all Kyverno policies to your cluster
kubectl apply -f manifests/kyverno-policies/
# Verify policies are active
kubectl get clusterpolicyorganizations
βββ repositories
βββ scans
βββ findings
Each finding record stores:
| Field | Type | Description |
|---|---|---|
tool |
text | sectl or gitleaks |
rule_id |
text | e.g. K8S-001, TF-IAM-001 |
severity |
text | CRITICAL, HIGH, MEDIUM, LOW |
category |
text | e.g. rbac, network, secrets |
title |
text | Short rule description |
description |
text | Full violation explanation |
file_path |
text | Relative path to the affected file |
remediation |
text | How to fix the violation |
# Unit tests for SecTL scanners
cd sectl
go test ./internal/scanner/... -v
# Run with race condition detection
go test -race ./internal/...
# Test against sample manifests
sectl scan ./sectl/testdata/k8s --type k8s
sectl scan ./sectl/testdata/terraform --type terraformTest data included:
| File | Purpose |
|---|---|
testdata/k8s/bad-deployment.yaml |
Triggers K8S rules |
testdata/k8s/good-deployment.yaml |
Should produce zero findings |
testdata/terraform/bad-infra.tf |
Triggers TF rules |
testdata/terraform/good-infra.tf |
Should produce zero findings |
Create a .env file in the project root (copied from .env.example):
# Database
POSTGRES_USER=zerotrust
POSTGRES_PASSWORD=changeme
POSTGRES_DB=zerotrust
# GitHub Webhook
GITHUB_WEBHOOK_SECRET=your-secret-here
# API
API_HOST=0.0.0.0
API_PORT=8000| Service | Internal Port | External Port | Configurable |
|---|---|---|---|
| Dashboard | 3000 | 3000 | β |
| API | 8000 | 8000 | β |
| PostgreSQL | 5432 | 5432 | β |
- GitHub commit status API β report PASS/FAIL directly on pull requests
- Slack and Microsoft Teams webhook notifications
- Trivy container image vulnerability scanning
- Falco runtime threat detection
- SARIF upload to GitHub Advanced Security via API
- Multi-organization support
- Prometheus metrics endpoint (
/metrics) - Role-based access control (RBAC) for multi-team environments
- GitLab webhook support
Contributions are welcome! Here's how to get started:
# Fork and clone
git clone https://github.com/<your-handle>/ZeroTrustOps-Platform.git
cd ZeroTrustOps-Platform
# Create a feature branch
git checkout -b feature/my-new-rule
# Add your rule in sectl/internal/scanner/
# Add a test in the corresponding _test.go file
# Add test data in sectl/testdata/
# Run tests
go test ./...
# Submit a pull requestAdding a new SecTL rule: See sectl/internal/scanner/k8s.go or terraform.go for patterns. Each rule requires a RuleID, Severity, Title, Description, and Remediation.
A developer pushes a Kubernetes manifest with:
- privileged container enabled
- latest image tag
β Scan triggers automatically
β Critical issues detected
β CI fails
β Deployment is BLOCKED
Nothing insecure reaches production.
Most security tools only detect issues.
ZeroTrustOps enforces them.
If it's insecure, it doesn't deploy. Period.
Distributed under the Apache 2.0 License.
Debasish Mohanty
"Trust nothing. Scan everything. Deploy with confidence."
β Star this repo if it helps secure your infrastructure! β






