oracle.oci.oci_waf_web_app_firewall_policy_facts – Fetches details about one or multiple WebAppFirewallPolicy resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.11.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_waf_web_app_firewall_policy_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about one or multiple WebAppFirewallPolicy resources in Oracle Cloud Infrastructure

  • Gets a list of all WebAppFirewallPolicies in a compartment.

  • If web_app_firewall_policy_id is specified, the details of a single WebAppFirewallPolicy will be returned.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
The OCID of the compartment in which to list resources.
Required to list multiple web_app_firewall_policies.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
display_name
string
A filter to return only resources that match the entire display name given.

aliases: name
lifecycle_state
list / elements=string
A filter to return only resources that match the given lifecycleState.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
sort_by
string
    Choices:
  • timeCreated
  • displayName
The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.
sort_order
string
    Choices:
  • ASC
  • DESC
The sort order to use, either 'ASC' or 'DESC'.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
web_app_firewall_policy_id
string
The OCID of the WebAppFirewallPolicy.
Required to get a specific web_app_firewall_policy.

aliases: id

Examples

- name: Get a specific web_app_firewall_policy
  oci_waf_web_app_firewall_policy_facts:
    # required
    web_app_firewall_policy_id: "ocid1.webappfirewallpolicy.oc1..xxxxxxEXAMPLExxxxxx"

- name: List web_app_firewall_policies
  oci_waf_web_app_firewall_policy_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    lifecycle_state: [ "lifecycle_state_example" ]
    display_name: display_name_example
    sort_order: ASC
    sort_by: timeCreated

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
web_app_firewall_policies
complex
on success
List of WebAppFirewallPolicy resources

