Security ownership map

From PramodDutta/qaskills · View interactive version

Security ownership map is an AI agent skill from the GitHub repository PramodDutta/qaskills. Analyze git repositories to build security ownership topology, compute bus factor for sensitive code, detect orphaned security-critical files, and export ownership graphs for visualization.

How to use this skill

Skill file

Security Ownership Map

Build a bipartite graph of people and files from git history to compute ownership risk, detect orphaned security-critical code, and identify bus factor hotspots.

Overview

This skill analyzes git repositories to answer critical security ownership questions:

Workflow

1. Scope the Repository

2. Build the Ownership Map

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

3. Query Security Findings

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

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

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

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

Output Artifacts

The analysis produces:

Sensitivity Rules

Default rules flag common sensitive paths:

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

Override with --sensitive-config path/to/sensitive.csv.

Key Security Queries

  1. Bus factor hotspots — Files with bus_factor <= 1 that handle auth/crypto
  2. Orphaned code — Sensitive files not touched in 6+ months
  3. Hidden owners — Developers who silently control large portions of sensitive code
  4. Ownership drift — Compare against CODEOWNERS to highlight discrepancies

Best Practices

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.