Skip to content

Commit

Permalink
Merge pull request #396 from acc-jon/issue394
Browse files Browse the repository at this point in the history
#394: recognize that empty values for username and password in master…
  • Loading branch information
Cesar Rodriguez authored Nov 20, 2020
2 parents 9058454 + 2b8e2cd commit 6a24967
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ package accurics

gkeBasicAuthDisabled[api.id] {
api := input.google_container_cluster[_]
auth := api.config.master_auth[_]
auth.username != null
auth.password != null
}
auth := api.config.master_auth
# If username is not specified, basic auth is disabled
auth[_].username != null

# If username and password are both empty, basic auth is disabled
auths := auth[_]
not gkeBasicAuthEmptyCreds[ auths ]
}

gkeBasicAuthEmptyCreds[auth] {
auth := input.google_container_cluster[_].config.master_auth[_]
[auth.username,auth.password] == ["",""]
}

0 comments on commit 6a24967

Please sign in to comment.