Sample:
[{'actions': [{'body': {'text': 'text_example', 'type': 'STATIC_TEXT'}, 'code': 56, 'headers': [{'name': 'name_example', 'value': 'value_example'}], 'name': 'name_example', 'type': 'CHECK'}], 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'display_name': 'display_name_example', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'CREATING', 'request_access_control': {'default_action_name': 'default_action_name_example', 'rules': [{'action_name': 'action_name_example', 'condition': 'condition_example', 'condition_language': 'JMESPATH', 'name': 'name_example', 'type': 'ACCESS_CONTROL'}]}, 'request_protection': {'body_inspection_size_limit_exceeded_action_name': 'body_inspection_size_limit_exceeded_action_name_example', 'body_inspection_size_limit_in_bytes': 56, 'rules': [{'action_name': 'action_name_example', 'condition': 'condition_example', 'condition_language': 'JMESPATH', 'is_body_inspection_enabled': True, 'name': 'name_example', 'protection_capabilities': [{'action_name': 'action_name_example', 'collaborative_action_threshold': 56, 'collaborative_weights': [{'key': 'key_example', 'weight': 56}], 'exclusions': {'args': [], 'request_cookies': []}, 'key': 'key_example', 'version': 56}], 'protection_capability_settings': {'allowed_http_methods': [], 'max_http_request_header_length': 56, 'max_http_request_headers': 56, 'max_number_of_arguments': 56, 'max_single_argument_length': 56, 'max_total_argument_length': 56}, 'type': 'ACCESS_CONTROL'}]}, 'request_rate_limiting': {'rules': [{'action_name': 'action_name_example', 'condition': 'condition_example', 'condition_language': 'JMESPATH', 'configurations': [{'action_duration_in_seconds': 56, 'period_in_seconds': 56, 'requests_limit': 56}], 'name': 'name_example', 'type': 'ACCESS_CONTROL'}]}, 'response_access_control': {'rules': [{'action_name': 'action_name_example', 'condition': 'condition_example', 'condition_language': 'JMESPATH', 'name': 'name_example', 'type': 'ACCESS_CONTROL'}]}, 'response_protection': {'rules': [{'action_name': 'action_name_example', 'condition': 'condition_example', 'condition_language': 'JMESPATH', 'is_body_inspection_enabled': True, 'name': 'name_example', 'protection_capabilities': [{'action_name': 'action_name_example', 'collaborative_action_threshold': 56, 'collaborative_weights': [{'key': 'key_example', 'weight': 56}], 'exclusions': {'args': [], 'request_cookies': []}, 'key': 'key_example', 'version': 56}], 'protection_capability_settings': {'allowed_http_methods': [], 'max_http_request_header_length': 56, 'max_http_request_headers': 56, 'max_number_of_arguments': 56, 'max_single_argument_length': 56, 'max_total_argument_length': 56}, 'type': 'ACCESS_CONTROL'}]}, 'system_tags': {}, 'time_created': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00'}]
 
actions
complex
on success
Predefined actions for use in multiple different rules. Not all actions are supported in every module. Some actions terminate further execution of modules and rules in a module and some do not. Actions names must be unique within this array.
Returned for get operation

   
body
complex
on success

     
text
string
on success
Static response body text.

Sample:
text_example
     
type
string
on success
Type of HttpResponseBody.

Sample:
STATIC_TEXT
   
code
integer
on success
Response code.
The following response codes are valid values for this property:
* 2xx
200 OK 201 Created 202 Accepted 206 Partial Content
* 3xx
300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 307 Temporary Redirect
* 4xx
400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 408 Request Timeout 409 Conflict 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 422 Unprocessable Entity 429 Too Many Requests 494 Request Header Too Large 495 Cert Error 496 No Cert 497 HTTP to HTTPS
* 5xx
500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 507 Insufficient Storage
Example: `200`

Sample:
56
   
headers
complex
on success
Adds headers defined in this array for HTTP response.
Hop-by-hop headers are not allowed to be set:
* Connection * Keep-Alive * Proxy-Authenticate * Proxy-Authorization * TE * Trailer * Transfer-Encoding * Upgrade

     
name
string
on success
The name of the header field.

Sample:
name_example
     
value
string
on success
The value of the header field.

Sample:
value_example
   
name
string
on success
Action name. Can be used to reference the action.

Sample:
name_example
   
type
string
on success
* **CHECK** is a non-terminating action that does not stop the execution of rules in current module, just emits a log message documenting result of rule execution.
* **ALLOW** is a non-terminating action which upon matching rule skips all remaining rules in the current module.
* **RETURN_HTTP_RESPONSE** is a terminating action which is executed immediately, returns a defined HTTP response.

Sample:
CHECK
 
compartment_id
string
on success
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
 
display_name
string
on success
WebAppFirewallPolicy display name, can be renamed.

Sample:
display_name_example
 
freeform_tags
dictionary
on success
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`

Sample:
{'Department': 'Finance'}
 
id
string
on success
The OCID of the WebAppFirewallPolicy.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
lifecycle_details
string
on success
A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in FAILED state.

Sample:
lifecycle_details_example
 
lifecycle_state
string
on success
The current state of the WebAppFirewallPolicy.

Sample:
CREATING
 
request_access_control
complex
on success
Returned for get operation

   
default_action_name
string
on success
References an default Action to take if no AccessControlRule was matched. Allowed action types:
* **ALLOW** continues execution of other modules and their rules.
* **RETURN_HTTP_RESPONSE** terminates further execution of modules and rules and returns defined HTTP response.

Sample:
default_action_name_example
   
rules
complex
on success
Ordered list of AccessControlRules. Rules are executed in order of appearance in this array.

     
action_name
string
on success
References action by name from actions defined in WebAppFirewallPolicy.

Sample:
action_name_example
     
condition
string
on success
An expression that determines whether or not the rule action should be executed.

Sample:
condition_example
     
condition_language
string
on success
The language used to parse condition from field `condition`. Available languages:
* **JMESPATH** an extended JMESPath language syntax.

Sample:
JMESPATH
     
name
string
on success
Rule name. Must be unique within the module.

Sample:
name_example
     
type
string
on success
Type of WebAppFirewallPolicyRule.

Sample:
ACCESS_CONTROL
 
request_protection
complex
on success
Returned for get operation

   
body_inspection_size_limit_exceeded_action_name
string
on success
References action by name from actions defined in WebAppFirewallPolicy. Executed if HTTP message body size exceeds limit set in field `bodyInspectionSizeLimitInBytes`.
If this field is `null` HTTP message body will inspected up to `bodyInspectionSizeLimitInBytes` and the rest will not be inspected by Protection Capabilities.
Allowed action types: * **RETURN_HTTP_RESPONSE** terminates further execution of modules and rules and returns defined HTTP response.

Sample:
body_inspection_size_limit_exceeded_action_name_example
   
body_inspection_size_limit_in_bytes
integer
on success
Maximum size of inspected HTTP message body in bytes. Actions to take if this limit is exceeded are defined in `bodyInspectionSizeLimitExceededActionName`.
Body inspection maximum size allowed is defined with per-tenancy limit: 8192 bytes.

Sample:
56
   
rules
complex
on success
Ordered list of ProtectionRules. Rules are executed in order of appearance in this array. ProtectionRules in this array can only use protection Capabilities of REQUEST_PROTECTION_CAPABILITY type.

     
action_name
string
on success
References action by name from actions defined in WebAppFirewallPolicy.

Sample:
action_name_example
     
condition
string
on success
An expression that determines whether or not the rule action should be executed.

Sample:
condition_example
     
condition_language
string
on success
The language used to parse condition from field `condition`. Available languages:
* **JMESPATH** an extended JMESPath language syntax.

Sample:
JMESPATH
     
is_body_inspection_enabled
boolean
on success
Enables/disables body inspection for this protection rule. Only Protection Rules in RequestProtection can have this option enabled. Response body inspection will be available at a later date.

Sample:
True
     
name
string
on success
Rule name. Must be unique within the module.

Sample:
name_example
     
protection_capabilities
complex
on success
An ordered list that references OCI-managed protection capabilities. Referenced protection capabilities are not necessarily executed in order of appearance. Their execution order is decided at runtime for improved performance. The array cannot contain entries with the same pair of capability key and version more than once.

       
action_name
string
on success
Override action to take if capability was triggered, defined in Protection Rule for this capability. Only actions of type CHECK are allowed.

Sample:
action_name_example
       
collaborative_action_threshold
integer
on success
The minimum sum of weights of associated collaborative protection capabilities that have triggered which must be reached in order for _this_ capability to trigger. This field is ignored for non-collaborative capabilities.

Sample:
56
       
collaborative_weights
complex
on success
Explicit weight values to use for associated collaborative protection capabilities.

         
key
string
on success
Unique key of collaborative capability for which weight will be overridden.

Sample:
key_example
         
weight
integer
on success
The value of weight to set.

Sample:
56
       
exclusions
complex
on success

         
args
list / elements=string
on success
List of URL query parameter values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from inspecting. Example: If we have query parameter 'argumentName=argumentValue' and args=['argumentName'], both 'argumentName' and 'argumentValue' will not be inspected.

         
request_cookies
list / elements=string
on success
List of HTTP request cookie values (by cookie name) to exclude from inspecting. Example: If we have cookie 'cookieName=cookieValue' and requestCookies=['cookieName'], both 'cookieName' and 'cookieValue' will not be inspected.

       
key
string
on success
Unique key of referenced protection capability.

Sample:
key_example
       
version
integer
on success
Version of referenced protection capability.

Sample:
56
     
protection_capability_settings
complex
on success

       
allowed_http_methods
list / elements=string
on success
List of allowed HTTP methods. Each value as a RFC7230 formated token string. Used in protection capability 911100: Restrict HTTP Request Methods.

       
max_http_request_header_length
integer
on success
Maximum allowed length of headers in an HTTP request. Used in protection capability: 9200024: Limit length of request header size.

Sample:
56
       
max_http_request_headers
integer
on success
Maximum number of headers allowed in an HTTP request. Used in protection capability 9200014: Limit Number of Request Headers.

Sample:
56
       
max_number_of_arguments
integer
on success
Maximum number of arguments allowed. Used in protection capability 920380: Number of Arguments Limits.

Sample:
56
       
max_single_argument_length
integer
on success
Maximum allowed length of a single argument. Used in protection capability 920370: Limit argument value length.

Sample:
56
       
max_total_argument_length
integer
on success
Maximum allowed total length of all arguments. Used in protection capability 920390: Limit arguments total length.

Sample:
56
     
type
string
on success
Type of WebAppFirewallPolicyRule.

Sample:
ACCESS_CONTROL
 
request_rate_limiting
complex
on success
Returned for get operation

   
rules
complex
on success
Ordered list of RequestRateLimitingRules. Rules are executed in order of appearance in this array.

     
action_name
string
on success
References action by name from actions defined in WebAppFirewallPolicy.

Sample:
action_name_example
     
condition
string
on success
An expression that determines whether or not the rule action should be executed.

Sample:
condition_example
     
condition_language
string
on success
The language used to parse condition from field `condition`. Available languages:
* **JMESPATH** an extended JMESPath language syntax.

Sample:
JMESPATH
     
configurations
complex
on success
Rate Limiting Configurations. Each configuration counts requests towards its own `requestsLimit`.

       
action_duration_in_seconds
integer
on success
Duration of block action application in seconds when `requestsLimit` is reached. Optional and can be 0 (no block duration).

Sample:
56
       
period_in_seconds
integer
on success
Evaluation period in seconds.

Sample:
56
       
requests_limit
integer
on success
Requests allowed per evaluation period.

Sample:
56
     
name
string
on success
Rule name. Must be unique within the module.

Sample:
name_example
     
type
string
on success
Type of WebAppFirewallPolicyRule.

Sample:
ACCESS_CONTROL
 
response_access_control
complex
on success
Returned for get operation

   
rules
complex
on success
Ordered list of AccessControlRules. Rules are executed in order of appearance in this array.

     
action_name
string
on success
References action by name from actions defined in WebAppFirewallPolicy.

Sample:
action_name_example
     
condition
string
on success
An expression that determines whether or not the rule action should be executed.

Sample:
condition_example
     
condition_language
string
on success
The language used to parse condition from field `condition`. Available languages:
* **JMESPATH** an extended JMESPath language syntax.

Sample:
JMESPATH
     
name
string
on success
Rule name. Must be unique within the module.

Sample:
name_example
     
type
string
on success
Type of WebAppFirewallPolicyRule.

Sample:
ACCESS_CONTROL
 
response_protection
complex
on success
Returned for get operation

   
rules
complex
on success
Ordered list of ProtectionRules. Rules are executed in order of appearance in this array. ProtectionRules in this array can only use protection capabilities of RESPONSE_PROTECTION_CAPABILITY type.

     
action_name
string
on success
References action by name from actions defined in WebAppFirewallPolicy.

Sample:
action_name_example
     
condition
string
on success
An expression that determines whether or not the rule action should be executed.

Sample:
condition_example
     
condition_language
string
on success
The language used to parse condition from field `condition`. Available languages:
* **JMESPATH** an extended JMESPath language syntax.

Sample:
JMESPATH
     
is_body_inspection_enabled
boolean
on success
Enables/disables body inspection for this protection rule. Only Protection Rules in RequestProtection can have this option enabled. Response body inspection will be available at a later date.

Sample:
True
     
name
string
on success
Rule name. Must be unique within the module.

Sample:
name_example
     
protection_capabilities
complex
on success
An ordered list that references OCI-managed protection capabilities. Referenced protection capabilities are not necessarily executed in order of appearance. Their execution order is decided at runtime for improved performance. The array cannot contain entries with the same pair of capability key and version more than once.

       
action_name
string
on success
Override action to take if capability was triggered, defined in Protection Rule for this capability. Only actions of type CHECK are allowed.

Sample:
action_name_example
       
collaborative_action_threshold
integer
on success
The minimum sum of weights of associated collaborative protection capabilities that have triggered which must be reached in order for _this_ capability to trigger. This field is ignored for non-collaborative capabilities.

Sample:
56
       
collaborative_weights
complex
on success
Explicit weight values to use for associated collaborative protection capabilities.

         
key
string
on success
Unique key of collaborative capability for which weight will be overridden.

Sample:
key_example
         
weight
integer
on success
The value of weight to set.

Sample:
56
       
exclusions
complex
on success

         
args
list / elements=string
on success
List of URL query parameter values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from inspecting. Example: If we have query parameter 'argumentName=argumentValue' and args=['argumentName'], both 'argumentName' and 'argumentValue' will not be inspected.

         
request_cookies
list / elements=string
on success
List of HTTP request cookie values (by cookie name) to exclude from inspecting. Example: If we have cookie 'cookieName=cookieValue' and requestCookies=['cookieName'], both 'cookieName' and 'cookieValue' will not be inspected.

       
key
string
on success
Unique key of referenced protection capability.

Sample:
key_example
       
version
integer
on success
Version of referenced protection capability.

Sample:
56
     
protection_capability_settings
complex
on success

       
allowed_http_methods
list / elements=string
on success
List of allowed HTTP methods. Each value as a RFC7230 formated token string. Used in protection capability 911100: Restrict HTTP Request Methods.

       
max_http_request_header_length
integer
on success
Maximum allowed length of headers in an HTTP request. Used in protection capability: 9200024: Limit length of request header size.

Sample:
56
       
max_http_request_headers
integer
on success
Maximum number of headers allowed in an HTTP request. Used in protection capability 9200014: Limit Number of Request Headers.

Sample:
56
       
max_number_of_arguments
integer
on success
Maximum number of arguments allowed. Used in protection capability 920380: Number of Arguments Limits.

Sample:
56
       
max_single_argument_length
integer
on success
Maximum allowed length of a single argument. Used in protection capability 920370: Limit argument value length.

Sample:
56
       
max_total_argument_length
integer
on success
Maximum allowed total length of all arguments. Used in protection capability 920390: Limit arguments total length.

Sample:
56
     
type
string
on success
Type of WebAppFirewallPolicyRule.

Sample:
ACCESS_CONTROL
 
system_tags
dictionary
on success
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`

 
time_created
string
on success
The time the WebAppFirewallPolicy was created. An RFC3339 formatted datetime string.

Sample:
2013-10-20T19:20:30+01:00
 
time_updated
string
on success
The time the WebAppFirewallPolicy was updated. An RFC3339 formatted datetime string.

Sample:
2013-10-20T19:20:30+01:00


Authors

  • Oracle (@oracle)