Check ID:
Provider: GCP
Service:
Severity: HIGH
Categories:
Resource type:
compute_project_os_login_2fa_enabledProvider: GCP
Service:
computeSeverity: HIGH
Categories:
identity-accessResource type:
compute.googleapis.com/ProjectWhat this check verifies
OS Login Two-Factor Authentication (2FA) requires users to verify their identity with a second factor when connecting via SSH to VM instances. This provides an additional security layer beyond passwords or SSH keys, significantly reducing the risk of unauthorized access even if credentials are compromised.Risk
Without 2FA enforcement, compromised credentials (stolen SSH keys or passwords) grant immediate access to VM instances. Attackers could:- Gain unauthorized shell access to production systems
- Exfiltrate sensitive data or deploy malware
- Move laterally within the infrastructure
Recommendation
Enable OS Login with 2FA at the project level to enforce multi-factor authentication for all SSH connections. This adds a critical security layer by requiring users to complete a second verification step, protecting against credential theft and unauthorized access.Remediation
- CLI
- Terraform
- Dashboard steps
References
Where this check fires
This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable byCheck ID = compute_project_os_login_2fa_enabled. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to GCP checks