security-ownership-map

Analyze git history to map security code ownership, bus factor, and co-change clusters.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Peterson-Benhame/agent-skills --skill security-ownership-map-peterson-benhame
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-ownership-map
Source: https://github.com/Peterson-Benhame/agent-skills/tree/main/packages/skills-catalog/skills/%28security%29/security-ownership-map
Command: npx skills add https://github.com/Peterson-Benhame/agent-skills --skill security-ownership-map-peterson-benhame

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires networkx, and includes scripts (resource) and references (resource) components.

What problem does it solve? Security teams often lack visibility into who actually owns sensitive code like auth, crypto, and secrets handling. This Skill analyzes git history to reveal hidden owners, orphaned sensitive files, and low bus-factor hotspots that CODEOWNERS files alone cannot show. ## Core Features & Use Cases - Ownership Topology: Builds a bipartite people-to-file graph from git history with recency weighting, timezone detection, and sensitivity tagging for auth, crypto, and secrets paths. - Risk Detection: Computes bus factor per file, flags orphaned sensitive code, and identifies hidden owners controlling large shares of security-critical code. - Co-Change Clustering: Detects file communities via Jaccard similarity and NetworkX community detection, then reports maintainers per cluster over monthly or quarterly buckets. - Use Case: A security engineer runs the analysis on a monorepo, discovers that one engineer controls 63% of auth code and several crypto files have a bus factor of 1, then exports the graph to Neo4j for visualization. ## Quick Start Ask the agent to run the ownership map script against your repository and report orphaned sensitive code and bus-factor hotspots from the generated summary.

Frequently Asked Questions about security-ownership-map

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze code ownership from git history?

Run the run_ownership_map.py script against your repository to parse git log output into people, files, and edges CSVs. It attributes touches by author identity, applies recency weighting, and writes a summary.json with ownership findings.

How to find bus factor for sensitive code files?

The script computes bus factor as the count of distinct authors per file and flags sensitive files below a configurable threshold. Query results with query_ownership.py using the files command with --tag and --bus-factor-max filters.

Does the ownership analysis require networkx?

Yes, networkx is required for community detection and GraphML export, which are enabled by default. Install it with pip install networkx before running the build script.

Can I customize which files count as sensitive?

Yes, provide a CSV file with pattern, tag, and weight columns via the --sensitive-config flag. Default rules cover auth, crypto, secrets, keys, and certificate file patterns.

How do I import the ownership graph into Neo4j?

Copy people.csv, files.csv, and edges.csv into the Neo4j import directory and run the provided Cypher LOAD CSV statements. The references/neo4j-import.md file includes constraints, import queries, and visualization tips.

Why are lockfiles and bot commits excluded from co-change clustering?

Lockfiles, .github paths, and Dependabot commits create noisy supernode edges that distort clusters. The script excludes them by default, and you can override with --no-default-cochange-excludes or --no-default-author-excludes.