Security devsecops

From Mindrally/skills · View interactive version

Security devsecops is an AI agent skill from the GitHub repository Mindrally/skills. DevSecOps, secure software development lifecycle (SSDLC), and application security (AppSec) practices covering secret handling, input validation, dependency hygiene, authentication/authorization, and CI/CD security tooling (SAST, SCA, DAST, secret scanning, IaC scanning). Use when writing code that

How to use this skill

Skill file

Security / DevSecOps

This skill covers secure coding practices, dependency and secret hygiene, authentication and authorization, and the security tooling that belongs in a secure software development lifecycle (SSDLC) — from local coding habits through CI/CD gates to production monitoring.

Workflow for Adding a New Feature Securely

  1. Identify trust boundaries — Note every place the new code accepts input from a user, another service, or a file, and every place it emits output (HTML, logs, another service).
  2. Validate and sanitize at the boundary — Validate all untrusted input on entry; escape output for its destination context (HTML, JS, SQL, shell).
  3. Use existing security primitives — Reach for the project's established auth framework, ORM, and secret-management approach rather than writing new ones.
  4. Keep secrets out of code and logs — Read credentials from environment variables or a secrets vault; confirm nothing sensitive reaches logs or error messages.
  5. Run local security checks before pushing — Lint, SAST, and secret-scanning tools where available (gitleaks, semgrep, npm audit, pip-audit, etc.).
  6. Let CI gates run — SAST, SCA, secret scanning, and IaC scanning should run on every PR; treat a failure as a blocker, not a suggestion to suppress.
  7. Document the security-relevant decision — Note in the PR description any auth/authz change, new dependency, or deviation from a default-secure pattern, so it's auditable later.

General Security Principles

# Unsafe — string interpolation into a query
query = f"SELECT * FROM users WHERE email = '{email}'"
cursor.execute(query)

# Safe — parameterized query
cursor.execute("SELECT * FROM users WHERE email = %s", (email,))

Secret Handling

Database Security

Dependency Management

# Node.js
npm audit --audit-level=high

# Python
pip-audit

# Container image
trivy image myapp:latest

Authentication & Authorization

// Missing authorization check — any authenticated user can access any order
app.get("/orders/:id", requireAuth, async (req, res) => {
  const order = await Order.findById(req.params.id);
  res.json(order);
});

// Correct — verify the resource belongs to the requester
app.get("/orders/:id", requireAuth, async (req, res) => {
  const order = await Order.findById(req.params.id);
  if (!order || order.userId !== req.user.id) {
    return res.status(404).end();
  }
  res.json(order);
});

Secure SDLC Practices

Integrate these into the CI/CD pipeline, not as a manual pre-release checklist:

Monitoring & Feedback

Compliance & Documentation

Common Vulnerability Classes to Watch For

| Class | Watch for |

|---|---|

| Injection (SQL/NoSQL/command) | String-built queries or shell commands with user input |

| Broken access control | Missing per-request authorization checks, IDOR via predictable IDs |

| Cryptographic failures | Weak hashes, hardcoded keys, missing TLS, custom crypto |

| Insecure deserialization | pickle, unchecked JSON.parse into executable contexts, unsafe YAML loaders |

| Security misconfiguration | Default credentials, verbose error pages in production, permissive CORS |

| Vulnerable dependencies | Outdated packages with known CVEs, unpinned versions |

| Insufficient logging | No audit trail for auth events, sensitive data logged in plaintext |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.