Back to skill

Security audit

postgres-aiops

Security checks across malware telemetry and agentic risk

Overview

This is a disclosed PostgreSQL DBA tool that can make real database changes, but those capabilities fit its stated purpose and are not hidden.

Install only if you intend to let an agent inspect or operate PostgreSQL. Start with a read-only or pg_monitor-style role, and grant write/DDL privileges only for targets where agent-driven maintenance is acceptable. Protect POSTGRES_AIOPS_MASTER_PASSWORD like any other secret, and remember that the tool records and previews operations but does not itself decide whether a write is allowed.

SkillSpector

By NVIDIA
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (7)

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
At L013 the skill description presents governance as a control feature for DBA operations. However, L132-L136 clarifies that the skill does not decide whether writes are permitted and has no read-only switch, policy file, or approval gate, so the documented behavior is materially weaker than the claimed governance framing.

Intent-Code Divergence

Low
Confidence
75% confidence
Finding
L138 uses absolute language about the safety model, but the surrounding safety section at L132-L136 makes clear the skill does not enforce authorization or approval for dangerous actions. This creates an intent-level contradiction in the documentation by implying stronger built-in protection than the skill actually provides.

Vague Triggers

Medium
Confidence
83% confidence
Finding
The description says to use the skill whenever the user needs to operate or troubleshoot PostgreSQL as a DBA and then lists many common phrases such as "EXPLAIN this" and "missing index." Although constrained to PostgreSQL context, the trigger guidance is still broad and does not give clear boundary conditions or exclusion examples for overlapping database-help requests.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
This markdown file describes a credential-handling behavior that can affect user privacy and system security: placing the master password in an environment variable. While the guide explains how to do it, it does not warn that environment variables may be exposed via shell history, process inspection, CI logs, or inherited subprocess environments.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
- The password is **never** written to disk in plaintext. It lives only in
  `~/.postgres-aiops/secrets.enc`, encrypted with Fernet (AES-128-CBC + HMAC),
  the key derived from your master password via scrypt. Only a per-store random
  salt and the ciphertext are on disk (chmod 600); the master password itself is
  never stored.
- A legacy plaintext env var `PG_<TARGET_NAME_UPPER>_PASSWORD` is still honoured
  as a fallback with a deprecation warning — migrate with `postgres-aiops secret
Confidence
24% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Session Persistence

Medium
Category
Rogue Agent
Content
Use this skill whenever the user needs to operate or troubleshoot a PostgreSQL server/cluster as a DBA — a one-shot cluster health overview; server reads (version/uptime, settings, extensions, databases, roles); activity (sessions, idle-in-transaction, long-running queries, locks); query stats (pg_stat_statements top-N, EXPLAIN a statement); index health (unused indexes, missing-index hints, bloat, invalid/duplicate); table health (sizes, dead-tuple bloat, autovacuum status); replication (standby lag, replication slots, WAL); three flagship analyses — slow-query RCA (worst pg_stat_statements entry + EXPLAIN → cause/action), bloat & vacuum analysis (dead tuples + autovacuum lag → recommendation), and blocking lock-chain RCA (build the wait-for tree, name the root blocker); and guarded writes (terminate a backend, cancel a query, VACUUM/ANALYZE, create/drop an index, REINDEX, ALTER SYSTEM SET a parameter, reset query stats).
  Always use this skill for "postgres health check", "why is this query slow", "pg_stat_statements top queries", "EXPLAIN this", "table/index bloat", "which indexes are unused", "missing index", "autovacuum status", "who is blocking whom", "kill the backend holding the lock", "replication lag", "replication slots", "VACUUM this table", "create/drop an index", or "ALTER SYSTEM SET work_mem" when the context is a PostgreSQL database.
  Do NOT use when the target is OT / industrial equipment (Modbus, OPC-UA, PLCs — use industrial-aiops), a hypervisor, a storage appliance, a backup product, a container/cluster orchestrator, or a non-PostgreSQL database (negative routing hints only).
  Covers common PostgreSQL DBA operations with a built-in governance harness (audit, token budget, undo, risk-tiers). Beyond the mock suite, the reads plus a governed write and its undo have been exercised against a live PostgreSQL 16.14 instance (see docs/VERIFICATION.md).
installer:
  kind: uv
  package: postgres-aiops
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
2. `postgres-aiops table autovacuum` → check whether autovacuum is simply behind (last run, thresholds) before doing it by hand
3. `postgres-aiops remediate vacuum <table> --analyze --dry-run` → preview; then run for real to `VACUUM ANALYZE` (double confirmation)
4. `postgres-aiops index unused` and `postgres-aiops index bloat` → find indexes that cost writes and return nothing
5. `postgres-aiops remediate drop-index <name> --concurrently --dry-run`, then for real → the tool captures `pg_get_indexdef` **before** dropping and records an inverse recreate descriptor
6. **Failure branch**: dropped the wrong index — `postgres-aiops undo apply <id>` recreates it from the captured definition (not a guess). Note `--full` on `remediate vacuum` takes an **exclusive lock** and rewrites the table; it has no undo, so never reach for it as a first response on a live table.

### Break a blocking pile-up during an incident
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

VirusTotal

64/64 vendors flagged this skill as clean.

View on VirusTotal

Static analysis

Detected: suspicious.prompt_injection_instructions

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
references/agent-guardrails.md:31