Skip to content

GCP Rego files - CIS v8 Control 7: Vulnerability Management - #315

Open
alishapulva wants to merge 7 commits into
mainfrom
alishapulva-patch-1
Open

GCP Rego files - CIS v8 Control 7: Vulnerability Management#315
alishapulva wants to merge 7 commits into
mainfrom
alishapulva-patch-1

Conversation

@alishapulva

Copy link
Copy Markdown

Summary

Adds GCP Rego policy files for CIS v8 Control 7 (Vulnerability Management), covering safeguards 7.1–7.7.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor / code cleanup
  • Documentation
  • CI/CD / infrastructure
  • Security

Affected Components

  • /backend-api
  • /frontend
  • /engine (collectors / policies)
  • /security
  • /infrastructure
  • /.github/workflows
  • /docs

Motivation

These policies extend AutoAudit's engine to evaluate GCP environments against CIS v8 Control 7, adding coverage for vulnerability management safeguards that weren't previously implemented.

Testing Done

  • Unit tests pass locally
  • Tested manually — describe how:
  • No tests required — explain why:

These policies haven't yet been tested against sample GCP data or validated with opa eval/opa test.

Security Considerations

No security impact, as these are read-only compliance evaluation policies.

Breaking Changes

  • No breaking changes
  • Yes — describe below:

Rollback Plan

  • Revert commit is sufficient
  • Requires additional steps — describe below:

Checklist

  • Code follows project conventions
  • No secrets, credentials, or tokens committed
  • Relevant documentation updated (if applicable)
  • CI/CD workflows pass on this branch
  • PR is focused on one thing

@alishapulva
alishapulva requested a review from a team as a code owner August 8, 2026 12:28
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Preview Environment

A preview environment can be spun up on demand for this PR.

Action Label Includes
Spin up preview deploy-preview Frontend, backend, database, Redis, OPA, worker
Spin up preview with M365 deploy-preview-m365 Everything above + PowerShell service for Exchange/Teams scan testing
Tear down preview teardown-preview Stops the environment early

The environment will also be torn down automatically when the PR is closed or merged.
Preview URLs will appear in a follow-up comment once the deploy completes (~5–8 min).
M365 scans require real tenant credentials added through the frontend UI.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

CI: Engine

Job Result
Security analysis (CodeQL) success
Lint success
Tests success

All checks passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61b6bbcbf3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

# Security Command Center findings should be prioritised using severity, exploitability, asset context, and defined remediation SLAs.
# The remediation backlog must be reviewed monthly, or more frequently, and review outcomes must result in remediation, approved deferral, or formally accepted risk.
# Exceptions must include an approver, justification, expiry date, and follow-up action.
related_resources:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Comment out the stray metadata key

When this policy is loaded by OPA, this bare related_resources: line is parsed as Rego before the package declaration rather than as metadata, so the control cannot be parsed and any bundle/load that includes it will fail before evaluation. The surrounding metadata lines are all comments, so this line needs the same # prefix.

Useful? React with 👍 / 👎.

Comment on lines +57 to +58
deferrals_properly_managed if {
count(input.deferrals) == 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat missing deferrals as no deferrals

For a compliant OS patch run with no deferrals recorded, callers commonly omit the optional deferrals field rather than sending an empty array. In that case count(input.deferrals) is undefined, so neither branch of deferrals_properly_managed matches and the policy incorrectly fails even though the output path already treats the field as [] via get_array. Use the same fallback here before counting/iterating.

Useful? React with 👍 / 👎.

Comment on lines +84 to +85
"has_authenticated_scan_evidence": has_authenticated_scan_evidence,
"has_unauthenticated_scan_evidence": has_unauthenticated_scan_evidence,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Default scan-evidence booleans before emitting details

When the program is configured but one of the scan-evidence checks is absent, the corresponding boolean rule is undefined rather than false; referencing it directly in the details object makes the whole result := output rule undefined, so callers get the generic default “Evaluation failed” response instead of the specific failure message below. Define false defaults for these rules or materialize explicit booleans before adding them to details.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant