Do CloudFront distributions for Appsync APIs need a default root object?

0

I have an Appsync API that is set up as the origin of a CloudFront distribution (so that we can have a custom domain name, among other things).

This origin is set as the default (*) behaviour for the distribution.

Security Hub complains that it fails [Cloudfront.1] https://docs.aws.amazon.com/securityhub/latest/userguide/cloudfront-controls.html#cloudfront-1 "CloudFront distributions should have a default root object configured"

But if I add a default root object, it breaks the API. GraphQL POST requests to the domain get rejected with an UnknownOperationException error.

My question is, is this security rule relevant for a CF distribution that only has an Appsync origin? Can I just suppress it?

1回答
0

If certain security hub findings are not relevant in your use cases, you can definitely suppress those type of findings. Follow this blog post, which explains how to create auto suppression rules.

Purpose of this specific rule CloudFront.1 is to avoid exposure of your web distribution content, if a user requests distribution's root URL instead of an object in the distribution.

Since you have already tried setting up default root object, so you must be already aware of this, but still I'm mentioning here, how to do that just in case nothing is missed:

       General Tab > Settings section > Edit > scroll down to Default root object > enter index.html.

Hope you find this useful.

Abhishek

profile pictureAWS
エキスパート
回答済み 9ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