Google Cloud SCC Findings Query

Google Cloud SCC Findings Query

Guides an AI agent to run read-only gcloud queries that retrieve and validate Security Command Center findings such as vulnerabilities and toxic combinations.

Skill files3 files

references/

SKILL.md262 lines
1
---
2
name: google-cloud-scc-query
3
metadata:
4
version: "1.0.2"
5
category: Security
6
description: >-
7
Queries and retrieves active security findings, external exposures, toxic
8
combinations, vulnerabilities, threats, and sensitive data risks from
9
Security Command Center on Google Cloud. Use when retrieving details for a
10
security finding by its name, validating finding scope (e.g., verifying
11
findingClass is TOXIC_COMBINATION, VULNERABILITY, EXTERNAL_EXPOSURE, or
12
THREAT), or fetching finding details for triage. Don't use to draft
13
remediations, apply patches, or execute configurations.
14
---
15
16
# Security Command Center Query Skill on Google Cloud
17
18
Provides guidelines and read-only `gcloud` CLI command patterns for querying and
19
retrieving security findings, external exposures, toxic combinations,
20
vulnerabilities, threats, and sensitive data risks from Security Command Center
21
on Google Cloud.
22
23
> [!IMPORTANT] There is NO `gcloud scc findings describe` command (`Invalid
24
> choice: 'describe'`). To retrieve details for a specific finding by its name,
25
> always use `gcloud scc findings list` with a filter on `name`.
26
27
## Usage Attribution
28
29
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
30
MUST read and follow the instructions in
31
[Usage Attribution](references/attribution.md).
32
33
--------------------------------------------------------------------------------
34
35
## Core Execution Rules
36
37
1. **Read-Only & Zero-Speculation (Parent Scope Required)**: Keep all
38
executions strictly read-only. Every `gcloud scc findings list` or `group`
39
command strictly requires an explicit `{parent}` scope
40
(`organizations/{id}`, `projects/{id}`, or `folders/{id}`). If the parent
41
scope is missing from the prompt and cannot be inferred from a full finding
42
name, **DO NOT run any `gcloud` commands** (do not execute queries without
43
parent, and never inspect `gcloud config`). Halt immediately before
44
executing commands and ask the user for the parent resource scope.
45
2. **Bounded Execution & No Runaway Loops**:
46
- Limit tool calls to what is strictly necessary to complete the query
47
(typically 1 call for direct queries, or 2 calls for List → Deep Dive
48
workflows).
49
- If a command fails due to permission/auth errors, or if a specific
50
finding query returns `[]`, halt immediately. Do not attempt blind
51
brute-force retries with different flags, and never search the local
52
workspace for credentials.
53
3. **Immediate Halt on Errors**: If any command fails with `PERMISSION_DENIED`,
54
`IAM_PERMISSION_DENIED`, credential expiration, or network timeouts, halt
55
immediately and report the verbatim error message. Do not search the
56
workspace for credentials or run diagnostic loops.
57
4. **Ambiguous or Multiple Findings**: If multiple finding names are provided
58
when a single finding report is requested, or if listing returns multiple
59
findings, do not investigate all of them or unilaterally pick one. Halt
60
immediately without running queries and ask the user to clarify which
61
specific finding name they want details for. If zero findings are returned
62
from a query, report that no active findings exist and halt immediately.
63
5. **Do Not Query Attack Path Resources**: Analyze only the data present in the
64
Security Command Center finding JSON payload. Do not run commands to
65
describe, verify, or query underlying Google Cloud resources (such as VMs,
66
Cloud Storage buckets, service accounts, or IAM policies).
67
6. **Parent Scope Resolution**:
68
- For listing and grouping, format the parent resource path as
69
`organizations/{org_id}`, `projects/{project_id}`, or
70
`folders/{folder_id}`.
71
- For deep dive queries on a specific finding name, extract the `{parent}`
72
resource prefix before `/sources/...`:
73
- `organizations/{org_id}/sources/...` → `{parent}` is
74
`organizations/{org_id}`
75
- `folders/{folder_id}/sources/...` → `{parent}` is
76
`folders/{folder_id}`
77
- `projects/{project_id}/sources/...` → `{parent}` is
78
`projects/{project_id}` Extract the parent prefix regardless of
79
whether the finding resource name is global (4-segment) or
80
location-qualified (5-segment with `/locations/{location}/`).
81
Execute the deep dive query using the extracted `{parent}`. Do not
82
reject or halt on project- or folder-level findings.
83
84
--------------------------------------------------------------------------------
85
86
## Data Residency & Regional Endpoints
87
88
When Data Residency (DRZ) is enabled, findings are stored and accessible only
89
within their designated regional location (`us`, `eu`, or `me-central2`).
90
Queries across different locations do not return findings from other regions.
91
92
### 1. Location Parameterization
93
94
All `gcloud scc findings` commands require specifying the target location via
95
`--location={location}`:
96
97
- **Default**: `global` (used when data residency is not enabled or for global
98
findings).
99
- **Supported Regional Locations**:
100
- `us` (United States multi-region)
101
- `eu` (European Union multi-region)
102
- `me-central2` (Kingdom of Saudi Arabia regional location)
103
104
### 2. API Endpoint Overrides
105
106
When data residency (DRZ) is enabled for an organization in a regional location
107
(`us`, `eu`, or `me-central2`), configure the regional API endpoint override
108
before executing finding queries:
109
110
```bash
111
gcloud config set api_endpoint_overrides/securitycenter https://securitycenter.{LOCATION}.rep.googleapis.com/
112
```
113
114
Example for the European Union (`eu`) region:
115
116
```bash
117
gcloud config set api_endpoint_overrides/securitycenter https://securitycenter.eu.rep.googleapis.com/
118
```
119
120
To reset the endpoint back to default global routing:
121
122
```bash
123
gcloud config unset api_endpoint_overrides/securitycenter
124
```
125
126
### 3. Location-Qualified Finding Resource Names
127
128
Regional finding resource names include the `/locations/{location}/` path
129
segment:
130
131
- Organization-level:
132
`organizations/{org_id}/sources/{source_id}/locations/{location}/findings/{finding_id}`
133
- Folder-level:
134
`folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}`
135
- Project-level:
136
`projects/{project_id}/sources/{source_id}/locations/{location}/findings/{finding_id}`
137
138
When performing a Deep Dive on a location-qualified finding name:
139
140
1. Extract the `{parent}` scope (the prefix before `/sources/...`, e.g.,
141
`organizations/{org_id}`).
142
2. Extract the `{location}` from `/locations/{location}/` (e.g., `eu`, `us`,
143
`me-central2`). If not present in the finding name, default to `global` (or
144
the user-specified location).
145
3. Execute the query with `--location={location}` and
146
`--filter="name=\"{finding_name}\""`.
147
148
--------------------------------------------------------------------------------
149
150
## Intent-Based Query Strategies
151
152
### 1. Deep Dive (Specific Finding Details)
153
154
**Intent**: User provides a specific finding name or explicitly asks to retrieve
155
all details for one finding. \
156
**Action**: Execute `gcloud scc findings list` with a strict filter on `name`
157
and NO `--field-mask` to retrieve the complete JSON payload. Specify
158
`--location={location}` (default `global` unless a regional location is
159
indicated or present in the finding name).
160
161
```bash
162
gcloud scc findings list {parent} \
163
--location={location} \
164
--filter="name=\"{finding_name}\"" \
165
--format="json" --limit=1
166
```
167
168
### 2. Listing (Filtered Projection)
169
170
**Intent**: User wants to list active findings matching criteria without pulling
171
full nested payloads. \
172
**Action**: Use `--field-mask` projection to restrict output size. Specify
173
`--location={location}` (default `global` unless querying a specific region).
174
175
```bash
176
gcloud scc findings list {parent} \
177
--location={location} \
178
--filter="{filter_expression}" \
179
--field-mask="finding.name,finding.parentDisplayName,finding.findingClass,finding.category,finding.state,finding.eventTime,finding.severity,finding.resourceName" \
180
--format="json" --order-by="severity,event_time desc" --limit=100
181
```
182
183
| Intent / Target Finding Class | `--filter` Expression |
184
| :---------------------------- | :----------------------------------------- |
185
| **All Active Findings** | `state="ACTIVE"` |
186
| **Vulnerabilities** | `state="ACTIVE" AND |
187
: : findingClass="VULNERABILITY"` :
188
| **Misconfigurations** | `state="ACTIVE" AND |
189
: : findingClass="MISCONFIGURATION"` :
190
| **Toxic Combinations** | `state="ACTIVE" AND |
191
: : findingClass="TOXIC_COMBINATION"` :
192
| **External Exposures** | `state="ACTIVE" AND |
193
: : findingClass="EXTERNAL_EXPOSURE"` :
194
| **Threats** | `state="ACTIVE" AND findingClass="THREAT"` |
195
| **Observations** | `state="ACTIVE" AND |
196
: : findingClass="OBSERVATION"` :
197
| **Sensitive Data Risks** | `state="ACTIVE" AND |
198
: : findingClass="SENSITIVE_DATA_RISK"` :
199
| **Chokepoints** | `state="ACTIVE" AND |
200
: : findingClass="CHOKEPOINT"` :
201
| **Posture Violations** | `state="ACTIVE" AND |
202
: : findingClass="POSTURE_VIOLATION"` :
203
| **Secrets** | `state="ACTIVE" AND findingClass="SECRET"` |
204
| **SCC Errors** | `state="ACTIVE" AND |
205
: : findingClass="SCC_ERROR"` :
206
| **Specific Category** | `state="ACTIVE" AND category="{category}"` |
207
208
### 3. Discovery & Aggregation (Grouping)
209
210
**Intent**: User wants high-level counts or landscape overview (e.g., "What are
211
the most common findings?", "Show me a summary by category"). \
212
**Action**: Use `gcloud scc findings group`. Specify `--location={location}`
213
(default `global` unless querying a specific region). Allowed fields for
214
`--group-by` are strictly: `resource_name`, `category`, `state`, `parent`.
215
216
```bash
217
gcloud scc findings group {parent} \
218
--location={location} \
219
--group-by="{group_by_field}" \
220
--filter="state=\"ACTIVE\"" \
221
--format="json"
222
```
223
224
--------------------------------------------------------------------------------
225
226
## Payload Analysis & Handoff
227
228
Once the finding JSON payload is retrieved:
229
230
* **For `TOXIC_COMBINATION` Findings**:
231
1. Verify the `attackExposure` field is present and has a `score > 0`.
232
2. Inspect the attack path nodes, edges, or referenced
233
`attackExposureResult` to identify exposed resources and attack
234
trajectories.
235
* **For `VULNERABILITY` Findings**:
236
1. Extract CVSS scores, exploit signals (`exploitationActivity`,
237
`observedInTheWild`, `zeroDay`), upstream fix status
238
(`upstreamFixAvailable`), and affected package details from the
239
`vulnerability` object to evaluate risk:
240
- `vulnerability.cve.id`
241
- `vulnerability.cve.cvssv3.baseScore`
242
- `vulnerability.cve.cvssv3.attackVector`
243
- `vulnerability.cve.exploitationActivity`
244
- `vulnerability.cve.observedInTheWild`
245
- `vulnerability.cve.zeroDay`
246
- `vulnerability.cve.upstreamFixAvailable`
247
- `vulnerability.offendingPackage.packageName`
248
- `vulnerability.offendingPackage.packageVersion`
249
- `vulnerability.fixedPackage.packageVersion`
250
- `vulnerability.securityBulletin.suggestedUpgradeVersion`
251
* **Handoff**: Do not draft remediation plans, patch resources, or execute
252
configuration commands. Pass the extracted finding payload to the
253
appropriate remediation or IAM analyzer skill to manage the remediation
254
action loop.
255
256
--------------------------------------------------------------------------------
257
258
## Reference Schema
259
260
See [finding_schema.md](references/finding_schema.md) for the JSON structure of
261
a Security Command Center finding.
262

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,373 prompts

More by @OpenSourceBuffGuy

See all
Website Clone Architect prompt image

Website Clone Architect

Reverse-engineers a website section by section, writes component specs, and hands them to parallel builder agents in git worktrees to rebuild it.

agent-skill, orchestrator, parallel-agents, multi-agent, plan-then-execute, web-development, frontend, codebase-analysis, scaffolding, css, html, nextjs, typescript, git, mcp, claude-code, for-developers, for-designers, long-form, advanced, technical-spec, task-decomposition, structured-output, design-systems, ui-ux, tool-use, checklist, report, vibe-coding

Italian Terrace Cafe Candid Portrait prompt image

Italian Terrace Cafe Candid Portrait

Generates a photorealistic candid shot of a woman in a white corset dress laughing at a sunny hotel terrace cafe, written as detailed JSON.

image-prompt, json-prompt, structured-output, photorealistic, portrait, woman, candid, fashion, cottagecore, natural-light, golden-hour, bokeh, summer, travel, cityscape, mountains, medium-shot, vibrant-colors, for-photographers, nano-banana, fashion-shoot, luxury

Night Street Photo With Leashed Cat prompt image

Night Street Photo With Leashed Cat

Generates a flash-lit night street photo of a blonde woman in a retro track jacket walking a hissing tabby cat on a leash.

image-prompt, json-prompt, nano-banana, structured-output, portrait, woman, animals, pet-portrait, night-scene, street-photography, candid, editorial, fashion, dramatic-lighting, photorealistic, vertical-format, medium-shot, graffiti, for-photographers, for-content-creators

1 view

Reviews

Loading reviews…

Discussion

Loading comments…