For the complete documentation index, see llms.txt. This page is also available as Markdown.

Manage custom rules

Manage custom Application Security detection rules with Terraform.

Deploy and maintain custom detection logic programmatically across multiple tenants via Terraform. This enables you to define the logic directly in HCL via the frameworks block, ensuring identical rule distribution organization-wide.

Configuration

Use the cortexcloud_appsec_rule resource.

# Custom AppSec rule for Terraform
resource "cortexcloud_appsec_rule" "custom_iac_rule" {
  name         = "Custom Terraform Security Rule"
  severity     = "CRITICAL"
  scanner      = "IAC"
  category     = "NETWORKING"
  sub_category = "INGRESS_CONTROLS"
  description  = "Detect insecure ingress configurations in Terraform"

  frameworks {
    name                    = "TERRAFORM"
    definition              = "resource \"aws_security_group\" \"example\" { ingress { cidr_blocks = [\"0.0.0.0/0\"] } }"
    definition_link         = "https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group"
    remediation_description = "Restrict ingress to specific IP ranges"
  }

  labels = ["production", "networking", "aws"]
}

For rule schema details, refer to Rules Schema.

For more information on Application Security rules, refer to Application Security Rules.

Last updated

Was this helpful?