Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ jobs:
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
limit-severities-for-sarif: true
exit-code: '1'
trivyignores: '.trivyignore.yaml'
skip-dirs: 'modules/net-lb-int/recipe-ilb-next-hop,modules/net-lb-app-int-cross-region/recipe-cross-reg-int-app-lb-vm-dns'

- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d
with:
sarif_file: 'trivy-results.sarif'
Expand Down
51 changes: 51 additions & 0 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

misconfigurations:
- id: GCP-0007
paths:
- "modules/gcs/iam.tf"
- "modules/project/iam.tf"
statement: "google_storage_bucket_iam_binding.authoritative scopes IAM bindings to individual buckets, and google_project_iam_binding.authoritative grants privileged roles only to dedicated Terraform bootstrap and resource-management automation service accounts."
- id: AVD-GCP-0007
paths:
- "modules/gcs/iam.tf"
- "modules/project/iam.tf"
statement: "google_storage_bucket_iam_binding.authoritative scopes IAM bindings to individual buckets, and google_project_iam_binding.authoritative grants privileged roles only to dedicated Terraform bootstrap and resource-management automation service accounts."
- id: GCP-0015
paths:
- "modules/cloudsql-instance/main.tf"
statement: "Reusable cloudsql-instance module exposes configurable TLS enforcement via var.ssl.mode and defaults public_ipv4 to false, restricting connections to Private Services Access VPC peering."
- id: AVD-GCP-0015
paths:
- "modules/cloudsql-instance/main.tf"
statement: "Reusable cloudsql-instance module exposes configurable TLS enforcement via var.ssl.mode and defaults public_ipv4 to false, restricting connections to Private Services Access VPC peering."
- id: GCP-0043
paths:
- "modules/compute-vm/main.tf"
statement: "can_ip_forward defaults to false in modules/compute-vm and is only set to true when Network Virtual Appliance, NGFW, or next-hop gateway router callers explicitly enable packet forwarding."
- id: AVD-GCP-0043
paths:
- "modules/compute-vm/main.tf"
statement: "can_ip_forward defaults to false in modules/compute-vm and is only set to true when Network Virtual Appliance, NGFW, or next-hop gateway router callers explicitly enable packet forwarding."
- id: GCP-0057
paths:
- "modules/gke-cluster-standard/main.tf"
- "modules/gke-cluster-standard-se/main.tf"
statement: "Trivy flags the cluster-level inline node_config block where workload_metadata_config.mode is unset, which only applies to the temporary default node pool deleted at creation (remove_default_node_pool = var.default_nodepool.remove_pool, defaulting to true) while workload node pools are managed via modules/gke-nodepool."
- id: AVD-GCP-0057
paths:
- "modules/gke-cluster-standard/main.tf"
- "modules/gke-cluster-standard-se/main.tf"
statement: "Trivy flags the cluster-level inline node_config block where workload_metadata_config.mode is unset, which only applies to the temporary default node pool deleted at creation (remove_default_node_pool = var.default_nodepool.remove_pool, defaulting to true) while workload node pools are managed via modules/gke-nodepool."
2 changes: 1 addition & 1 deletion cli/tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def test_missing_monitoring_api(self, make_ctx, repo, cloud):
found = by_id(checks.check_project(make_ctx()))
apis = found["project.apis"]
assert apis.status == Status.FAIL
assert "monitoring.googleapis.com" in apis.detail
assert apis.detail == "Not enabled: monitoring.googleapis.com."
assert "gcloud services enable monitoring.googleapis.com" in (
remedy(apis)
)
Expand Down
6 changes: 4 additions & 2 deletions cli/tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_required_roles_match_ddg(repo):

def test_required_apis(repo):
apis = repo.required_apis()
assert "cloudresourcemanager.googleapis.com" in apis
assert {"cloudresourcemanager.googleapis.com"} <= set(apis)
assert all(api.endswith(".googleapis.com") for api in apis)


Expand All @@ -80,7 +80,9 @@ def test_prerequisites_doc_lists_every_script_api(repo):


def test_ddg_requires_monitoring_api(repo):
assert "monitoring.googleapis.com" in _ddg_prerequisites(repo.root)
assert "/apis/api/monitoring.googleapis.com/overview" in _ddg_prerequisites(
repo.root
)
assert checks.EXTRA_APIS == ("monitoring.googleapis.com",)


Expand Down
Loading