Skip to content

feat(scc): migrate to SCC v2 API, add new finding tools, fix sorting and mute#271

Open
notluken wants to merge 2 commits into
google:mainfrom
notluken:feat/scc-v2-migration-new-tools
Open

feat(scc): migrate to SCC v2 API, add new finding tools, fix sorting and mute#271
notluken wants to merge 2 commits into
google:mainfrom
notluken:feat/scc-v2-migration-new-tools

Conversation

@notluken

@notluken notluken commented Jun 3, 2026

Copy link
Copy Markdown

Summary

  • Migrate to SCC v2 API — swap securitycenter import for securitycenter_v2, update all parent paths to include /locations/{location}, fix attackExposure score to read from v2 nested message structure
  • Add search_findings tool — flexible filtering by class, severity, state, category, resource, mute status, and custom filter string; supports OR-combined values
  • Add get_finding_details tool — full finding details including MITRE ATT&CK, compliance, vulnerability data, and optional CAI resource enrichment
  • Add search_findings_by_compliance tool — search by CIS, PCI DSS, NIST 800-53, ISO 27001 control IDs/names or free-text across descriptions and categories
  • Add set_finding_mute tool — mute or unmute a finding via SetMuteFindingRequest; resolves canonical finding name automatically before calling set_mute
  • Fix top_vulnerability_findings sorting — previously sorted only the first page (20 findings); now fetches min(max_findings × 10, 1000) candidates so sort by attack exposure is meaningful across the full population
  • Add nextSteps to top_vulnerability_findings — remediation steps now included inline, no follow-up call needed
  • Extract _build_parent / _build_or_filter helpers — remove 5× duplicated parent path and OR-filter construction
  • Fix more_findings_may_exist in search_findings — use pager next-page token instead of count heuristic
  • Add .DS_Store to .gitignore

Test plan

  • search_findings returns findings with correct filter applied; OR-combined severity/class works
  • get_finding_details returns full finding + CAI resource details
  • search_findings_by_compliance matches findings by CIS control ID and free-text description
  • set_finding_mute successfully mutes and unmutes a finding; verify in SCC console
  • top_vulnerability_findings returns findings sorted by attack exposure score (not just first page order)
  • get_finding_remediation still works with finding_id and resource_name + category lookup paths

notluken added 2 commits June 3, 2026 15:56
Upgrade client from securitycenter v1 to securitycenter_v2. Update all
parent paths to include /locations/{location}. Add search_findings,
get_finding_details, and search_findings_by_compliance tools. Fix
attackExposure score to read from nested v2 message structure.

Also add .DS_Store to .gitignore.
- top_vulnerability_findings: fetch up to min(max*10, 1000) candidates
  before sorting by attack exposure — previously only sorted the first
  page (20 findings), making "top by score" meaningless on large projects
- top_vulnerability_findings: include nextSteps in output for immediate
  actionability without a follow-up get_finding_remediation call
- add set_finding_mute tool: mute/unmute findings via SCC v2 set_mute API
- extract _build_parent() and _build_or_filter() helpers — removed 5x
  duplicated parent path construction and OR-filter building logic
- fix more_findings_may_exist in search_findings to use pager token
  instead of a count heuristic
- update README: document set_finding_mute and IAM role distinction
@notluken notluken requested a review from a team June 3, 2026 19:11
@google-cla

google-cla Bot commented Jun 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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