代码之家  ›  专栏  ›  技术社区  ›  Debajyoti Bhattacharjee

仅接受来自我的域的请求的AWS AWF规则

  •  0
  • Debajyoti Bhattacharjee  · 技术社区  · 1 年前

    我需要有关AWS Web应用程序防火墙规则的帮助。

    我把JSON放在下面,我试图让它看起来只接受来自我的域和localhost:3000的请求,但它不起作用。请帮助我解决这个问题

    {
      "Name": "frontend-asset-allow-enthouse-in-localhost",
      "Priority": 3,
      "Action": {
        "Allow": {}
      },
      "VisibilityConfig": {
        "SampledRequestsEnabled": true,
        "CloudWatchMetricsEnabled": true,
        "MetricName": "frontend-asset-allow-enthouse-in-localhost"
      },
      "Statement": {
        "OrStatement": {
          "Statements": [
            {
              "ByteMatchStatement": {
                "FieldToMatch": {
                  "SingleHeader": {
                    "Name": "host"
                  }
                },
                "PositionalConstraint": "EXACTLY",
                "SearchString": "localhost:3000",
                "TextTransformations": [
                  {
                    "Type": "NONE",
                    "Priority": 0
                  }
                ]
              }
            },
            {
              "ByteMatchStatement": {
                "FieldToMatch": {
                  "SingleHeader": {
                    "Name": "host"
                  }
                },
                "PositionalConstraint": "EXACTLY",
                "SearchString": "enthouse.in",
                "TextTransformations": [
                  {
                    "Type": "NONE",
                    "Priority": 0
                  }
                ]
              }
            }
          ]
        }
      }
    }
    
    0 回复  |  直到 1 年前