Security Ownership Map

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.

97 stars

Best use case

Security Ownership Map is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using Security Ownership Map should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/security-ownership-map/SKILL.md --create-dirs "https://raw.githubusercontent.com/PramodDutta/qaskills/main/seed-skills/security-ownership-map/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/security-ownership-map/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Security Ownership Map Compares

Feature / AgentSecurity Ownership MapStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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:

- **Who owns the security-sensitive code?** Map people to auth, crypto, and secrets-related files
- **What is the bus factor?** Identify files with dangerously low contributor diversity
- **Where is orphaned code?** Find sensitive code that hasn't been touched recently
- **How do files cluster?** Build co-change graphs to understand code movement patterns

## Workflow

### 1. Scope the Repository

- Define the repo root and any in-scope paths
- Set time window with `--since` / `--until` parameters
- Decide sensitivity rules (defaults flag auth/crypto/secret paths)

### 2. Build the Ownership Map

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

### 3. Query Security Findings

```bash
# 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:

- `people.csv` — Nodes: people with timezone detection
- `files.csv` — Nodes: files with sensitivity tags
- `edges.csv` — Edges: touch relationships
- `cochange_edges.csv` — File-to-file co-change edges with Jaccard weight
- `summary.json` — Security ownership findings
- `communities.json` — Code community clusters with maintainers

## Sensitivity Rules

Default rules flag common sensitive paths:

```csv
# 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

- Run quarterly to track ownership changes
- Compare against CODEOWNERS for drift detection
- Filter bots with `--ignore-author-regex '(bot|dependabot)'`
- Use `--window-days 90` to smooth churn effects
- Export to Neo4j/Gephi for visual analysis

Related Skills

OWASP ZAP Security Scanner

97
from PramodDutta/qaskills

Automated web application security scanning using OWASP ZAP for finding XSS, SQL injection, CSRF, and other OWASP Top 10 vulnerabilities.

Security Threat Modeling

97
from PramodDutta/qaskills

Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations to produce actionable AppSec-grade threat models.

Security Best Practices Review

97
from PramodDutta/qaskills

Perform language and framework specific security best-practice reviews, vulnerability detection, and secure-by-default coding guidance for Python, JavaScript/TypeScript, and Go applications.

OWASP Security Testing

97
from PramodDutta/qaskills

Security testing skill based on OWASP Top 10, covering ZAP scanning, security headers, input validation, authentication, and authorization testing.

OAuth2 Security Testing

97
from PramodDutta/qaskills

Security testing for OAuth2 implementations including authorization code flow, PKCE, token handling, redirect URI validation, and scope enforcement.

LLM Security Testing

97
from PramodDutta/qaskills

Security testing for LLM-powered applications including prompt injection, jailbreak detection, data leakage prevention, and AI safety testing.

JWT Security Testing

97
from PramodDutta/qaskills

Comprehensive JWT token security testing including signature verification, expiration checks, algorithm confusion attacks, and claim validation.

CSP Security Testing

97
from PramodDutta/qaskills

Content Security Policy testing and validation to prevent XSS attacks, data injection, and clickjacking through proper CSP header configuration.

CORS Security Testing

97
from PramodDutta/qaskills

Testing Cross-Origin Resource Sharing configurations for misconfigurations, overly permissive policies, and credential handling vulnerabilities.

CodeQL Security Analysis

97
from PramodDutta/qaskills

Advanced security analysis using GitHub CodeQL to find zero-day vulnerabilities, injection flaws, and security anti-patterns in source code.

BurpSuite Security Testing

97
from PramodDutta/qaskills

Web application security testing using BurpSuite for proxy-based interception, scanning, and manual penetration testing of web applications.

API Security Testing

97
from PramodDutta/qaskills

Comprehensive API security testing based on OWASP API Security Top 10 including broken authentication, injection attacks, rate limiting, BOLA/BFLA vulnerabilities, and automated security scanning with ZAP and custom scripts.