-
Notifications
You must be signed in to change notification settings - Fork 6
Implementation Plan
Huzefaaa2 edited this page Jan 26, 2026
·
1 revision
This plan outlines modular, safe, incremental delivery for TerraGuard’s enterprise scope.
flowchart TB
UI[Policy UI + Audit UI] --> BFF[API Gateway / BFF]
BFF --> AUTH[Auth + RBAC]
BFF --> EVAL[Policy Evaluation Core]
EVAL --> REG[Registry + Policy Packs]
EVAL --> EVID[Evidence + Audit Store]
REG --> DB[(Postgres)]
EVID --> OBJ[(Object Storage)]
UI schema
Policy:
id, name, description
category: security | cost | resiliency | compliance
severity: info | warn | block
scope: org | group | repo
providers: [aws, azurerm, google, ...]
rule_type: rego | native | invariant
rule_body
metadata: { standard, control_id, owner, expiry }
status: draft | approved | deprecated
version
API
POST /policiesPUT /policies/{id}GET /policies/{id}GET /policies?scope=org
DB
policiespolicy_versionspolicy_metadata
Model
baseline_policy = true- Resolution order: baseline → pack → environment → app
API
POST /baselinesGET /baselines
DB
baselinesbaseline_bindings
Model
- org → group → subgroup → repo inheritance
API
POST /integrations/gitlab/groupsGET /integrations/gitlab/groups/{id}/policies
DB
gitlab_groupsgroup_policy_bindings
Workflow
- Draft → Review → Approved → Active → Deprecated
API
POST /policies/{id}/versionsPOST /policies/{id}/approveGET /policies/{id}/versions
DB
policy_versionspolicy_approvals
Events
- policy create/update/delete
- approval actions
- evaluation results
- export events
DB
-
audit_events(actor, action, resource, timestamp, metadata json)
Outputs
- PDF, CSV, JSON evidence bundles
API
POST /exportsGET /exports/{id}
Storage
- Object storage with immutable evidence archives
Inputs
- last approved policy set
- current repo/state
API
POST /drift/check
DB
drift_snapshotsdrift_findings
Flow
CI → POST /evaluate → policy engine → pass/warn/block + evidence URL
API
POST /evaluateGET /results/{id}
DB
evaluationsevaluation_findings
Structure
packs/
pci-dss/
policies/
metadata.yaml
banking/
azure-landing-zone/
API
GET /packsGET /packs/{id}
DB
policy_packspack_versions
Model
- attach remediation guidance per rule
- severity-based recommendation templates
DB
rule_recommendations
Signals
- environment, risk tier, previous violations
API
-
POST /evaluatewithcontext
DB
risk_profiles
- Enterprise data model + API scaffolding.
- Baselines + policy approvals + audit trails.
- Evidence exports + policy packs.
- Guardrails-as-a-Service API.
- Intelligent evaluation and suggestions.