困っていたこと
ある IAM ユーザーに AWS 管理ポリシー AWSWAFFullAccess
を付与したのですが、AWS WAF のコンソールへアクセスするとリージョンの一覧が表示されず、ウェブACLを参照できません。原因と対処法を教えてください。
どう対応すればいいの?
WAF のコンソールへアクセスする場合、管理ポリシー AWSWAFFullAccess
ではなく AWSWAFConsoleFullAccess
を付与することで、リージョン一覧およびウェブACLの参照が可能になります。
注意点
AWS 管理ポリシー AWSWAFConsoleFullAccess
には WAFのアクションへの許可のみでなく、 CloudFront や ELB など他サービスの操作権限も含まれます。意図しない権限が含まれていないか、ポリシーの内容をよく確認しましょう。
AWS 管理ポリシー AWSWAFConsoleFullAccess
の内容
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUseOfAWSWAF",
"Effect": "Allow",
"Action": [
"apigateway:GET",
"apigateway:SetWebACL",
"cloudfront:ListDistributions",
"cloudfront:ListDistributionsByWebACLId",
"cloudfront:UpdateDistribution",
"cloudwatch:GetMetricData",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics",
"ec2:DescribeRegions",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:SetWebACL",
"appsync:ListGraphqlApis",
"appsync:SetWebACL",
"waf-regional:*",
"waf:*",
"wafv2:*",
"s3:ListAllMyBuckets",
"logs:DescribeResourcePolicies",
"logs:DescribeLogGroups",
"cognito-idp:ListUserPools",
"cognito-idp:AssociateWebACL",
"cognito-idp:DisassociateWebACL",
"cognito-idp:ListResourcesForWebACL",
"cognito-idp:GetWebACLForResource",
"apprunner:AssociateWebAcl",
"apprunner:DisassociateWebAcl",
"apprunner:DescribeWebAclForService",
"apprunner:ListServices",
"apprunner:ListAssociatedServicesForWebAcl",
"ec2:AssociateVerifiedAccessInstanceWebAcl",
"ec2:DisassociateVerifiedAccessInstanceWebAcl",
"ec2:DescribeVerifiedAccessInstanceWebAclAssociations",
"ec2:GetVerifiedAccessInstanceWebAcl",
"ec2:DescribeVerifiedAccessInstances"
],
"Resource": "*"
},
{
"Sid": "AllowLogDeliverySubscription",
"Action": [
"logs:CreateLogDelivery",
"logs:DeleteLogDelivery"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Sid": "GrantLogDeliveryPermissionForS3Bucket",
"Action": [
"s3:PutBucketPolicy",
"s3:GetBucketPolicy"
],
"Resource": [
"arn:aws:s3:::aws-waf-logs-*"
],
"Effect": "Allow"
},
{
"Sid": "GrantLogDeliveryPermissionForCloudWatchLogGroup",
"Action": [
"logs:PutResourcePolicy"
],
"Resource": "*",
"Effect": "Allow",
"Condition": {
"ForAnyValue:StringEquals": {
"aws:CalledVia": [
"wafv2.amazonaws.com"
]
}
}
}
]
}