Skip to content

Commit 3c6689b

Browse files
committed
Always grant route53 ListHostedZones permission
1 parent 7342890 commit 3c6689b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/model/iam/iam_builder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ func (b *IAMPolicyBuilder) BuildAWSIAMPolicy() (*IAMPolicy, error) {
182182
if b.HostedZoneID != "" {
183183
addRoute53Permissions(p, b.HostedZoneID)
184184
}
185+
// dns-controller currently assumes it can list the hosted zones, even when using gossip
186+
addRoute53ListHostedZonesPermission(p)
185187

186188
// For S3 IAM permissions, we grant permissions to subtrees. So find the parents;
187189
// we don't need to grant mypath and mypath/child.
@@ -279,7 +281,9 @@ func addRoute53Permissions(p *IAMPolicy, hostedZoneID string) {
279281
Action: stringorslice.Slice([]string{"route53:GetChange"}),
280282
Resource: stringorslice.Slice([]string{"arn:aws:route53:::change/*"}),
281283
})
284+
}
282285

286+
func addRoute53ListHostedZonesPermission(p *IAMPolicy) {
283287
wildcard := stringorslice.Slice([]string{"*"})
284288
p.Statement = append(p.Statement, &IAMStatement{
285289
Effect: IAMStatementEffectAllow,

0 commit comments

Comments
 (0)