Skills Agentes

Openai Security Ownership Map

Analiza repositorios git para construir un mapa de propiedad de seguridad (personas-ficheros), calcular bus factor y exportar CSV/JSON para grafos y visualización.

Oficial
Solicitabashreadgrepglobwriteedit
Estrellas
548

en todo el repo

Actividad
12

0–100, la ruta de este skill

Actualizado
hace 9 meses

último commit aquí

Commits
0

últimos 90 días

Contexto
2.2k tok

146 tok en reposo

Paquete
6 archivos

85 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add trailofbits/skills-curated --skill openai-security-ownership-map --agent claude-code

Se instala solo en este repositorio.

Este skill runs shell commands, writes to your files.

Qué hace

  • Analiza el historial de git para construir un grafo bipartito personas-ficheros y calcular bus factor y propiedad de código sensible
  • Genera un grafo de co-cambio (similitud Jaccard) para agrupar ficheros que se mueven juntos
  • Exporta CSV/JSON (people.csv, files.csv, edges.csv, summary.json, etc.) para Neo4j/Gephi
  • Ofrece scripts de consulta (query_ownership.py, community_maintainers.py) para extraer datos acotados en JSON
  • Detecta zonas horarias de los autores y permite comparar summary.json contra CODEOWNERS

Úsalo cuando

  • Necesitas un análisis de propiedad orientado a seguridad basado en el historial de git
  • Buscas código sensible huérfano, mantenedores de seguridad o comprobaciones de CODEOWNERS frente a riesgo real
  • Quieres detectar hotspots sensibles o clústeres de propiedad por co-cambio

No lo uses cuando

  • Preguntas generales sobre listas de mantenedores no relacionadas con seguridad
  • Cuestiones de propiedad que no tienen un enfoque de seguridad

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • “Analiza quién posee el código de auth/crypto en este repo y cuál es el bus factor”
  • “Detecta código sensible huérfano usando el historial de git”
  • “Compara nuestro CODEOWNERS con la propiedad real del código sensible”
  • “Genera un grafo de co-cambio para ver clústeres de ficheros relacionados con seguridad”

SKILL.md

En inglés

Security Ownership Map

Overview

Build a bipartite graph of people and files from git history, then compute ownership risk and export graph artifacts for Neo4j/Gephi. Also build a file co-change graph (Jaccard similarity on shared commits) to cluster files by how they move together while ignoring large, noisy commits.

Requirements

  • Python 3
  • networkx (required; community detection is enabled by default)

Install with:

pip install networkx

Workflow

  1. Scope the repo and time window (optional --since/--until).
  2. Decide sensitivity rules (use defaults or provide a CSV config).
  3. Build the ownership map with scripts/run_ownership_map.py (co-change graph is on by default; use --cochange-max-files to ignore supernode commits).
  4. Communities are computed by default; graphml output is optional (--graphml).
  5. Query the outputs with scripts/query_ownership.py for bounded JSON slices.
  6. Persist and visualize (see references/neo4j-import.md).

