Google Cloud SCC Remediation

Google Cloud SCC Remediation

Remediates Google Cloud Security Command Center findings, from IAM fixes to misconfigurations and vulnerabilities, presenting a plan and waiting for approval before changing anything.

Skill files5 files

references/

SKILL.md177 lines
1
---
2
name: google-cloud-scc-remediation
3
metadata:
4
category: Security
5
version: "1.0.1"
6
description: >-
7
Remediates Google Cloud Security Command Center findings, including IAM
8
permission fixes, cloud resource misconfigurations, vulnerabilities, and Toxic
9
Combinations. Use when asked to fix, remediate, or mitigate a Security Command Center
10
finding or address attack paths. Don't use for general IAM policy querying without a
11
Security Command Center finding. For runtime threat detections, this skill provides
12
containment and investigation guidance rather than automated configuration fixes.
13
---
14
15
# Google Cloud Security Command Center Remediation
16
17
## Usage Attribution
18
19
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
20
MUST read and follow the instructions in
21
[Usage Attribution](references/attribution.md).
22
23
## Overview
24
25
A unified remediation skill for Google Cloud Security Command Center findings.
26
It handles both single-domain findings and multi-domain Toxic Combinations.
27
28
## 1. Safety & Consent Gate
29
30
Security Command Center remediations modify infrastructure, access policies, or
31
workload deployments.
32
33
* **Mandatory Consent Gate**: NEVER execute mutating `gcloud`, `terraform`, or
34
API commands without first presenting a structured remediation plan and the
35
exact command/config diff to the user. STOP after presenting the plan and
36
ALWAYS ask: "Do you approve executing this remediation plan?" before
37
execution. Automatic mutation of security policies or resource
38
configurations can cause unintended outages, lockouts, or compliance
39
violations.
40
* **Confirm the Target Project**: Before executing, confirm that the active
41
`gcloud` account and project match the project of the finding's resource.
42
Every mutating command MUST specify the target explicitly, with `--project`
43
or a full resource path, rather than relying on the default `gcloud`
44
project.
45
* **Verification & Rollback Required**: Every proposed remediation plan MUST
46
explicitly include, for each mutating step:
47
* the mutating remediation command(s),
48
* the verification check command(s) (`gcloud ... describe` or `list`), and
49
* the rollback command(s) that undo the change, or an explicit statement
50
that the step cannot be undone (for example, service account key
51
deletion).
52
53
Use the commands from the loaded playbook where they exist. If the playbook
54
lacks a verification or rollback command for a step, derive the command and
55
label it as not sourced from a playbook.
56
* **Dependency & Impact Checks**: Every remediation plan MUST state what could
57
break as a result of each change and ask the user to confirm nothing depends
58
on it. For example:
59
* IAM role changes or revocations: you MUST explicitly advise the user to
60
verify cross-project dependencies and CI/CD pipeline workflows that rely
61
on the existing permissions before revoking a project-level role
62
binding.
63
* Firewall rule changes: other traffic the same rule allows (such as web
64
traffic on ports 80 or 443).
65
* External IP removal: inbound access and outbound internet access for the
66
VM.
67
* Public Access Prevention on a bucket: sites or users that legitimately
68
read it publicly.
69
* **CRITICAL WORKFLOW RULE**: Do NOT execute any mutating commands in the same
70
turn that you present the remediation plan. You MUST end your turn
71
immediately after asking for approval and wait for the user's next message.
72
* If there is no interactive user (for example, a scheduled or pipeline
73
run), stop at the plan and never execute.
74
* If the user approves only part of the plan, or the plan changes after
75
approval, present the updated plan and ask for approval again before
76
executing.
77
* **Narrowly Scoped Changes**: Always propose the narrowest possible fix that
78
resolves the finding. When more than one fix would work, prefer reversible
79
changes over irreversible ones (for example, disable a key before deleting
80
it), resource-level changes over project, folder, or organization-level
81
changes, and changes that affect only the finding's resource over changes
82
that affect other resources. Do not bundle fixes for unrelated issues
83
noticed along the way; mention them to the user separately.
84
85
## 2. Intent Router & Progressive Disclosure
86
87
Do not load all reference playbooks into memory at once. Analyze the Security
88
Command Center finding's `category`, `findingClass`, or attack path, then read
89
ONLY the relevant reference document(s).
90
91
Match on the finding's `category` **first**, and fall back to `findingClass`
92
only when no category matches. Routing on `findingClass` alone misroutes IAM
93
findings: Security Health Analytics IAM findings are `MISCONFIGURATION` class,
94
and IAM recommender findings are `Vulnerability` class, so neither would ever
95
reach the IAM playbook.
96
97
| Match On | Values | Target Reference Playbook |
98
| :---------------------- | :---------------------------------------- | :--------------------------------------------------------------------------- |
99
| `category` | `PRIMITIVE_ROLES_USED`, | [`references/remediation_iam.md`](references/remediation_iam.md) |
100
: (Security Health : `OVER_PRIVILEGED_SERVICE_ACCOUNT_USER`, : :
101
: Analytics) : `ADMIN_SERVICE_ACCOUNT`, : :
102
: : `SERVICE_ACCOUNT_ROLE_SEPARATION`, : :
103
: : `KMS_ROLE_SEPARATION`, : :
104
: : `USER_MANAGED_SERVICE_ACCOUNT_KEY`, : :
105
: : `SERVICE_ACCOUNT_KEY_NOT_ROTATED` : :
106
| `category` | `IAM_ROLE_HAS_EXCESSIVE_PERMISSIONS`, | [`references/remediation_iam.md`](references/remediation_iam.md) |
107
: (IAM recommender) : `UNUSED_IAM_ROLE`, : :
108
: : `SERVICE_AGENT_GRANTED_BASIC_ROLE`, : :
109
: : `SERVICE_AGENT_ROLE_REPLACED_WITH_BASIC_ROLE` : :
110
| `category` | `PUBLIC_BUCKET_ACL`, `PUBLIC_IP_ADDRESS`, | [`references/remediation_misconfig.md`](references/remediation_misconfig.md) |
111
: (Security Health : `OPEN_FIREWALL`, `OPEN_SSH_PORT`, : :
112
: Analytics) : `OPEN_RDP_PORT`, `KMS_KEY_NOT_ROTATED` : :
113
| `category` | `OS_VULNERABILITY`, `SOFTWARE_VULNERABILITY`, | [`references/remediation_vuln.md`](references/remediation_vuln.md) |
114
: : `GKE_RUNTIME_OS_VULNERABILITY` (CVEs, OS : :
115
: : patch, container base image upgrade, : :
116
: : vulnerable package, GKE node pool upgrade). : :
117
: : Note: Web Security Scanner (WSS) findings : :
118
: : fall through to *no match* below. : :
119
| `findingClass` | `TOXIC_COMBINATION` — attack path | **Sequential Load**: Identify each exposed facet in the attack path and load |
120
: : exposure, multi-domain attack vector : the matching reference playbooks sequentially. :
121
| *no match* | Any other category or finding class | See **Findings Without Dedicated Playbooks** below. Do not force a finding |
122
: : : into a playbook that does not cover it. :
123
124
### Findings Without Dedicated Playbooks & Runtime Threat Detections
125
126
When presented with Security Command Center findings that do not have automated
127
configuration remediation playbooks—such as runtime threat detections (e.g.,
128
Cloud Run Threat Detection, Agent Platform Threat Detection, Event Threat
129
Detection, Container Threat Detection):
130
131
1. **Do NOT execute automated mutation commands**: Runtime threat detections
132
represent active alerts or behavioral anomalies rather than static resource
133
misconfigurations.
134
2. **Provide Documentation & Containment Guidance**:
135
* Refer the user to the relevant Security Command Center documentation
136
(e.g.,
137
[Cloud Run Threat Detection](https://docs.cloud.google.com/security-command-center/docs/cloud-run-threat-detection-overview.md.txt#detectors),
138
[Agent Platform Threat Detection](https://docs.cloud.google.com/security-command-center/docs/agent-platform-threat-detection-overview.md.txt#detectors)).
139
* Recommend manual investigation steps: analyzing audit logs in Cloud
140
Logging, identifying compromised service accounts or API keys, and
141
isolating affected workloads.
142
* Advise the user on containment options (e.g., revoking active
143
credentials, blocking malicious IPs at Cloud Armor/firewall).
144
145
## 3. Standard Remediation Workflow
146
147
1. **Inspect Finding Details & Intentionality**:
148
* If the finding's details are not already in the conversation, retrieve
149
them using the `google-cloud-scc-query` skill. Verify the finding name,
150
affected resource (`resourceName`), category, and attack exposure score.
151
* Before planning a fix, ask the user whether the flagged configuration is
152
intentional (for example, a bucket serving a public website, or a VM that
153
must accept public traffic). If it is, do not propose a remediation.
154
Suggest muting the finding with a documented justification instead;
155
muting changes the finding's state, so it also requires the user's
156
approval.
157
2. **Route & Load Reference**: Read the matching reference playbook(s) from the
158
routing table above.
159
3. **Formulate Least-Privilege Remediation**: Before drafting, check whether the
160
resource is managed by infrastructure as code (ask the user, and check for
161
signals such as the `goog-terraform-provisioned` label). If it is, draft the
162
change to the Terraform configuration rather than a `gcloud` command.
163
Otherwise, draft the exact CLI (`gcloud`) or IAM binding change needed to
164
close the exposure without disrupting business workloads.
165
4. **Present Plan & Seek Consent**: Show the user the plan required by the
166
Safety & Consent Gate: for each step, the remediation command, the
167
verification command, the rollback command, and what could break. STOP
168
execution here and ALWAYS ask the explicit question: "Do you approve
169
executing this remediation plan?"
170
5. **Execute on Approval**: ONLY after receiving explicit user confirmation,
171
execute the remediation commands and run the verification commands to confirm
172
the resource is fixed. If a command fails, stop and report the error; do not
173
try a different command without presenting it and getting approval again.
174
Tell the user that the finding's state in Security Command Center updates on
175
the detector's next scan, which may take some time, and do not manually mark
176
the finding as resolved.
177

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

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…