Skip to main content

PCI-DSS Compliance Generator

Stacktic automates PCI-DSS v4.0 network segmentation and compliance reporting through a single configuration attribute. No manual policy writing — the pipeline reads your stack topology and generates all NetworkPolicies, exceptions, and compliance reports automatically.


How It Works

StepWhat Happens
1. Set attributeconfiguration.microsegmentation_level = "pci_dss_strict"
2. Pipeline runscreate-pci-networkpolicy.py reads stack-metadata.yaml
3. Policies generatedDefault-deny + link-based + exception + internet rules
4. Output filesIndividual NetworkPolicy JSON files + manifest + Mermaid diagram
5. Compliance report250 PCI-DSS v4.0 controls evaluated against stack topology

Configuration

AttributeValueEffect
microsegmentation_levelnoneNo network policies generated
microsegmentation_levelpci_dss_strictFull PCI-DSS strict mode

Set via Stacktic UI or API on the system configuration.


What PCI-DSS Strict Mode Generates

1. Default-Deny Baseline (PCI DSS 1.2.1)

Every namespace gets default-deny-ingress + default-deny-egress policies. All traffic is blocked unless explicitly allowed.

For every component link in the stack topology, the generator creates explicit ingress/egress rules:

Link DirectionPolicy Generated
A → B (egress)Egress from A's namespace to B's namespace on B's port
A → B (ingress)Ingress to B's namespace from A's namespace on B's port

3. Component-Type Exceptions

Defined in pci-exceptions.yaml — per-component-type rules with explicit ports. No allow_all flags.

ComponentException TypePorts
cert_managerIngress from kube-system443, 9402, 10250
argo_cdEgress to git443
prometheusIngress from grafana9090
apisixIngress external80, 443, 9443
opaEgress to kube-api443
stack_agentCluster-wide accessPer-tool ports

4. System Exceptions (All Namespaces)

RuleTargetPort
DNS egresskube-system53 (UDP/TCP)
K8s API egressdefault namespace443

No blanket internet egress — only the two rules above.

5. Internet Exceptions (Explicit Only)

Only components that genuinely need external access get it:

ComponentDirectionPortsReason
apisixIngress + Egress80, 443, 9443API gateway
argo_cdEgress443Git repos
cert_managerEgress443ACME/Let's Encrypt
opaEgress443Policy bundles
veleroEgress443Backup storage
kedaEgress443External scalers
keycloakEgress443Identity federation
sonarqubeEgress443Plugin updates

Not included: grafana, prometheus, opensearch, backend apps — no internet access in PCI mode.

6. Intra-Namespace Communication

Pods within the same namespace can communicate with each other. No allow_all_ports flags.


Generated Output Files

FileContent
networkpolicy__*.jsonIndividual NetworkPolicy resources per rule
networkpolicy-manifest.jsonComplete manifest listing all policies with metadata
network-diagram.mdMermaid diagram of all allowed traffic flows
compliance/pci-dss/README.mdPCI-DSS v4.0 compliance report (250 controls)

PCI Compliance Report

The pipeline evaluates 250 PCI-DSS v4.0 controls against your stack topology. Each control is scored based on which components are deployed and how they're configured.

Component-to-Requirement Mapping

ComponentPCI Requirements Covered
OPA1, 2, 5, 6, 7, 8, 11
Falco5, 10, 11
APISIX1, 4, 6, 8
Prometheus10, 11
CNPG3, 4
Keycloak7, 8
Trivy5, 6, 11
OpenSearch (SIEM)10, 11
External Secrets3, 4
Cert Manager4
Velero9
ArgoCD6

AI-Powered Compliance Tools (via MCP)

When FastMCP is linked to stack-agent, four PCI compliance tools are available:

ToolWhat It Does
pci_compliance_overview()Full report with per-requirement table and scores
pci_compliance_requirement(N)Drill into specific requirement (1-12)
pci_compliance_gaps()Prioritized gap analysis with recommendations
pci_compliance_component_impact(type)What-if analysis: effect of adding/removing a component

PCI Dashboards (OpenSearch SIEM)

When OpenSearch is deployed with SIEM enabled, PCI-specific dashboards are auto-generated per data source:

DashboardSourceContent
PCI - RuntimeFalcoRuntime security events, syscall anomalies
PCI - API GatewayAPISIXAPI access logs, auth failures, rate limiting
PCI - PolicyOPAPolicy violations, admission denials
PCI - AuditK8s AuditAPI server audit events
PCI - ScanTrivyVulnerability scan results
PCI - 360 OverviewAll sourcesCross-stack aggregated PCI view

Each dashboard is generated per-stack with unique IDs. Cross-stack PCI overview aggregates all stacks.


Exceptions Configuration

All PCI exceptions are defined in pci-exceptions.yaml with four sections:

SectionScopeDescription
well-known-portsReferencePort mapping per component type
component-exceptionsPer-typeIngress/egress rules with explicit ports and namespace selectors
system-exceptionsAll namespacesDNS and K8s API access only
internet-exceptionsExplicit listComponents allowed external network access

Standard vs PCI-DSS Network Policies

FeatureStandard ModePCI-DSS Strict
Default-denyPer namespaceEvery namespace
Internet egressAllowed for mostExplicit allowlist only
Port specificityService portsExact ports, no ranges
allow_all flagsHonoredIgnored
Intra-namespaceOpenAllowed, no wildcard ports
Compliance reportNot generated250 controls evaluated
Mermaid diagramGeneratedGenerated