ops0ops0

Policies & Compliance

Define and enforce infrastructure policies across Terraform, Ansible configurations, and Kubernetes clusters. ops0 evaluates policies before deployments, enforces Kyverno rules on clusters, and tracks violations in the compliance dashboard.

ops0 Policies list showing IaC, Configuration and Kubernetes policies

Policy Types

The Policies page organizes policies into tabs by infrastructure type:

TabEngineUse Case
IaC PoliciesOPA / RegoEvaluate Terraform and OpenTofu plans
Configuration PoliciesOPA / RegoEvaluate Ansible configuration projects
Kubernetes PoliciesKyverno (YAML)Enforce rules on Kubernetes clusters

Severity Levels

SeverityBehavior
ErrorBlocks deployment and appears as policy_blocked status
WarningNon-blocking violation counted in compliance metrics
InfoAdvisory only with no enforcement

Policy Categories

CategoryExample Rules
SecurityS3 encryption required, no public IPs on databases, security groups restricted
CostInstance size limits, no expensive instance types
ComplianceResources in approved regions only, encryption at rest
TaggingRequired tags (Owner, Environment, CostCenter), naming conventions
Best PracticesIndustry standards and conventions
CustomUser-defined policies for any scenario

AI Policy Generation

Generate policies automatically using natural language prompts. ops0 produces valid Rego or Kyverno YAML based on your description.

Describe What You Need

Enter a prompt such as "Block any S3 bucket without encryption in production accounts."

Select Parameters

Choose the category (security, cost, compliance, etc.) and severity level.

Review Generated Code

ops0 produces a complete Rego policy or Kyverno YAML that you can edit before saving.

Save and Activate

Save the policy and optionally assign it to projects or policy groups.

AI Configuration

AI policy generation requires AI features to be configured at the organization level in Settings → API Configuration.


Policy Groups

Organize policies into named groups and attach groups to projects. This lets you manage policy assignments at scale instead of mapping individual policies.

FieldDescription
NameHuman-readable group name
DescriptionPurpose of this group
Typeiac, configurations, or kubernetes
EnabledToggle group enforcement on/off
PoliciesPolicies included in this group
ProjectsProjects this group applies to

How Groups Work

  • Create a group and add policies to it
  • Map the group to one or more projects
  • All policies in the group apply to every mapped project
  • Toggle the group to enable/disable all policies at once

Effective Policies

A project's effective policies are the union of:

  • Policies directly mapped to the project
  • Policies inherited from policy groups mapped to the project

View a project's effective policies at Policies → By Project.


Policy Templates

ops0 includes a library of built-in policy templates for common compliance and security scenarios. Import templates instead of writing policies from scratch.

CategoryTemplates
AWS SecurityS3 encryption, no public access, security group rules
AWS CostInstance limits, GP3 volumes
GCP SecurityStorage encryption, firewall rules
Azure SecurityStorage account encryption, NSG rules
KubernetesSecurity contexts, resource limits, image policies
TaggingRequired tags, naming conventions

Browse Templates

Go to Policies → Templates to view the built-in library.

Preview

Review the Rego code and description before importing.

Import

Click Import to add the template as a new policy. Customize name, severity, and category as needed.


Compliance Frameworks

Import pre-built compliance frameworks that map industry standards to ops0 policies. Each framework contains controls specific to a cloud provider or platform.

FrameworkProviders
CIS BenchmarksAWS, GCP, Azure, Oracle Cloud, Kubernetes, Ansible
SOC 2AWS, GCP, Azure, Oracle Cloud
HIPAAAWS, GCP, Azure, Oracle Cloud
GDPRAWS, GCP, Azure, Oracle Cloud
ISO 27001AWS, GCP, Azure, Oracle Cloud
ISO 27002AWS, GCP, Azure, Oracle Cloud
PCI-DSSAWS, GCP, Azure, Oracle Cloud
NSA Kubernetes HardeningKubernetes
Pod Security StandardsKubernetes
STIG AnsibleAnsible

View Available Frameworks

Go to Policies → Frameworks and select your cloud provider.

Preview Controls

Review the framework's controls and mapped policies before importing.

Import Framework

Import creates a policy group with all framework policies pre-configured.


Kyverno Policies (Kubernetes)

For Kubernetes clusters, ops0 supports Kyverno policies written in YAML. Kyverno runs natively in the cluster and enforces policies at admission time.

FeatureDescription
Create/ImportWrite Kyverno YAML or import from templates
Cluster MappingMap policies to specific Kubernetes clusters
Enforcement ModesEnforce (block violations) or Audit (log only)
ToggleEnable/disable individual policies
ValidationSyntax validation before deployment

Policy Diagnostics

The Policy Diagnostics modal shows the health of Kyverno on a cluster:

  • Kyverno installation status
  • Deployed policies and their enforcement modes
  • Webhook verification status
  • Per-rule detail and status

Policy Actions

ActionDescription
CreateWrite a new policy or use AI generation
EditModify policy code, settings, or mappings
TestRun against sample input in the editor
Enable/DisableToggle enforcement with a single click
Map to ProjectsAssign directly or via policy groups
DeleteRemove the policy permanently

Policy Check History

View a log of all policy evaluations across projects. The history shows:

  • Which policies ran and their results (pass/fail)
  • The project and deployment that triggered the check
  • Timestamps and duration
  • Violation details for failed checks

Access at Policies → Check History.


Example: Blocking an Insecure S3 Bucket

The Policy

package ops0.terraform.s3

deny[msg] {
    resource := input.planned_values.root_module.resources[_]
    resource.type == "aws_s3_bucket"
    not resource.values.server_side_encryption_configuration

    msg := sprintf(
        "S3 bucket '%s' must have encryption enabled",
        [resource.values.bucket]
    )
}

Policy Settings

Name:         S3 Encryption Required
Type:         IaC (Terraform)
Category:     Security
Severity:     Error

Deployment Blocked

Terraform Plan: 1 to add, 0 to change, 0 to destroy

Policy Evaluation
─────────────────────────────────────
✗ FAILED - S3 Encryption Required (Error)

Violations:
  • S3 bucket 'company-data-bucket' must have encryption enabled

Deployment blocked. Fix violations and retry.