logging_configurations
Creates, updates, deletes, gets or lists a logging_configurations resource.
Overview
| Name | logging_configurations |
| Type | Resource |
| Id | aws.wafv2.logging_configurations |
Fields
The following fields are returned by SELECT queries:
- get_logging_configuration
- list_logging_configurations
| Name | Datatype | Description |
|---|---|---|
log_destination_configs | array | The logging destination configuration that you want to associate with the web ACL. You can associate one logging destination to a web ACL. |
log_scope | string | The owner of the logging configuration, which must be set to CUSTOMER for the configurations that you manage. The log scope SECURITY_LAKE indicates a configuration that is managed through Amazon Security Lake. You can use Security Lake to collect log and event data from various sources for normalization, analysis, and management. For information, see Collecting data from Amazon Web Services services in the Amazon Security Lake user guide. The log scope CLOUDWATCH_TELEMETRY_RULE_MANAGED indicates a configuration that is managed through Amazon CloudWatch Logs for telemetry data collection and analysis. For information, see What is Amazon CloudWatch Logs ? in the Amazon CloudWatch Logs user guide. Default: CUSTOMER (CUSTOMER, SECURITY_LAKE, CLOUDWATCH_TELEMETRY_RULE_MANAGED) |
log_type | string | Used to distinguish between various logging options. Currently, there is one option. Default: WAF_LOGS (WAF_LOGS) |
logging_filter | object | Filtering that specifies which web requests are kept in the logs and which are dropped. You can filter on the rule action and on the web request labels that were applied by matching rules during web ACL evaluation. |
managed_by_firewall_manager | boolean | Indicates whether the logging configuration was created by Firewall Manager, as part of an WAF policy configuration. If true, only Firewall Manager can modify or delete the configuration. The logging configuration can be created by Firewall Manager for use with any web ACL that Firewall Manager is using for an WAF policy. Web ACLs that Firewall Manager creates and uses have their ManagedByFirewallManager property set to true. Web ACLs that were created by a customer account and then retrofitted by Firewall Manager for use by a policy have their RetrofittedByFirewallManager property set to true. For either case, any corresponding logging configuration will indicate ManagedByFirewallManager. |
redacted_fields | array | The parts of the request that you want to keep out of the logs. For example, if you redact the SingleHeader field, the HEADER field in the logs will be REDACTED for all rules that use the SingleHeader FieldToMatch setting. If you configure data protection for the web ACL, the protection applies to the data that WAF sends to the logs. Redaction applies only to the component that's specified in the rule's FieldToMatch setting, so the SingleHeader redaction doesn't apply to rules that use the Headers FieldToMatch. You can specify only the following fields for redaction: UriPath, QueryString, SingleHeader, and Method. This setting has no impact on request sampling. You can only exclude fields from request sampling by disabling sampling in the web ACL visibility configuration or by configuring data protection for the web ACL. |
resource_arn | string | The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs. (pattern: <code>.\S.</code>) |
| Name | Datatype | Description |
|---|---|---|
logging_configurations | array | Array of logging configurations. If you specified a Limit in your request, this might not be the full list. |
next_marker | string | When you request a list of objects with a Limit setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a NextMarker value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. (pattern: <code>.\S.</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_logging_configuration | select | region | Returns the LoggingConfiguration for the specified web ACL. | |
list_logging_configurations | select | region | Retrieves an array of your LoggingConfiguration objects. | |
put_logging_configuration | replace | region, LoggingConfiguration | Enables the specified LoggingConfiguration, to start logging from a web ACL, according to the configuration provided. If you configure data protection for the web ACL, the protection applies to the data that WAF sends to the logs. This operation completely replaces any mutable specifications that you already have for a logging configuration with the ones that you provide to this call. To modify an existing logging configuration, do the following: Retrieve it by calling GetLoggingConfiguration Update its settings as needed Provide the complete logging configuration specification to this call You can define one logging destination per web ACL. You can access information about the traffic that WAF inspects using the following steps: Create your logging destination. You can use an Amazon CloudWatch Logs log group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon Kinesis Data Firehose. The name that you give the destination must start with aws-waf-logs-. Depending on the type of destination, you might need to configure additional settings or permissions. For configuration requirements and pricing information for each destination type, see Logging web ACL traffic in the WAF Developer Guide. Associate your logging destination to your web ACL using a PutLoggingConfiguration request. When you successfully enable logging using a PutLoggingConfiguration request, WAF creates an additional role or policy that is required to write logs to the logging destination. For an Amazon CloudWatch Logs log group, WAF creates a resource policy on the log group. For an Amazon S3 bucket, WAF creates a bucket policy. For an Amazon Kinesis Data Firehose, WAF creates a service-linked role. For additional information about web ACL logging, see Logging web ACL traffic information in the WAF Developer Guide. | |
delete_logging_configuration | delete | region | Deletes the LoggingConfiguration from the specified web ACL. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_logging_configuration
- list_logging_configurations
Returns the LoggingConfiguration for the specified web ACL.
SELECT
log_destination_configs,
log_scope,
log_type,
logging_filter,
managed_by_firewall_manager,
redacted_fields,
resource_arn
FROM aws.wafv2.logging_configurations
WHERE region = '{{ region }}' -- required
;
Retrieves an array of your LoggingConfiguration objects.
SELECT
logging_configurations,
next_marker
FROM aws.wafv2.logging_configurations
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- put_logging_configuration
Enables the specified LoggingConfiguration, to start logging from a web ACL, according to the configuration provided. If you configure data protection for the web ACL, the protection applies to the data that WAF sends to the logs. This operation completely replaces any mutable specifications that you already have for a logging configuration with the ones that you provide to this call. To modify an existing logging configuration, do the following: Retrieve it by calling GetLoggingConfiguration Update its settings as needed Provide the complete logging configuration specification to this call You can define one logging destination per web ACL. You can access information about the traffic that WAF inspects using the following steps: Create your logging destination. You can use an Amazon CloudWatch Logs log group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon Kinesis Data Firehose. The name that you give the destination must start with aws-waf-logs-. Depending on the type of destination, you might need to configure additional settings or permissions. For configuration requirements and pricing information for each destination type, see Logging web ACL traffic in the WAF Developer Guide. Associate your logging destination to your web ACL using a PutLoggingConfiguration request. When you successfully enable logging using a PutLoggingConfiguration request, WAF creates an additional role or policy that is required to write logs to the logging destination. For an Amazon CloudWatch Logs log group, WAF creates a resource policy on the log group. For an Amazon S3 bucket, WAF creates a bucket policy. For an Amazon Kinesis Data Firehose, WAF creates a service-linked role. For additional information about web ACL logging, see Logging web ACL traffic information in the WAF Developer Guide.
REPLACE aws.wafv2.logging_configurations
SET
LoggingConfiguration = '{{ LoggingConfiguration }}'
WHERE
region = '{{ region }}' --required
AND LoggingConfiguration = '{{ LoggingConfiguration }}' --required
RETURNING
logging_configuration;
DELETE examples
- delete_logging_configuration
Deletes the LoggingConfiguration from the specified web ACL.
DELETE FROM aws.wafv2.logging_configurations
WHERE region = '{{ region }}' --required
;