security-ownership-map
Fungsinya
Skill ini memandu agent AI dalam menganalisis riwayat git untuk melihat siapa yang mengerjakan berkas mana dan seberapa banyak kode yang bergantung pada satu orang. Skill ini ditujukan bagi pimpinan teknik dan tim keamanan.
Kapan dipakai
- ✓Saat Anda ingin menemukan kode sensitif yang hanya pernah dikerjakan oleh satu orang.
- ✓Ketika Anda perlu memeriksa apakah berkas CODEOWNERS sesuai dengan siapa yang benar-benar memelihara kode.
- ✓Ketika Anda ingin mengekspor data kepemilikan ke alat grafik seperti Neo4j atau Gephi.
Link skill
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/security-ownership-map/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Tolong analisis repo git kami untuk menemukan berkas sensitif yang hanya pernah diubah oleh satu orang.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent membaca riwayat git, membangun grafik orang dan berkas, menghitung kepemilikan dan bus factor, lalu mengekspor hasilnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
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
- Scope the repo and time window (optional
--since/--until). - Decide sensitivity rules (use defaults or provide a CSV config).
- Build the ownership map with
scripts/run_ownership_map.py(co-change graph is on by default; use--cochange-max-filesto ignore supernode commits). - Communities are computed by default; graphml output is optional (
--graphml). - Query the outputs with
scripts/query_ownership.pyfor bounded JSON slices. - 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; includesmaintainersper community; disable with--no-communities)cochange.graph.json(NetworkX node-link JSON withcommunity_id+community_maintainers; falls back toownership.graph.jsonif 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.p
Pertanyaan umum
Apa itu bus factor?
Itu adalah jumlah orang yang harus pergi sebelum sebagian kode tidak memiliki siapa pun yang memahaminya dengan baik.
Apakah perlu alat khusus?
Skill ini membutuhkan Python 3 dan paket networkx.
Bisakah mengecualikan berkas yang bising?
Bisa. Lockfile dan berkas bersama sejenis dikecualikan secara bawaan agar hasilnya mencerminkan pekerjaan kode yang nyata.
Detail
Deskripsi asli dari pembuat
Analyze git repositories to build a security ownership topology (people-to-file), compute bus factor and sensitive-code ownership, and export CSV/JSON for graph databases and visualization. Trigger only when the user explicitly wants a security-oriented ownership or bus-factor analysis grounded in git history (for example: orphaned sensitive code, security maintainers, CODEOWNERS reality checks for risk, sensitive hotspots, or ownership clusters). Do not trigger for general maintainer lists or non-security ownership questions.
Popularitas
- Bintang GitHub
- 33k
- Peringkat
- #9069
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
owasp-security
33kMengajari agent Anda panduan keamanan OWASP untuk aplikasi web, API, mobile, kontainer, dan agent AI, sehingga bisa menemukan kelemahan umum dan menyarankan perbaikan.
agent-management
33kMembiarkan agent Anda membuat, mencantumkan, menidurkan, membangunkan, mengganti nama, dan menghapus agent AI menggunakan baris perintah AI Maestro, sambil mengelola siklus hidup setiap agent.
agent-messaging
33kMembiarkan agent Anda mengirim, menerima, dan membalas pesan bertanda tangan antaragent AI, menggunakan Agent Messaging Protocol, sebagian besar di mesin Anda sendiri.
docs-search
33kMembiarkan agent Anda mencari dokumentasi kode yang dibuat otomatis untuk tanda tangan fungsi, definisi kelas, dan komentar, sehingga agent memeriksa API yang sebenarnya sebelum mengubah kode.
Skill serupa
reverse-engineer-anything
422kMembantu agent Anda memeriksa aplikasi dan paket yang sudah dirilis untuk menjelaskan fitur, membandingkan versi, atau memandu pembangunan ulang dengan alat REA.
1password
394kMembantu agent Anda mengatur CLI 1Password, masuk, serta membaca atau menyisipkan rahasia tanpa menampilkan nilainya di chat.
healthcheck
394kMembantu agent Anda mengaudit komputer atau server OpenClaw dari risiko keamanan seperti SSH, firewall, pembaruan, dan cadangan, lalu menyarankan perbaikan aman.