Back to skill

Security audit

Incident Runbook Templates

Security checks for vulnerabilities and agentic risk

Overview

This skill is a markdown-only incident runbook template, but it includes high-impact production commands without enough approval, scoping, or safety guardrails.

Review before installing or using in production incident workflows. Treat the examples as drafts only: add explicit approval gates, environment and tenant scoping, read-only preview steps, backup checks, owner signoff, safer alternatives, and post-action validation before allowing an agent or responder to suggest or run the mutating commands.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:337
Finding
Overbroad Database Session Termination Procedure## Vulnerability Details **File Location**: `SKILL.md`, lines 337-340 **Vulnerability Type**: Unsafe production database operation **Risk Level**: Medium ```sql SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE state = 'idle' AND query_start < now() - interval '10 minutes'; ``` ### Technical Analysis The runbook instructs responders to terminate every database session classified as idle for more than ten minutes. It does not restrict the operation to the affected application, database, user, tenant, or incident. It also does not exclude privileged accounts, operational sessions, protected workloads, or the responder's own backend. An idle connection may still belong to a healthy application connection pool or operational process. Terminating all matching sessions can therefore disrupt unrelated workloads and increase the incident's blast radius. The procedure lacks a preview query, authorization gate, confirmation step, maintenance-window requirement, and post-operation recovery instructions. The related command at `SKILL.md:152`, `SELECT pg_terminate_backend(pid);`, is also invalid as written because it provides neither a concrete PID nor a source relation. Under incident pressure, a responder may attempt to repair it by adding an insufficiently constrained query. ### Attack Path 1. A database incident or apparent connection-pool exhaustion triggers use of the runbook. 2. A responder connects with a role authorized to call `pg_terminate_backend`. 3. The responder executes the supplied statement without first identifying which applications own the matching sessions. 4. PostgreSQL terminates all accessible sessions matching the broad idle-time condition. 5. Connection pools reconnect simultaneously, transactions or operational workflows are interrupted, and unrelated services may experience errors or a connection storm. This is primarily an unsafe operational failure path rather than a privilege-escala ...[truncated 637 chars]
Remediation
## Remediation Suggestions - Begin with a read-only preview that displays each candidate's PID, database, user, application name, client address, state-change time, and query. - Require explicit filters for the affected database, application, and service account. - Exclude the current backend with `pid <> pg_backend_pid()`. - Exclude database administrators, replication processes, monitoring users, and other protected operational accounts. - Prefer application-level pool recycling or targeted termination of individually reviewed PIDs. - Require incident-commander or database-owner approval before terminating multiple sessions. - Record selected PIDs and the reason for termination in the incident timeline. - Apply a small batch limit, monitor reconnection behavior, and stop if error rates or connection attempts rise. - Add verification and recovery procedures for application connectivity, pool health, transaction failures, and database load.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:370
Finding
Uncontrolled VACUUM FULL Recommendation During Critical Disk Conditions## Vulnerability Details **File Location**: `SKILL.md`, line 370 **Vulnerability Type**: Unsafe locking and disk-intensive database maintenance **Risk Level**: Medium ```bash psql -c "VACUUM FULL large_table;" ``` ### Technical Analysis The disk-space incident procedure recommends running `VACUUM FULL` on a large table without prerequisite checks or warnings. `VACUUM FULL` rewrites the table, requires additional temporary disk capacity, and takes an `ACCESS EXCLUSIVE` lock that blocks concurrent access. Running this operation while disk space is already critical may consume the remaining capacity or fail partway through. Running it against an active production table can also block reads and writes for an extended period. The runbook does not require checking table size, available space, lock impact, active traffic, backup status, replication effects, maintenance-window approval, or lower-impact alternatives. ### Attack Path 1. A low-disk-space alert causes a responder to open the database incident runbook. 2. The responder identifies a large table and substitutes its name for `large_table`. 3. The command starts a full table rewrite while storage capacity is already constrained. 4. PostgreSQL acquires an exclusive table lock and consumes additional disk space. 5. Application requests block or fail, replicas may fall behind, and storage may become fully exhausted. 6. The attempted mitigation increases downtime and can turn a capacity warning into a broader database outage. This is an operational failure path. An attacker able to induce disk pressure or influence the selected table could increase the likelihood and impact of the unsafe response. ### Impact Assessment The command uses the existing privileges of the database account passed to `psql`; it does not create new privileges. If that account owns a critical table or has elevated maintenance privileges, the command can block all access to that table and consume ...[truncated 177 chars]
Remediation
## Remediation Suggestions - Remove `VACUUM FULL` as an unqualified emergency response step. - Require confirmation of the target database, schema, and table before any maintenance operation. - Measure table size, free disk space, estimated rewrite requirements, current locks, active traffic, and replication lag. - Verify that recoverable backups exist and that the operation has explicit database-owner approval. - Document that `VACUUM FULL` takes an exclusive lock and may require substantial additional disk capacity. - Prefer lower-impact options where appropriate, such as ordinary `VACUUM`, deleting or archiving safely selected data, adding storage, or moving the rewrite to a controlled maintenance window. - Set appropriate `lock_timeout` and `statement_timeout` values so the operation does not wait indefinitely or run without control. - Include abort criteria and post-operation checks for disk usage, blocked sessions, application health, and replication lag.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

