AWSManagedRulesCommonRuleSet - CrossSiteScripting_BODY - Rule triggers on MacOS installer PKG and WAF reports CORS error

0

We have a WAF set up in front of our API that is hosted in ECS/Fargate. One of the endpoints allows to upload (POST) an installer binary for our download area.

So far Windows installers work fine, but MacOS pkg installers trigger the CrossSiteScripting_BODY rule in the AWSManagedRulesCommonRuleSet. The binary does not include JavaScript in any way. In some instances, changing the name for the binary, and therefor the payload, gets us past the rule. But for the most part we get rejected.

Another interesting point is that the WAF reports this as a CORS error.

What can we do to tweak that rule so that we can get our installers past the WAF without having to disable this rule manually each time we upload. Also, why is this reported as CORS and not a simple forbidden?

Thanks

질문됨 한 달 전402회 조회
1개 답변
1
수락된 답변

Sorry to hear about the issues you are having. The AWS WAF CrossSiteScripting_BODY rule is sensitive to files with random characters in their metadata. The first step is to turn on comprehensive logs and look at the termindateRuleMatchDetails data.

Use the matchData field in the termindateRuleMatchDetails data to create a safe list with a match condition. There is a detailed step by step description in this knowledge center article.

Let me know if you are still having issues or if you have any other questions.

AWS
awsmac
답변함 한 달 전
  • Thanks, I went with a IP whitelist for the specific endpoint. Not optimal, but good enough for now.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인