Script behavior rules

akamai_appsec_script_behavior_rules

Get all CPC script behavior rules assigned to a security policy.

data "akamai_appsec_script_behavior_rules" "my_rules" {
  config_id          = 12345
  security_policy_id = "abcd_123456"
}

output "my_rules" {
  value = data.akamai_appsec_script_behavior_rules.my_rules
}
my_rules = {
  config_id          = 12345
  security_policy_id = "abcd_123456"
  rules = [
    {
      rule_id          = 3000601
      rule_name        = "Block PCI Data Access"
      rule_description = "Prevents third-party scripts from accessing payment card data"
      activity_type    = "DATA_ACCESS"
      action           = "deny"
      page_condition   = "MATCHES"
      page_values      = ["/checkout", "/billing/*"]
      script_type      = "THIRD_PARTY"
      script_condition = "MATCHES"
      script_values    = ["analytics.example.com/*"]
      activity_values_condition = "MATCHES"
      activity_values  = ["CREDIT_CARD", "PII"]
    }
  ]
}

Arguments

Pass all required arguments to get your script behavior rules.

ArgumentRequiredDescription
config_id✔️A security configuration ID.
security_policy_id✔️A security policy ID.

Attributes

Returned to you is a rules list.

AttributeDescription
rule_idA script behavior rule's ID.
rule_nameThe name of the script behavior rule.
rule_descriptionA human-readable description of the rule.
activity_typeThe category of client-side activity the rule governs. Possible value is DATA_ACCESS.
actionAction taken when all rule conditions match. Possible values are:
  • alert. Records the event.
  • deny. Blocks the script from performing the specified activity.
page_conditionHow page_values are evaluated. Possible value is MATCHES. This value triggers the rule when the page URL matches any value in the list.
page_valuesA list of page URL path patterns the rule targets.
script_typeThe script category the rule targets. Possible value is THIRD_PARTY.
script_conditionHow script_values are evaluated. Possible value is MATCHES that targets scripts whose origin matches any value in the list.
script_valuesA list of script origin host patterns the rule targets. These are values you define, not a fixed set. Supports wildcards; for example, analytics.example.com/* matches all scripts served from that host.
activity_values_conditionHow activity_values are evaluated. Possible value is MATCHES. It applies the rule when the activity involves any of the listed data types.
activity_valuesA list of specific data types the rule targets. Possible values are CREDIT_CARD and PII.

Did this page help you?