External Transmission

Medium
Category
Data Exfiltration
Content
```

### 2. Quick Health Checks
- [ ] Can you reach the service? `curl -I https://api.company.com/payments/health`
- [ ] Database connectivity? Check connection pool metrics
- [ ] External dependencies? Check Stripe, bank API status
- [ ] Recent changes? Check deploy history
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```

### 2. Quick Health Checks
- [ ] Can you reach the service? `curl -I https://api.company.com/payments/health`
- [ ] Database connectivity? Check connection pool metrics
- [ ] External dependencies? Check Stripe, bank API status
- [ ] Recent changes? Check deploy history
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```

### 2. Quick Health Checks
- [ ] Can you reach the service? `curl -I https://api.company.com/payments/health`
- [ ] Database connectivity? Check connection pool metrics
- [ ] External dependencies? Check Stripe, bank API status
- [ ] Recent changes? Check deploy history
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
```

### 2. Quick Health Checks
- [ ] Can you reach the service? `curl -I https://api.company.com/payments/health`
- [ ] Database connectivity? Check connection pool metrics
- [ ] External dependencies? Check Stripe, bank API status
- [ ] Recent changes? Check deploy history
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The runbook contains high-impact operational actions such as rollout undo, scaling changes, query termination, feature-flag changes, and network policy updates, but it does not prominently require change-control, authorization, pre-checks, or operator confirmation before execution. In an agent skill context, these step-by-step commands can be copied or suggested during a live incident, increasing the risk of unsafe or premature actions that worsen outages or cause secondary impact.

External Transmission

Medium
Category
Data Exfiltration
Content
psql -h $DB_HOST -U $DB_USER -c "SELECT pg_terminate_backend(pid);"

# Step 4: Check external dependency latency
curl -w "@curl-format.txt" -o /dev/null -s https://api.stripe.com/v1/health

# Step 5: Enable circuit breaker if dependency is slow
kubectl set env deployment/payment-service \
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
# Go to Sentry: https://sentry.io/payments

# Step 3: If specific endpoint, enable feature flag to disable
curl -X POST https://api.company.com/internal/feature-flags \
  -d '{"flag": "DISABLE_PROBLEMATIC_FEATURE", "enabled": true}'

# Step 4: If data issue, check recent data changes
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
# Go to Sentry: https://sentry.io/payments

# Step 3: If specific endpoint, enable feature flag to disable
curl -X POST https://api.company.com/internal/feature-flags \
  -d '{"flag": "DISABLE_PROBLEMATIC_FEATURE", "enabled": true}'

# Step 4: If data issue, check recent data changes
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The database template includes especially dangerous operations such as terminating connections, VACUUM FULL, and guidance to delete old data or fail over, without strong warnings about irreversibility, locking, performance impact, or data-loss risk. In incident handling, such commands are easy to misuse under pressure and can escalate service degradation or destroy needed forensic evidence.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
### Don'ts
- **Don't assume knowledge** - Write for 3 AM brain
- **Don't skip verification** - Confirm each step worked
- **Don't forget communication** - Keep stakeholders informed
- **Don't work alone** - Escalate early
- **Don't skip postmortems** - Learn from every incident
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Static analysis

No suspicious patterns detected.