By default, the co-change graph ignores common “glue” files (lockfiles, .github/*, editor config) so clusters reflect actual code movement instead of shared infra edits. Override with --cochange-exclude or --no-default-cochange-excludes. Dependabot commits are excluded by default; override with --no-default-author-excludes or add patterns via --author-exclude-regex.

If you want to exclude Linux build glue like Kbuild from co-change clustering, pass:

python skills/skills/security-ownership-map/scripts/run_ownership_map.py \
  --repo /path/to/linux \
  --out ownership-map-out \
  --cochange-exclude "**/Kbuild"

Quick start

Run from the repo root:

python skills/skills/security-ownership-map/scripts/run_ownership_map.py \
  --repo . \
  --out ownership-map-out \
  --since "12 months ago" \
  --emit-commits

Defaults: author identity, author date, and merge commits excluded. Use --identity committer, --date-field committer, or --include-merges if needed.

Example (override co-change excludes):

python skills/skills/security-ownership-map/scripts/run_ownership_map.py \
  --repo . \
  --out ownership-map-out \
  --cochange-exclude "**/Cargo.lock" \
  --cochange-exclude "**/.github/**" \
  --no-default-cochange-excludes

Communities are computed by default. To disable:

python skills/skills/security-ownership-map/scripts/run_ownership_map.py \
  --repo . \
  --out ownership-map-out \
  --no-communities

Sensitivity rules

By default, the script flags common auth/crypto/secret paths. Override by providing a CSV file:

# pattern,tag,weight
**/auth/**,auth,1.0
**/crypto/**,crypto,1.0
**/*.pem,secrets,1.0

Use it with --sensitive-config path/to/sensitive.csv.

Output artifacts

ownership-map-out/ contains:

  • people.csv (nodes: people)
  • files.csv (nodes: files)
  • edges.csv (edges: touches)
  • cochange_edges.csv (file-to-file co-change edges with Jaccard weight; omitted with --no-cochange)
  • summary.json (security ownership findings)
  • commits.jsonl (optional, if --emit-commits)
  • communities.json (computed by default from co-change edges when available; includes maintainers per community; disable with --no-communities)
  • cochange.graph.json (NetworkX node-link JSON with community_id + community_maintainers; falls back to ownership.graph.json if no co-change edges)
  • ownership.graphml / cochange.graphml (optional, if --graphml)

people.csv includes timezone detection based on author commit offsets: primary_tz_offset, primary_tz_minutes, and timezone_offsets.

LLM query helper

Use scripts/query_ownership.py to return small, JSON-bounded slices without loading the full graph into context.

Examples:

python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out people --limit 10
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out files --tag auth --bus-factor-max 1
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out person --person alice@corp --limit 10
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out file --file crypto/tls
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out cochange --file crypto/tls --limit 10
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out summary --section orphaned_sensitive_code
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out community --id 3

Use --community-top-owners 5 (default) to control how many maintainers are stored per community.

Basic security queries

Run these to answer common security ownership questions with bounded output:

# Orphaned sensitive code (stale + low bus factor)
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out summary --section orphaned_sensitive_code

# Hidden owners for sensitive tags
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out summary --section hidden_owners

# Sensitive hotspots with low bus factor
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out summary --section bus_factor_hotspots

# Auth/crypto files with bus factor <= 1
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out files --tag auth --bus-factor-max 1
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out files --tag crypto --bus-factor-max 1

# Who is touching sensitive code the most
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out people --sort sensitive_touches --limit 10

# Co-change neighbors (cluster hints for ownership drift)
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out cochange --file path/to/file --min-jaccard 0.05 --limit 20

# Community maintainers (for a cluster)
python skills/skills/security-ownership-map/scripts/query_ownership.py --data-dir ownership-map-out community --id 3

# Monthly maintainers for the community containing a file
python skills/skills/security-ownership-map/scripts/community_maintainers.py \
  --data-dir ownership-map-out \
  --file network/card.c \
  --since 2025-01-01 \
  --top 5

# Quarterly buckets instead of monthly
python skills/skills/security-ownership-map/scripts/community_maintainers.py \
  --data-dir ownership-map-out \
  --file network/card.c \
  --since 2025-01-01 \
  --bucket quarter \
  --top 5

Notes:

  • Touches default to one authored commit (not per-file). Use --touch-mode file to count per-file touches.
  • Use --window-days 90 or --weight recency --half-life-days 180 to smooth churn.
  • Filter bots with --ignore-author-regex '(bot|dependabot)'.
  • Use --min-share 0.1 to show stable maintainers only.
  • Use --bucket quarter for calendar quarter groupings.
  • Use --identity committer or --date-field committer to switch from author attribution.
  • Use --include-merges to include merge commits (excluded by default).

Summary format (default)

Use this structure, add fields if needed:

{
  "orphaned_sensitive_code": [
    {
      "path": "crypto/tls/handshake.rs",
      "last_security_touch": "2023-03-12T18:10:04+00:00",
      "bus_factor": 1
    }
  ],
  "hidden_owners": [
    {
      "person": "alice@corp",
      "controls": "63% of auth code"
    }
  ]
}

Graph persistence

Use references/neo4j-import.md when you need to load the CSVs into Neo4j. It includes constraints, import Cypher, and visualization tips.

Notes

  • bus_factor_hotspots in summary.json lists sensitive files with low bus factor; orphaned_sensitive_code is the stale subset.
  • If git log is too large, narrow with --since or --until.
  • Compare summary.json against CODEOWNERS to highlight ownership drift.

When to Use

When NOT to Use

Reproducido de trailofbits/skills-curated bajo licencia CC-BY-SA-4.0. Leer esta página en markdown.

Archivos

6 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Requiere Python 3 y la librería networkx instalada (pip install networkx).

Necesita en el PATH:pippython

Detalles

Categoría
Seguridad
Licencia
CC-BY-SA-4.0
Recursos incluidos
scripts en python + referencias
Código fuente
Ver SKILL.md

Más de trailofbits/skills-curated

Este repo incluye 30 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack skills-curated entero y su comando de instalación

Interroga al usuario sin descanso sobre un plan, decisión o idea hasta resolver cada rama del árbol de decisión, o cuando dice "grill me on this".

Costo de contexto al activarse
443 tok
Tamaño del paquete
1 archivo
Última actualización
hace 4 meses
Oficialproductividad

Compacta la conversación actual en un documento de traspaso para que un agente nuevo pueda continuar el trabajo en otra sesión.

Costo de contexto al activarse
394 tok
Tamaño del paquete
1 archivo
Última actualización
hace 4 meses
Permisos
Oficialproductividad

Enseña al usuario una nueva habilidad o concepto a lo largo de varias sesiones, usando el directorio actual como un espacio de enseñanza con estado, con lecciones, registros de aprendizaje y materiales de referencia.

Costo de contexto al activarse
2.6k tok
Tamaño del paquete
5 archivos
Última actualización
hace 4 meses
Permisos
Oficialaprendizaje

Referencia para escribir y editar bien skills de agentes: el vocabulario y los principios que hacen que un skill sea predecible. Consúltalo al redactar, revisar o podar un SKILL.md.

Costo de contexto al activarse
2.6k tok
Tamaño del paquete
2 archivos
Última actualización
hace 4 meses
Oficialherramientas desarrollo

Guía experta para el fuzzing web con ffuf en pentesting autorizado: descubrimiento de directorios y subdominios, fuzzing de parámetros, peticiones autenticadas y análisis de resultados.

Costo de contexto al activarse
1.7k tok
Tamaño del paquete
3 archivos
Última actualización
hace 9 meses
Permisos
Oficialseguridad

Elimina señales de escritura generada por IA en un texto, para que suene más natural y humano, según la guía de Wikipedia sobre 'Signs of AI writing'.

Costo de contexto al activarse
3k tok
Tamaño del paquete
2 archivos
Última actualización
hace 9 meses
Oficialredaccion contenido

Skills relacionados

Barreras de seguridad para comandos destructivos (gstack).

Costo de contexto al activarse
879 tok
Tamaño del paquete
4 archivos
Última actualización
hace 3 meses
Permisos
seguridad

Cso

134k

Modo Chief Security Officer: auditoría de seguridad centrada en infraestructura, con OWASP Top 10, modelado de amenazas STRIDE y verificación activa.

Costo de contexto al activarse
19.2k tok
Tamaño del paquete
6 archivos
Última actualización
hace 3 meses
Permisos
seguridad

Guard

134k

Modo de máxima seguridad: avisos ante comandos destructivos más restricción de ediciones a un directorio concreto (gstack).

Costo de contexto al activarse
850 tok
Tamaño del paquete
2 archivos
Última actualización
hace 3 meses
Permisos
seguridad