Repository navigation
Conversation
6 of 7 tasks
les2
force-pushed
the
fix/gke-dns-endpoint-authorized-networks
branch
3 times, most recently
from
November 26, 2026 22:42
a5c6c24 to
12fe02f
Compare
les2
marked this pull request as ready for review
November 26, 2026 22:43
3 tasks done
nikpivkin
requested changes
Nov 27, 2026
nikpivkin
left a comment
Contributor
There was a problem hiding this comment.
Convert this PR to a draft until aquasecurity/trivy#11769 is merged. The schema test reads the schema from Trivy main, and the field path may still change there.
| deny contains res if { | ||
| some cluster in input.google.gke.clusters | ||
| isManaged(cluster) | ||
| not ip_endpoints_disabled(cluster) |
Contributor
There was a problem hiding this comment.
Replace not ip_endpoints_disabled(cluster) with value.is_true. With not, an unresolvable value such as enabled = var.x gives a finding.
value.is_true(cluster.controlplaneendpoints.ipendpointsenabled)Add "controlplaneendpoints": {"ipendpointsenabled": {"value": true}} to the deny test inputs and make test_deny_ip_endpoints_unresolvable an allow test.
les2
marked this pull request as draft
November 28, 2026 02:13
les2
force-pushed
the
fix/gke-dns-endpoint-authorized-networks
branch
3 times, most recently
from
November 28, 2026 02:24
e1d48d0 to
c845568
Compare
…isabled Master authorized networks apply only to the IP-based endpoints of the GKE control plane, so the check now requires controlplaneendpoints.ipendpoints.enabled to be true. A disabled or unresolvable value gives no finding. Requires Trivy 0.77.0. Refs: aquasecurity/trivy#11753
les2
force-pushed
the
fix/gke-dns-endpoint-authorized-networks
branch
from
November 28, 2026 02:40
c845568 to
6e03ad8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GCP-0061 (master authorized networks) fails for a GKE cluster whose control plane is reachable only through the DNS-based endpoint:
Authorized networks apply only to the IP-based endpoints, and the provider leaves
master_authorized_networks_configout of the request when they are disabled (magic-modules#20134).The check now reports a cluster only when
value.is_true(cluster.controlplaneendpoints.ipendpoints.enabled). A disabled or unresolvable value (such asenabled = var.x) gives no finding. Trivy sets the value totruewhen the attribute or its blocks are not set, so those clusters are checked as before.minimum_trivy_versionis0.77.0, the first release that will include aquasecurity/trivy#11769. (TODO confirm the version number before merging if this is required in the commit. There's no guarantee which version will contain the required commit.)true→ finding,false→ passes, unresolvable → passes. The existing deny test now sets the field totrue.enabled = falseand a bad example withenabled = true.This depends on aquasecurity/trivy#11769, which adds the field. Until it is on Trivy
main,TestInputsConformToSchemafails because thelatestschema does not havecontrolplaneendpoints.Checked with a build of the Trivy branch and a bundle from this branch (
--checks-bundle-repositoryon a local registry), on the two folders from https://github.com/les2/trivy-gcp-0061-repro plus four more configurations:ip_endpoints_config { enabled = false }ip_endpoints_config { enabled = true }, without authorized networksip_endpoints_config {}, without authorized networkscontrol_plane_endpoints_confignot set, without authorized networksenabled = var.x(no value), without authorized networksenabled = falseplus an emptymaster_authorized_networks_config {}With the Trivy branch schema as
schemas/latest:opa fmt,opa check --strict,make test-regoandgo test ./...pass.TRIVY_BINARY=<branch build> go test -tags=integration -run TestScanCheckExamples ./integration/passes, including the GCP-0061 examples.Related PRs
Related issues
Checklist
minimum_trivy_versionis0.77.0or update docs, commit message, and PR message with the correct version after upstream merges and is released.