Code Monkey home page Code Monkey logo

Comments (7)

hvital avatar hvital commented on September 13, 2024

This default action should apply for Web ACL’s default action. I mean, if any rule got trigged when a request is process, then the default action takes place.

The rules configured by custom resource are set to be added as block ... what if we add an extra input parameter in this template to ask what should be the rules’ action?

from aws-waf-security-automations.

dpmallinger avatar dpmallinger commented on September 13, 2024

Hello,

I have a custom scenario where I want the default action to be "BLOCK". I updated the cloudformation

"WAFWebACL": {
      "Type": "AWS::WAF::WebACL",
      "Condition": "CreateWebACL",
      "DependsOn": [
        "WAFWhitelistRule"
      ],
      "Properties": {
        "Name": {
          "Ref": "AWS::StackName"
        },
        "DefaultAction": {
          "Type": **"BLOCK"**
        },
        "MetricName": "SecurityAutomationsMaliciousRequesters",
        "Rules": [
          {
            "Action": {
              "Type": "ALLOW"
            },
            "Priority": 10,
            "RuleId": {
              "Ref": "WAFWhitelistRule"
            }
          }
        ]
      }
    },

but once custom-resource.py runs it changes it to "ALLOW".

I don't see a need for this line in the python script
DefaultAction={'Type': 'ALLOW'}

why not simply honor the cloudformation value?

from aws-waf-security-automations.

hvital avatar hvital commented on September 13, 2024

I got your point!

We can't remove this parameter from update_web_acl as it seems to be required but I'll add an extra step to retrieve the current action instead assuming the it should be ALLOW.

from aws-waf-security-automations.

dpmallinger avatar dpmallinger commented on September 13, 2024

@hvital

how I read the documentation is that if "DefaultAction" is passed then "Type" is required but I don't believe that "DefaultAction" is required

from aws-waf-security-automations.

hvital avatar hvital commented on September 13, 2024

I miss understood the Type (string) -- [REQUIRED] boto doc. Lets just remove this parameter then :)

Just added a note to include this for the next update. Thanks for pointing this out!!

from aws-waf-security-automations.

dpmallinger avatar dpmallinger commented on September 13, 2024

thanks!

from aws-waf-security-automations.

hvital avatar hvital commented on September 13, 2024

Hi @dpmallinger.

We've just pushed a new version that include a fix for what you've mentioned.

Custom resource won't update the WebACL anymore:
https://github.com/awslabs/aws-waf-security-automations/blob/c7b25b4f9005469f1606e8da19c9704268f0697a/source/custom-resource/custom-resource.py#L272

Many thanks!

from aws-waf-security-automations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.