GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — keyhog/site/ci.html at main · TeamCadenceAI/keyhog

Expand file tree

/

ci.html

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
267 lines (234 loc) · 10.5 KB
/

ci.html

Copy path

File metadata and controls

267 lines (234 loc) · 10.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CI / SARIF · keyhog</title>
<meta name="description" content="GitHub Actions, GitLab, CircleCI, Drone, BuildKite, Jenkins recipes. SARIF flows automatically.">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="site">
<a href="index.html" class="brand">
<span class="mark">k</span>
keyhog
<span class="v">v0.5.37</span>
</a>
<nav class="top">
<a href="detectors.html">Detectors</a>
<a href="ci.html">CI</a>
<a href="api.html">API</a>
<a href="https://github.com/santhsecurity/keyhog" class="gh">GitHub →</a>
</nav>
</header>
<div class="layout">
<aside class="sidebar">
<h4>Getting started</h4>
<ul>
<li><a href="index.html">Introduction</a></li>
<li><a href="install.html">Installation</a></li>
<li><a href="quickstart.html">Quickstart</a></li>
</ul>
<h4>Scanning</h4>
<ul>
<li><a href="scan.html">Scan command</a></li>
<li><a href="output.html">Output formats</a></li>
<li><a href="baseline.html">Baselines</a></li>
<li><a href="ignore.html">Allowlists</a></li>
</ul>
<h4>Integrations</h4>
<ul>
<li><a href="ci.html">CI / SARIF</a></li>
<li><a href="hooks.html">Pre-commit hooks</a></li>
<li><a href="daemon.html">Daemon mode</a></li>
<li><a href="system.html">System triage</a></li>
</ul>
<h4>Reference</h4>
<ul>
<li><a href="detectors.html">Detector catalog</a></li>
<li><a href="config.html">Configuration</a></li>
<li><a href="api.html">Library API</a></li>
</ul>
<h4>Internals</h4>
<ul>
<li><a href="architecture.html">Architecture</a></li>
<li><a href="performance.html">Performance</a></li>
<li><a href="lockdown.html">Lockdown mode</a></li>
<li><a href="faq.html">FAQ</a></li>
</ul>
</aside>
<main class="content">
<article>
<h1>CI / SARIF</h1>
<p class="lede">
One-line GitHub Actions integration. Native SARIF for GitHub Advanced
Security. Drop-in YAML for every major CI. Auto-built binaries with
source fallback.
</p>
<h2>GitHub Actions</h2>
<pre><code><span class="k">name</span>: secrets
<span class="k">on</span>: [pull_request, push]
<span class="k">jobs</span>:
<span class="k">keyhog</span>:
<span class="k">runs-on</span>: ubuntu-latest
<span class="k">permissions</span>:
<span class="k">contents</span>: read
<span class="k">security-events</span>: write <span class="c"># for SARIF upload</span>
<span class="k">steps</span>:
- <span class="k">uses</span>: actions/checkout@v4
<span class="k">with</span>:
<span class="k">fetch-depth</span>: 0 <span class="c"># needed for --git-history</span>
- <span class="k">uses</span>: santhsecurity/keyhog/.github/actions/[email protected]
<span class="k">with</span>:
<span class="k">path</span>: .
<span class="k">severity</span>: high <span class="c"># info | low | medium | high | critical</span>
<span class="k">format</span>: sarif <span class="c"># text | json | jsonl | sarif</span>
<span class="k">verify</span>: <span class="s">'false'</span> <span class="c"># live-verify findings against vendor APIs</span></code></pre>
<p>The action auto-downloads a prebuilt linux-x86_64 / macos-aarch64 binary
attached to the matching release tag and falls back to a
<code>cargo build</code> when no asset matches the host triple (Windows
runners, untagged refs). SARIF is auto-uploaded to GitHub code scanning
when <code>format: sarif</code>.</p>
<h3>Block PRs on new findings only</h3>
<pre><code> - <span class="k">uses</span>: santhsecurity/keyhog/.github/actions/[email protected]
<span class="k">with</span>:
<span class="k">path</span>: .
<span class="k">baseline</span>: .keyhog-baseline.json
<span class="k">severity</span>: high
<span class="k">format</span>: sarif</code></pre>
<p>The baseline file lives in the repo; the action exits 1 only when new
findings (not in the baseline) fire. See <a href="baseline.html">Baselines →</a>.</p>
<h3>Scan a Docker image after build</h3>
<pre><code> - <span class="k">name</span>: build image
<span class="k">run</span>: docker build -t app:${{ github.sha }} .
- <span class="k">uses</span>: santhsecurity/keyhog/.github/actions/[email protected]
<span class="k">with</span>:
<span class="k">image</span>: app:${{ github.sha }}
<span class="k">format</span>: sarif</code></pre>
<h2>GitLab CI</h2>
<pre><code><span class="k">keyhog</span>:
<span class="k">image</span>: rust:1.89-slim
<span class="k">stage</span>: test
<span class="k">before_script</span>:
- apt-get update &amp;&amp; apt-get install -y --no-install-recommends ca-certificates curl
- curl -L https://github.com/santhsecurity/keyhog/releases/latest/download/keyhog-linux-x86_64 -o keyhog && chmod +x keyhog
- install keyhog /usr/local/bin/
<span class="k">script</span>:
- keyhog scan . --format sarif -o keyhog.sarif --severity high
<span class="k">artifacts</span>:
<span class="k">reports</span>:
<span class="k">sast</span>: keyhog.sarif
<span class="k">when</span>: always
<span class="k">paths</span>: [keyhog.sarif]</code></pre>
<p>SARIF lands in GitLab's Security Dashboard via the
<code>artifacts.reports.sast</code> contract.</p>
<h2>CircleCI</h2>
<pre><code><span class="k">version</span>: 2.1
<span class="k">jobs</span>:
<span class="k">keyhog</span>:
<span class="k">docker</span>: [{ <span class="k">image</span>: cimg/rust:1.89 }]
<span class="k">steps</span>:
- checkout
- <span class="k">run</span>:
<span class="k">name</span>: install keyhog
<span class="k">command</span>: curl -fsSL https://raw.githubusercontent.com/santhsecurity/keyhog/main/install.sh | sh
- <span class="k">run</span>:
<span class="k">name</span>: scan
<span class="k">command</span>: keyhog scan . --format sarif -o keyhog.sarif --severity high
- <span class="k">store_artifacts</span>:
<span class="k">path</span>: keyhog.sarif</code></pre>
<h2>Jenkins (declarative)</h2>
<pre><code>pipeline {
agent any
stages {
stage('keyhog') {
steps {
sh '''
curl -L https://github.com/santhsecurity/keyhog/releases/latest/download/keyhog-linux-x86_64 -o keyhog && chmod +x keyhog
./keyhog scan . --format sarif -o keyhog.sarif --severity high
'''
recordIssues tools: [sarif(pattern: 'keyhog.sarif')]
}
}
}
}</code></pre>
<h2>BuildKite</h2>
<pre><code><span class="k">steps</span>:
- <span class="k">label</span>: <span class="s">"🔑 keyhog"</span>
<span class="k">command</span>: |
curl -fsSL https://raw.githubusercontent.com/santhsecurity/keyhog/main/install.sh | sh
keyhog scan . --format sarif -o keyhog.sarif --severity high
<span class="k">artifact_paths</span>: keyhog.sarif</code></pre>
<h2>Drone</h2>
<pre><code><span class="k">kind</span>: pipeline
<span class="k">name</span>: default
<span class="k">steps</span>:
- <span class="k">name</span>: keyhog
<span class="k">image</span>: rust:1.89
<span class="k">commands</span>:
- curl -fsSL https://raw.githubusercontent.com/santhsecurity/keyhog/main/install.sh | sh
- keyhog scan . --format sarif -o keyhog.sarif --severity high</code></pre>
<h2>Why SARIF is the right CI format</h2>
<ul>
<li>One schema → drops into GitHub Advanced Security, GitLab Security
Dashboard, Azure DevOps SARIF viewer, and any IDE SARIF plugin.</li>
<li>Per-result <code>partialFingerprints.primaryLocationLineHash</code>
means GitHub correctly dedupes findings across PRs (same secret, same
line, even if the line moves).</li>
<li>CWE-798 + OWASP A07:2021 taxa on every result, so dashboards can
group / filter by industry-standard taxonomy without per-tool
configuration.</li>
<li>Native severity → SARIF <code>level</code> mapping
(critical/high → <code>error</code>, medium → <code>warning</code>,
low/info → <code>note</code>) so PR review surfaces look right.</li>
</ul>
<h2>Optional: live verification in CI</h2>
<pre><code> - <span class="k">uses</span>: santhsecurity/keyhog/.github/actions/[email protected]
<span class="k">with</span>:
<span class="k">path</span>: .
<span class="k">verify</span>: <span class="s">'true'</span>
<span class="k">severity</span>: high <span class="c"># only verify high+critical to limit API calls</span>
<span class="k">env</span>:
<span class="c"># Provide read-only creds for the services you want verified.</span>
<span class="c"># keyhog never uses these creds for anything but verification.</span>
GITHUB_VERIFY_TOKEN: ${{ secrets.KEYHOG_GITHUB_READ_TOKEN }}</code></pre>
<div class="callout warn">
<strong>Verification sends credentials over the network.</strong> Only
enable it on PRs from trusted authors. The default GitHub Action sets
<code>verify: 'false'</code>; that is the right default for forked-PR
workflows.
</div>
<h2>Speed in CI</h2>
<p>Two flags pull most of the CI time out:</p>
<ul>
<li><code>--incremental</code> persists a BLAKE3 Merkle index;
unchanged files skip the scanner entirely on subsequent runs.
10–100× speedup on PRs that touch a few files.</li>
<li><code>--git-diff $BASE_REF</code> scans only changed files vs the
PR base, instead of the whole tree.</li>
</ul>
<pre><code> - <span class="k">uses</span>: santhsecurity/keyhog/.github/actions/[email protected]
<span class="k">with</span>:
<span class="k">git-diff</span>: ${{ github.event.pull_request.base.sha }}
<span class="k">incremental</span>: <span class="s">'true'</span></code></pre>
<p>Cache the incremental DB across runs with
<a href="https://github.com/actions/cache">actions/cache</a> keyed on
<code>~/.cache/keyhog/merkle.idx</code>.</p>
</article>
</main>
</div>
<footer class="site">
<div class="left">
<strong>keyhog</strong> · secret scanner by
<a href="https://github.com/santhsecurity">santhsecurity</a>. MIT licensed.
</div>
<div class="right">
<a href="https://github.com/santhsecurity/keyhog">GitHub</a>
<a href="https://crates.io/crates/keyhog">crates.io</a>
<a href="https://github.com/santhsecurity/keyhog/issues">Issues</a>
<a href="https://github.com/santhsecurity/keyhog/blob/main/CHANGELOG.md">Changelog</a>
</div>
</footer>
<script src="js/nav.js" defer></script>
</body>
</html>
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.