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

fix: missing provider in WAF regex pattern set #552

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

craigzour
Copy link
Contributor

Summary | Résumé

  • Added missing provider in WAF regex pattern set

@craigzour craigzour requested a review from timarney December 11, 2023 18:12
@craigzour craigzour self-assigned this Dec 11, 2023
Copy link

⚠ Terrform update available

Terragrunt: 0.54.1 (using 0.53.8)

Copy link

Staging: load_balancer

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 2 to add, 1 to change, 0 to destroy
Show summary
CHANGE NAME
update aws_wafv2_web_acl.forms_maintenance_mode_acl
add aws_s3_bucket_website_configuration.maintenance_mode
aws_wafv2_regex_pattern_set.valid_maintenance_mode_uri_paths
Show plan
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_s3_bucket_website_configuration.maintenance_mode will be created
  + resource "aws_s3_bucket_website_configuration" "maintenance_mode" {
      + bucket           = "gc-forms-application-maintenance-page"
      + id               = (known after apply)
      + routing_rules    = (known after apply)
      + website_domain   = (known after apply)
      + website_endpoint = (known after apply)

      + index_document {
          + suffix = "index.html"
        }
    }

  # aws_wafv2_regex_pattern_set.valid_maintenance_mode_uri_paths will be created
  + resource "aws_wafv2_regex_pattern_set" "valid_maintenance_mode_uri_paths" {
      + arn         = (known after apply)
      + description = "Regex to match the maintenance page valid URIs"
      + id          = (known after apply)
      + lock_token  = (known after apply)
      + name        = "valid_maintenance_page_uri_paths"
      + scope       = "CLOUDFRONT"
      + tags_all    = (known after apply)

      + regular_expression {
          + regex_string = "^\\/(index.html|index-fr.html|style.css|site-unavailable.svg|favicon.ico)?$"
        }
    }

  # aws_wafv2_web_acl.forms_maintenance_mode_acl will be updated in-place
  ~ resource "aws_wafv2_web_acl" "forms_maintenance_mode_acl" {
        id         = "b200d511-5d1b-47fe-9586-e5500382f869"
        name       = "GCFormsMaintenanceMode"
        tags       = {
            "CostCentre" = "forms-platform-staging"
            "Terraform"  = "true"
        }
        # (5 unchanged attributes hidden)

      - rule {
          - name     = "AllowGetRequestOnRootOnly" -> null
          - priority = 0 -> null

          - action {
              - allow {
                }
            }

          - statement {
              - and_statement {
                  - statement {
                      - byte_match_statement {
                          - positional_constraint = "EXACTLY" -> null
                          - search_string         = "GET" -> null

                          - field_to_match {
                              - method {}
                            }

                          - text_transformation {
                              - priority = 0 -> null
                              - type     = "NONE" -> null
                            }
                        }
                    }
                  - statement {
                      - byte_match_statement {
                          - positional_constraint = "EXACTLY" -> null
                          - search_string         = "/" -> null

                          - field_to_match {
                              - uri_path {}
                            }

                          - text_transformation {
                              - priority = 0 -> null
                              - type     = "NONE" -> null
                            }
                        }
                    }
                }
            }

          - visibility_config {
              - cloudwatch_metrics_enabled = false -> null
              - metric_name                = "AllowGetRequestOnRootOnly" -> null
              - sampled_requests_enabled   = false -> null
            }
        }
      + rule {
          + name     = "AllowGetOnMaintenancePageHTMLResources"
          + priority = 0

          + action {
              + allow {
                }
            }

          + statement {
              + and_statement {
                  + statement {
                      + byte_match_statement {
                          + positional_constraint = "EXACTLY"
                          + search_string         = "GET"

                          + field_to_match {
                              + method {}
                            }

                          + text_transformation {
                              + priority = 1
                              + type     = "NONE"
                            }
                        }
                    }
                  + statement {
                      + regex_pattern_set_reference_statement {
                          + arn = (known after apply)

                          + field_to_match {
                              + uri_path {}
                            }

                          + text_transformation {
                              + priority = 1
                              + type     = "COMPRESS_WHITE_SPACE"
                            }
                          + text_transformation {
                              + priority = 2
                              + type     = "LOWERCASE"
                            }
                        }
                    }
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = false
              + metric_name                = "AllowGetOnMaintenancePageHTMLResources"
              + sampled_requests_enabled   = false
            }
        }

        # (2 unchanged blocks hidden)
    }

Plan: 2 to add, 1 to change, 0 to destroy.

Warning: Argument is deprecated

  with aws_s3_bucket.firehose_waf_logs,
  on kinesis.tf line 30, in resource "aws_s3_bucket" "firehose_waf_logs":
  30: resource "aws_s3_bucket" "firehose_waf_logs" {

Use the aws_s3_bucket_server_side_encryption_configuration resource instead

(and 5 more similar warnings elsewhere)

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.maintenance_static_page_css_files[\"style.css\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.maintenance_static_page_html_files[\"index-fr.html\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.maintenance_static_page_html_files[\"index.html\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.maintenance_static_page_ico_files[\"favicon.ico\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.maintenance_static_page_svg_files[\"site-unavailable.svg\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_wafv2_regex_pattern_set.forms_base_url"]
WARN - plan.json - main - Missing Common Tags: ["aws_wafv2_regex_pattern_set.valid_app_uri_paths"]
WARN - plan.json - main - Missing Common Tags: ["aws_wafv2_regex_pattern_set.valid_maintenance_mode_uri_paths"]

27 tests, 19 passed, 8 warnings, 0 failures, 0 exceptions

@craigzour craigzour enabled auto-merge (squash) December 11, 2023 18:12
@craigzour craigzour merged commit 44ddbad into develop Dec 11, 2023
4 checks passed
@craigzour craigzour deleted the fix/missing-provider-in-waf-regex-pattern-set branch December 11, 2023 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants