Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support record filtering for AWS WAF logging configuration #18665

Closed
foxylion opened this issue Apr 8, 2021 · 3 comments · Fixed by #19051
Closed

Support record filtering for AWS WAF logging configuration #18665

foxylion opened this issue Apr 8, 2021 · 3 comments · Fixed by #19051
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Milestone

Comments

@foxylion
Copy link

foxylion commented Apr 8, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS WAF v2 supports to filter logs.

Log filtering – You can add filtering to specify 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 during the request evaluation. For information about rule action settings, see AWS WAF rule action. For information about labels, see AWS WAF labels on web requests.
see AWS docs

This allows reduction of logs that will be forwarded to Kinesis Firehose. Currently it is not possible to configure this behavior using Terraform.

New or Affected Resource(s)

  • wafv2_web_acl_logging_configuration

Potential Terraform Configuration

The syntax is inspired by AWS API documentation for PutLoggingConfiguration.

resource "aws_wafv2_web_acl_logging_configuration" "example" {
  log_destination_configs = [aws_kinesis_firehose_delivery_stream.example.arn]
  resource_arn            = aws_wafv2_web_acl.example.arn
  filters {
    default_behavior = "DROP" # or "KEEP"
    filter {
      behavior = "KEEP" # or "DROP"
      requirement = "MEETS_ALL" # or "MEETS_ANY"
      conditions {
        action {
            action = "COUNT" # or "ALLOW" or "BLOCK"
        }
        label_name {
            label_name = "some-label-name"
        }
      }
    }
    filter {
      #...
    }
  }
}

References

@foxylion foxylion added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 8, 2021
@ghost ghost added the service/wafv2 Issues and PRs that pertain to the wafv2 service. label Apr 8, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 8, 2021
@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label Apr 22, 2021
@anGie44 anGie44 added this to the v3.38.0 milestone Apr 22, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 3.38.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@foxylion
Copy link
Author

Awesome! Thank you @anGie44 for adding this functionality so quickly.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Projects
None yet
2 participants