Following official google documentation does cause false positives in trivy config scan. #9716
ervin-pactum
started this conversation in
False Detection
Replies: 1 comment
-
|
maybe easier to read example for trivy-demo % cat os_config.tf; trivy fs --scanners=misconfig os_config.tf
resource "google_compute_project_metadata" "default" {
metadata = {
enable-oslogin = "TRUE"
}
}
2025-10-27T12:53:09+02:00 INFO [misconfig] Misconfiguration scanning is enabled
2025-10-27T12:53:09+02:00 INFO [terraform scanner] Scanning root module file_path="."
2025-10-27T12:53:09+02:00 INFO Number of language-specific files num=0
2025-10-27T12:53:09+02:00 INFO Detected config files num=2
Report Summary
┌──────────────┬───────────┬───────────────────┐
│ Target │ Type │ Misconfigurations │
├──────────────┼───────────┼───────────────────┤
│ . │ terraform │ 0 │
├──────────────┼───────────┼───────────────────┤
│ os_config.tf │ terraform │ 1 │
└──────────────┴───────────┴───────────────────┘
Legend:
- '-': Not scanned
- '0': Clean (no security findings detected)
os_config.tf (terraform)
Tests: 1 (SUCCESSES: 0, FAILURES: 1)
Failures: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 0, CRITICAL: 0)
AVD-GCP-0042 (MEDIUM): OS Login is disabled at project level.
════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
OS Login automatically revokes the relevant SSH keys when an IAM user has their access revoked.
See https://avd.aquasec.com/misconfig/avd-gcp-0042
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
os_config.tf:1-5
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 ┌ resource "google_compute_project_metadata" "default" {
2 │ metadata = {
3 │ enable-oslogin = "TRUE"
4 │ }
5 └ }
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
IDs
AVD-GCP-0030, AVD-GCP-0042
Description
[AVD-GCP-0030] google: Disable project-wide SSH keys for all instances
and
[AVD-GCP-0042] google: OS Login should be enabled at project level
are dectected in sniplets that are copied over from google official documentation, because trivy expects inline boolean values (
trueorfalse)iacTypes.BoolExplicit(val.True(),for os-login and ssh-keysofficial google documentation:
https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#gcloud_3
https://cloud.google.com/compute/docs/samples/compute-project-for-oslogin-example
Reproduction Steps
Target
Filesystem
Scanner
Misconfiguration
Target OS
No response
Debug Output
(not applicable, we can see code in repository causing failure)Version
Checklist
-f jsonthat shows data sources and confirmed that the security advisory in data sources was correctBeta Was this translation helpful? Give feedback.
All reactions