content_​targeting_​protection

Version: v2025-09-09Includes use: Yes

Behavior name: Content Targeting - Protection

Content Targeting is based on EdgeScape, Akamai's location-based access control system. You can use it to allow or deny access to a set of geographic regions or IP addresses.

Default behavior

These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.

data "akamai_property_rules_builder" "content_targeting_protection" {
  rules_v2025_09_09 {
    name     = "Content Targeting - Protection"
    comments = "Allows or denies access to content to a set of geographic regions or IP addresses."
    behavior {
      content_targeting_protection {
        enabled = false
      }
    }
  }
}
"behaviors": [
  {
    "name": "contentTargetingProtection",
    "options": {
      "enabled": false
    }
  }
]

Options

Option Description
enabled
Enables the Content Targeting feature.
enable_geo_protection
When enabled, verifies IP addresses are unique to specific geographic regions.
geo_protection_mode
Specifies how to handle requests. Value is one of:
  • ALLOW. Allow requests.
  • DENY. Deny requests.
countries
Specifies a set of two-character ISO 3166 country codes from which to allow or deny traffic. See EdgeScape Data Codes for a list.
regions
Specifies a set of ISO 3166-2 regional codes from which to allow or deny traffic. For a list of codes, see EdgeScape Data Codes.
dmas
Specifies the set of Designated Market Area codes from which to allow or deny traffic. For a list of codes, see EdgeScape Data Codes.
override_ip_addresses
Specify a set of IP addresses or CIDR blocks that exceptions to the set of included or excluded areas.
enable_geo_redirect_on_deny
When enabled, redirects denied requests rather than responding with an error code.
geo_redirect_url
This specifies the full URL to the redirect page for denied requests.
enable_ip_protection
Allows you to control access to your content from specific sets of IP addresses and CIDR blocks.
ip_protection_mode
Specifies how to handle requests. Value is one of:
  • ALLOW. Allow requests.
  • DENY. Deny requests.
ip_addresses
Specify a set of IP addresses or CIDR blocks to allow or deny.
enable_ip_redirect_on_deny
When enabled, redirects denied requests rather than responding with an error code.
ip_redirect_url
This specifies the full URL to the redirect page for denied requests.
enable_referrer_protection
Allows you allow traffic from certain referring websites, and disallow traffic from unauthorized sites that hijack those links.
referrer_protection_mode
Specify the action to take. Value is one of:
  • ALLOW. Allow requests.
  • DENY. Deny requests.
referrer_domains
Specifies the set of domains from which to allow or deny traffic.
enable_referrer_redirect_on_deny
When enabled, redirects denied requests rather than responding with an error code.
referrer_redirect_url
This specifies the full URL to the redirect page for denied requests.
enable_x_forwarded_for_within_geo_protection
Specifies how Akamai responds to the X-Forwarded-For header when Geo Protection is enabled. When enabled, ignores the information from the `X-Forwarded-For` header.
enable_x_forwarded_for_within_ip_protection
Specifies how Akamai responds to the X-Forwarded-For header when IP Protection is enabled. Value is one of:
  • IGNOREXFF. Ignores any IP addresses passed in the `X-Forwarded-For` header and only checks the connecting IP address.
  • XFFANDIP. Checks any IP addresses passed in the `X-Forwarded-For` header as well as the connecting IP address.
  • IGNOREIPIFXFFON. Ignores the connecting IP address if the `X-Forwarded-For` header is passed.