Files
skills/public/collaboration-github-security-features.html
zeekay 747dafba10 Register WebMCP tools on every page, and name each page's twin from site.py
Every page now loads /webmcp.js, scripts/webmcp.ts with its types
stripped (npm run webmcp). Where the browser has document.modelContext
it registers two read-only tools: search_skills over the published
skills index, and get_skill, which returns a skill's markdown checked
against the index digest. The markdown alternate link moves from
build.py to site.py, so CI holds every page to it.

The API catalog gains the site itself (llms.txt and the skills index)
and hanzo.ai/agents; the live discovery check now fetches every
catalog link. tests/site.mjs drives the tools through a recording
modelContext, and checks a browser without one loads clean.
2026-10-26 20:57:05 -07:00

837 lines
35 KiB
HTML

<!doctype html>
<html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>collaboration-github-security-features</title>
<meta name="color-scheme" content="dark">
<style>
/* Committed to one visual world: a dark instrument panel. No light variant —
the dot field and the hairline rules only read on black, and a naive
inversion would wash both out. Every colour is painted explicitly so the page
never borrows a host background. */
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
:root{
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
--font-zen-pixel-square:'Zen Pixel Square',monospace;
--mono:var(--font-zen-mono);
--sans:var(--font-zen-sans);
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
--r:999px; --r-soft:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
/* The dot field. A halftone made of one repeating radial-gradient, faded out
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
/* No overflow clip here: the dot field is inset to the box already, and a clip
would cut off the copy-prompt menu. */
.hero{position:relative;border-bottom:1px solid var(--line)}
.hero::before{content:"";position:absolute;inset:0;
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
background-size:7px 7px;
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
pointer-events:none}
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
nav{border-bottom:1px solid var(--line)}
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
justify-content:space-between;align-items:center;gap:1rem}
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
text-transform:uppercase;color:var(--ink);text-decoration:none;
display:inline-flex;align-items:center;gap:.6rem}
.brand i{font-style:normal;color:var(--faint)}
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
text-transform:uppercase;color:var(--soft);text-decoration:none}
nav a.up:hover{color:var(--ink)}
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
h1 em{font-style:normal;color:var(--faint)}
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
line-height:1.2;font-weight:400}
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
.btn.solid:hover{background:#d8d8d4}
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
/* Copy-prompt selector. Each row copies the prompt for its own target. */
.copy{position:relative;display:inline-flex}
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
padding:.4rem;display:flex;flex-direction:column;
box-shadow:0 12px 32px rgba(0,0,0,.75)}
.menu[hidden]{display:none}
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
white-space:nowrap}
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
.mi:hover .mark{color:var(--ink)}
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
letter-spacing:.1em;text-transform:uppercase}
/* Works-with bar: one scrolling row, name and mark per agent. */
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
display:flex;align-items:center}
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
-webkit-overflow-scrolling:touch;
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
.bar::-webkit-scrollbar{display:none}
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
text-decoration:none;background:var(--ground)}
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
.agent .mark{width:.95rem;height:.95rem}
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
p{margin:0 0 1rem;max-width:70ch}
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
li{margin:.22rem 0}
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
text-decoration-color:var(--line-hi)}
a:hover{text-decoration-color:var(--ink)}
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
display:block;overflow-x:auto}
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
.curl{display:block;background:var(--panel);border:1px solid var(--line);
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
white-space:pre;line-height:1.9}
.curl b{color:var(--ink);font-weight:400}
.curl i{font-style:normal;color:var(--faint)}
/* index */
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
#q:focus{outline:none;border-color:var(--soft)}
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
text-transform:uppercase;margin:0 0 2rem}
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
padding-bottom:.45rem}
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
border-radius:var(--r-soft);text-decoration:none}
.row:hover{background:#0a0a0a}
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
color:var(--faint);font-size:.85rem}
footer a{color:var(--soft)}
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
margin:0 0 2rem;font-size:.85rem}
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
border-bottom:1px solid var(--line);padding-bottom:.4rem}
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
.fmap a:hover{text-decoration:underline}
.fmap div{color:var(--faint);line-height:1.5}
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
@media (max-width:640px){
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
.btns{gap:.5rem}
.btn{padding:.75rem 1.15rem;font-size:.68rem}
.copy,.copy .btn{width:100%;justify-content:center}
.menu{left:0;right:0;min-width:0}
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
.strip b{border-right:0;padding-right:0}
.bar{width:100%}
}
</style>
<link rel="icon" href="/favicon.svg">
<link rel="canonical" href="https://hanzoskills.com/collaboration-github-security-features">
<link rel="alternate" type="text/markdown" href="/collaboration-github-security-features.md">
<script type="module" src="/webmcp.js"></script>
</head>
<!-- Reading this with a machine? Every page here is also plain markdown.
This one: https://hanzoskills.com/collaboration-github-security-features.md
Index: https://hanzoskills.com/llms.txt
Corpus: https://hanzoskills.com/all.md
Append .md to any path for the markdown twin. -->
<body>
<nav><div class="in">
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
<a class="up" href="/">All skills</a>
</div></nav>
<div class="wrap">
<h1>collaboration-github-security-features</h1><p class="lede">Dependabot, code scanning, secret scanning, SBOM generation, security advisories, and security best practices</p><h1>GitHub Security Features</h1>
<p><strong>Scope</strong>: Dependabot configuration and automation, CodeQL code scanning, secret scanning and protection, SBOM generation, security advisories, SECURITY.md policies, and vulnerability remediation</p>
<p><strong>Lines</strong>: ~340</p>
<p><strong>Last Updated</strong>: 2025-10-25</p>
<p><strong>Format Version</strong>: 1.0 (Atomic)</p>
<hr>
<h2>When to Use This Skill</h2>
<p>Activate this skill when:</p>
<ul><li>Setting up automated dependency updates with Dependabot</li><li>Configuring code scanning with CodeQL or third-party tools</li><li>Enabling secret scanning and push protection</li><li>Generating and exporting Software Bill of Materials (SBOM)</li><li>Creating private security advisories</li><li>Writing SECURITY.md policy files</li><li>Responding to security vulnerabilities</li><li>Automating security update workflows</li><li>Implementing vulnerability disclosure processes</li></ul>
<hr>
<h2>Core Concepts</h2>
<h3>Security Layers</h3>
<pre><code>Repository Security Layers:
1. Secret Scanning → Detect leaked credentials
2. Push Protection → Block secret commits
3. Code Scanning → Find vulnerabilities in code
4. Dependabot Alerts → Identify vulnerable dependencies
5. Dependabot Updates → Auto-update dependencies
6. SBOM Export → Track software components
7. Security Advisories → Coordinate vulnerability disclosure</code></pre>
<h3>Dependabot Components</h3>
<p><strong>Dependabot Alerts</strong>:</p>
<ul><li>Automatic vulnerability detection</li><li>Severity levels: Critical, High, Medium, Low</li><li>CVE tracking and GHSA integration</li></ul>
<p><strong>Dependabot Security Updates</strong>:</p>
<ul><li>Automatic PRs for vulnerable dependencies</li><li>Compatibility checks</li><li>Auto-merge capable</li></ul>
<p><strong>Dependabot Version Updates</strong>:</p>
<ul><li>Scheduled dependency updates</li><li>Keep dependencies current</li><li>Reduce technical debt</li></ul>
<h3>Code Scanning Workflow</h3>
<pre><code>Code Push → CodeQL Analysis → Results → Alerts → Review → Fix → Retest
↓ ↓ ↓
Custom Queries Security tab Triage</code></pre>
<hr>
<h2>Patterns</h2>
<h3>Dependabot Configuration</h3>
<p><strong>Basic setup</strong> (.github/dependabot.yml):</p>
<pre><code class="lang-yaml">version: 2
updates:
# Enable version updates for npm
- package-ecosystem: &quot;npm&quot;
directory: &quot;/&quot;
schedule:
interval: &quot;weekly&quot;
day: &quot;monday&quot;
time: &quot;09:00&quot;
timezone: &quot;America/New_York&quot;
open-pull-requests-limit: 5
labels:
- &quot;dependencies&quot;
- &quot;automated&quot;
reviewers:
- &quot;backend-team&quot;
assignees:
- &quot;security-lead&quot;
commit-message:
prefix: &quot;chore&quot;
include: &quot;scope&quot;
# Python dependencies
- package-ecosystem: &quot;pip&quot;
directory: &quot;/&quot;
schedule:
interval: &quot;weekly&quot;
allow:
- dependency-type: &quot;all&quot;
# GitHub Actions
- package-ecosystem: &quot;github-actions&quot;
directory: &quot;/&quot;
schedule:
interval: &quot;monthly&quot;</code></pre>
<p><strong>Advanced configuration</strong>:</p>
<pre><code class="lang-yaml">version: 2
updates:
- package-ecosystem: &quot;npm&quot;
directory: &quot;/&quot;
schedule:
interval: &quot;daily&quot;
# Ignore specific dependencies
ignore:
- dependency-name: &quot;express&quot;
# Ignore major version updates
update-types: [&quot;version-update:semver-major&quot;]
- dependency-name: &quot;lodash&quot;
# Ignore all updates
versions: [&quot;*&quot;]
# Group updates together
groups:
production-dependencies:
applies-to: &quot;version-updates&quot;
dependency-type: &quot;production&quot;
development-dependencies:
applies-to: &quot;version-updates&quot;
dependency-type: &quot;development&quot;
# Custom versioning strategy
versioning-strategy: &quot;increase&quot; # or &quot;widen&quot;, &quot;increase-if-necessary&quot;
# Custom branch prefix
target-branch: &quot;develop&quot;
# Pull request limits
open-pull-requests-limit: 10</code></pre>
<p><strong>Multi-directory support</strong>:</p>
<pre><code class="lang-yaml">version: 2
updates:
# Frontend dependencies
- package-ecosystem: &quot;npm&quot;
directory: &quot;/frontend&quot;
schedule:
interval: &quot;weekly&quot;
# Backend dependencies
- package-ecosystem: &quot;npm&quot;
directory: &quot;/backend&quot;
schedule:
interval: &quot;weekly&quot;
# Infrastructure
- package-ecosystem: &quot;terraform&quot;
directory: &quot;/infrastructure&quot;
schedule:
interval: &quot;monthly&quot;</code></pre>
<h3>Auto-Merge Dependabot PRs</h3>
<p><strong>GitHub Actions workflow</strong> (.github/workflows/dependabot-auto-merge.yml):</p>
<pre><code class="lang-yaml">name: Dependabot Auto-Merge
on: pull_request
permissions:
pull-requests: write
contents: write
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == &#x27;dependabot[bot]&#x27;
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: &quot;${{ secrets.GITHUB_TOKEN }}&quot;
- name: Auto-merge patch and minor updates
if: |
steps.metadata.outputs.update-type == &#x27;version-update:semver-patch&#x27; ||
steps.metadata.outputs.update-type == &#x27;version-update:semver-minor&#x27;
run: gh pr merge --auto --squash &quot;$PR_URL&quot;
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve PR
if: |
steps.metadata.outputs.update-type == &#x27;version-update:semver-patch&#x27; ||
steps.metadata.outputs.update-type == &#x27;version-update:semver-minor&#x27;
run: gh pr review --approve &quot;$PR_URL&quot;
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}</code></pre>
<p><strong>Safer auto-merge</strong> (only security updates):</p>
<pre><code class="lang-yaml">name: Auto-Merge Security Updates
on: pull_request
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == &#x27;dependabot[bot]&#x27;
steps:
- uses: dependabot/fetch-metadata@v1
id: metadata
# Only auto-merge security updates
- name: Auto-merge security updates
if: steps.metadata.outputs.alert-state == &#x27;FIXED&#x27;
run: |
gh pr review --approve &quot;$PR_URL&quot;
gh pr merge --auto --squash &quot;$PR_URL&quot;
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}</code></pre>
<h3>Code Scanning with CodeQL</h3>
<p><strong>Basic setup</strong> (.github/workflows/codeql.yml):</p>
<pre><code class="lang-yaml">name: &quot;CodeQL&quot;
on:
push:
branches: [ &quot;main&quot;, &quot;develop&quot; ]
pull_request:
branches: [ &quot;main&quot; ]
schedule:
- cron: &#x27;0 2 * * 1&#x27; # Weekly on Monday at 2 AM
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ &#x27;javascript&#x27;, &#x27;python&#x27; ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# Optional: custom queries
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: &quot;/language:${{matrix.language}}&quot;</code></pre>
<p><strong>Custom CodeQL queries</strong>:</p>
<pre><code class="lang-yaml"># .github/workflows/codeql.yml
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript
# Use custom query pack
packs: owner/custom-queries
# Or inline queries
queries: |
- uses: security-extended
- uses: ./custom-queries/sql-injection.ql</code></pre>
<p><strong>Custom query example</strong> (custom-queries/sql-injection.ql):</p>
<pre><code class="lang-ql">/**
* @name SQL injection vulnerability
* @description Detects SQL injection vulnerabilities
* @kind path-problem
* @problem.severity error
* @id js/sql-injection
*/
import javascript
from DataFlow::Node source, DataFlow::Node sink
where
source.asExpr() instanceof UserInput and
sink.asExpr() instanceof SqlQuery and
DataFlow::flowPath(source, sink)
select sink, &quot;Potential SQL injection from $@.&quot;, source, &quot;user input&quot;</code></pre>
<h3>Secret Scanning</h3>
<p><strong>Enable secret scanning</strong> (repository settings):</p>
<ol><li>Settings → Code security and analysis</li><li>Enable &quot;Secret scanning&quot;</li><li>Enable &quot;Push protection&quot; (prevents commits with secrets)</li></ol>
<p><strong>Configure custom patterns</strong> (.github/secret_scanning.yml):</p>
<pre><code class="lang-yaml"># Custom secret patterns
patterns:
- name: Internal API Key
regex: &#x27;(?i)api[_-]?key[_-]?([a-z0-9]{32})&#x27;
- name: Database Connection String
regex: &#x27;(?i)(postgres|mysql|mongodb):\/\/[^:]+:[^@]+@[^\/]+&#x27;
- name: Private Key
regex: &#x27;-----BEGIN (RSA|DSA|EC|OPENSSH) PRIVATE KEY-----&#x27;</code></pre>
<p><strong>Handling secret alerts</strong>:</p>
<pre><code class="lang-bash"># View secret scanning alerts
gh api /repos/owner/repo/secret-scanning/alerts
# Close alert (false positive)
gh api /repos/owner/repo/secret-scanning/alerts/1 \
--method PATCH \
--field state=resolved \
--field resolution=false_positive
# Close alert (revoked)
gh api /repos/owner/repo/secret-scanning/alerts/1 \
--method PATCH \
--field state=resolved \
--field resolution=revoked</code></pre>
<p><strong>Response workflow</strong>:</p>
<pre><code>Secret Detected
↓
1. Revoke compromised credential
2. Remove from git history (git filter-repo or BFG)
3. Update secret in secure location (GitHub Secrets)
4. Close alert as &quot;revoked&quot;
5. Review access logs for unauthorized use</code></pre>
<h3>SBOM (Software Bill of Materials)</h3>
<p><strong>Generate SBOM</strong>:</p>
<pre><code class="lang-bash"># Export SBOM for repository
gh api /repos/owner/repo/dependency-graph/sbom \
--header &quot;Accept: application/vnd.github+json&quot; \
&gt; sbom.json
# SBOM includes:
# - Direct dependencies
# - Transitive dependencies
# - License information
# - Vulnerability data</code></pre>
<p><strong>SBOM formats</strong>:</p>
<ul><li><strong>SPDX</strong>: ISO/IEC 5962:2021 standard</li><li><strong>CycloneDX</strong>: OWASP standard for security-focused SBOM</li></ul>
<p><strong>Use cases</strong>:</p>
<ul><li>License compliance auditing</li><li>Supply chain security</li><li>Vulnerability tracking</li><li>Regulatory compliance (NIST, EO 14028)</li></ul>
<p><strong>Automate SBOM generation</strong> (.github/workflows/sbom.yml):</p>
<pre><code class="lang-yaml">name: Generate SBOM
on:
release:
types: [published]
jobs:
sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate SBOM
run: |
gh api /repos/${{ github.repository }}/dependency-graph/sbom \
--header &quot;Accept: application/vnd.github+json&quot; \
&gt; sbom-${{ github.event.release.tag_name }}.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SBOM to release
run: |
gh release upload ${{ github.event.release.tag_name }} \
sbom-${{ github.event.release.tag_name }}.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}</code></pre>
<h3>Security Advisories</h3>
<p><strong>Create private security advisory</strong>:</p>
<pre><code class="lang-bash"># Via web UI:
# Security tab → Advisories → New draft security advisory
# Fill in:
# - Title: Brief description of vulnerability
# - CVE ID: Request CVE if needed
# - Ecosystem: npm, pip, rubygems, etc.
# - Package name: Affected package
# - Affected versions: Version range
# - Patched versions: Fixed versions
# - Severity: Low, Medium, High, Critical
# - CWE: Common Weakness Enumeration
# - Description: Detailed description
# - References: Links to related information</code></pre>
<p><strong>Coordinated disclosure workflow</strong>:</p>
<pre><code>1. Create draft advisory (private)
↓
2. Add collaborators (security researchers, maintainers)
↓
3. Develop fix in temporary private fork
↓
4. Test and verify fix
↓
5. Publish advisory and release fix simultaneously
↓
6. Request CVE assignment
↓
7. Notify users via GitHub, email, social media</code></pre>
<p><strong>Example advisory template</strong>:</p>
<pre><code class="lang-markdown"># SQL Injection in User Authentication
## Impact
Authenticated users can execute arbitrary SQL queries through the login endpoint.
## Patches
Fixed in version 2.1.5. Users should upgrade immediately.
## Workarounds
Disable user login functionality until upgrade is possible.
## References
- Fix: https://github.com/owner/repo/pull/123
- Advisory: GHSA-xxxx-xxxx-xxxx
- CVE: CVE-2025-12345
## Credits
Thanks to @security-researcher for responsible disclosure.</code></pre>
<h3>SECURITY.md Policy</h3>
<p><strong>Security policy file</strong> (SECURITY.md):</p>
<pre><code class="lang-markdown"># Security Policy
## Supported Versions
We currently support the following versions with security updates:
| Version | Supported |
| ------- | ------------------ |
| 2.1.x | :white_check_mark: |
| 2.0.x | :white_check_mark: |
| 1.9.x | :x: |
| &lt; 1.9 | :x: |
## Reporting a Vulnerability
**DO NOT** open a public issue for security vulnerabilities.
Instead, please report security vulnerabilities by:
1. Using GitHub&#x27;s private vulnerability reporting:
- Go to the Security tab
- Click &quot;Report a vulnerability&quot;
- Fill out the advisory form
2. Or email [email protected] with:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
### What to Expect
- **Response time**: Within 48 hours
- **Update frequency**: Weekly until resolved
- **Disclosure timeline**: 90 days or when patched (whichever comes first)
### Security Update Process
1. We acknowledge receipt within 48 hours
2. We investigate and verify the vulnerability
3. We develop and test a fix
4. We release a patch version
5. We publish a security advisory
6. We notify affected users
## Security Best Practices
When using this project:
- Keep dependencies up to date
- Enable Dependabot security updates
- Use environment variables for secrets
- Enable two-factor authentication
- Review security advisories regularly
- Follow least privilege principle
## Bug Bounty Program
We currently do not have a bug bounty program, but we acknowledge and credit all security researchers who responsibly disclose vulnerabilities.
## Hall of Fame
Thanks to these security researchers:
- @researcher1 - SQL injection (2024-03)
- @researcher2 - XSS vulnerability (2024-05)</code></pre>
<hr>
<h2>Quick Reference</h2>
<h3>Dependabot Commands</h3>
<pre><code class="lang-bash"># Trigger Dependabot update
@dependabot rebase # Rebase PR
@dependabot recreate # Recreate PR
@dependabot merge # Merge PR
@dependabot squash and merge # Squash and merge
@dependabot cancel merge # Cancel auto-merge
@dependabot close # Close PR
@dependabot reopen # Reopen PR
@dependabot ignore this dependency # Ignore this dependency
@dependabot ignore this major version # Ignore major version</code></pre>
<h3>Security Severity Levels</h3>
<pre><code>Critical: Immediate action required
- Remote code execution
- SQL injection
- Authentication bypass
High: Address within days
- XSS vulnerabilities
- Privilege escalation
- Data exposure
Medium: Address within weeks
- CSRF vulnerabilities
- Information disclosure
- DoS vulnerabilities
Low: Address when convenient
- Minor information leaks
- Best practice violations</code></pre>
<h3>Security Checklist</h3>
<pre><code>✅ DO: Enable Dependabot alerts and updates
✅ DO: Configure code scanning with CodeQL
✅ DO: Enable secret scanning and push protection
✅ DO: Create SECURITY.md policy
✅ DO: Generate SBOM for releases
✅ DO: Respond to security advisories within 48 hours
✅ DO: Auto-merge security updates (patch/minor)
✅ DO: Require signed commits for production
❌ DON&#x27;T: Commit secrets to repository
❌ DON&#x27;T: Ignore security alerts
❌ DON&#x27;T: Disable security features
❌ DON&#x27;T: Public disclosure before patch available
❌ DON&#x27;T: Use outdated dependencies</code></pre>
<hr>
<h2>Anti-Patterns</h2>
<h3>❌ Ignoring Dependabot Alerts</h3>
<pre><code class="lang-bash"># WRONG: 50 open Dependabot alerts, all ignored
# Some critical vulnerabilities months old</code></pre>
<p><strong>Problems</strong>:</p>
<ul><li>Exposed to known vulnerabilities</li><li>Attackers target known CVEs</li><li>Accumulating technical debt</li><li>Regulatory compliance issues</li></ul>
<pre><code class="lang-bash"># CORRECT: Triage and address alerts
# 1. Review new alerts weekly
# 2. Prioritize by severity (Critical &gt; High &gt; Medium &gt; Low)
# 3. Test and merge security updates
# 4. Dismiss false positives with explanation
# 5. Create issues for complex updates
# Enable auto-merge for patch updates
# Use Dependabot auto-merge workflow</code></pre>
<h3>❌ Committing Secrets</h3>
<pre><code class="lang-bash"># WRONG: Hardcoded credentials in code
API_KEY = &quot;sk-abc123xyz&quot;
DATABASE_URL = &quot;postgresql://user:password@host/db&quot;
# Or in config files
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</code></pre>
<p><strong>Problems</strong>:</p>
<ul><li>Credentials exposed in git history</li><li>Cannot easily rotate secrets</li><li>Security breach if repository is public</li><li>Compliance violations</li></ul>
<pre><code class="lang-bash"># CORRECT: Use environment variables and secrets
# 1. Store secrets in GitHub Secrets
# Settings → Secrets and variables → Actions → New repository secret
# 2. Reference in workflows
env:
API_KEY: ${{ secrets.API_KEY }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
# 3. Use environment variables in code
import os
API_KEY = os.environ.get(&quot;API_KEY&quot;)
# 4. Enable push protection
# Settings → Code security → Push protection</code></pre>
<h3>❌ No Code Scanning</h3>
<pre><code class="lang-bash"># WRONG: No automated security analysis
# Vulnerabilities only found in production
# No visibility into code quality issues</code></pre>
<p><strong>Problems</strong>:</p>
<ul><li>Security vulnerabilities reach production</li><li>No early warning system</li><li>Higher remediation costs</li><li>Potential data breaches</li></ul>
<pre><code class="lang-yaml"># CORRECT: Enable CodeQL scanning
# .github/workflows/codeql.yml
name: &quot;CodeQL&quot;
on:
push:
branches: [ &quot;main&quot; ]
pull_request:
branches: [ &quot;main&quot; ]
schedule:
- cron: &#x27;0 2 * * 1&#x27; # Weekly
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v2
with:
languages: javascript, python
queries: security-and-quality
- uses: github/codeql-action/autobuild@v2
- uses: github/codeql-action/analyze@v2</code></pre>
<h3>❌ No Security Policy</h3>
<pre><code class="lang-bash"># WRONG: No SECURITY.md file
# Users don&#x27;t know how to report vulnerabilities
# Public issues created for security bugs</code></pre>
<p><strong>Problems</strong>:</p>
<ul><li>Security issues disclosed publicly</li><li>No coordinated disclosure process</li><li>Vulnerabilities exploited before fix</li><li>Damages reputation</li></ul>
<pre><code class="lang-markdown"># CORRECT: Create SECURITY.md
# Located at repository root or .github/SECURITY.md
# Security Policy
## Reporting a Vulnerability
Please report security vulnerabilities privately:
- GitHub Security Advisories (preferred)
- Email: [email protected]
**DO NOT** open public issues for security vulnerabilities.
## Response Timeline
- Acknowledgment: Within 48 hours
- Status updates: Weekly
- Disclosure: 90 days or when patched
## Supported Versions
| Version | Supported |
|---------|-----------|
| 2.x | ✓ |
| 1.x | ✗ |</code></pre>
<h3>❌ Manual Dependency Updates</h3>
<pre><code class="lang-bash"># WRONG: Manually updating dependencies
# Updates happen sporadically
# Security patches delayed
# High maintenance burden</code></pre>
<p><strong>Problems</strong>:</p>
<ul><li>Slow response to vulnerabilities</li><li>Inconsistent update cadence</li><li>Human error (missed updates)</li><li>Wastes developer time</li></ul>
<pre><code class="lang-yaml"># CORRECT: Automate with Dependabot
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: &quot;npm&quot;
directory: &quot;/&quot;
schedule:
interval: &quot;weekly&quot;
open-pull-requests-limit: 5
groups:
security-updates:
applies-to: &quot;security-updates&quot;</code></pre>
<hr>
<h2>Related Skills</h2>
<ul><li><code>collaboration/github/github-actions-workflows.md</code> - Automating security workflows</li><li><code>collaboration/github/github-repository-management.md</code> - Repository security settings</li><li><code>cicd/ci-security.md</code> - Secret management in CI/CD</li><li><code>security/vulnerability-management.md</code> - Vulnerability response processes</li><li><code>security/secure-coding-practices.md</code> - Preventing security issues in code</li></ul>
<hr>
<p><strong>Last Updated</strong>: 2025-10-25</p>
<p><strong>Format Version</strong>: 1.0 (Atomic)</p>
<footer>
<div class="fmap">
<div><b>Build</b>
<a href="https://hanzo.app">hanzo.app</a> app builder
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
<div><b>Run</b>
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
<div><b>Account</b>
<a href="https://hanzo.id">hanzo.id</a> sign in
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
<div><b>Company</b>
<a href="https://hanzo.ai">hanzo.ai</a> canonical
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
</div>
<div class="fend"><a href="/collaboration-github-security-features.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
</footer>
</div></body></html>