Skip to content

Commit 5217b28

Browse files
committed
Release v1.1.0: README archive docs and rule table, CHANGELOG
1 parent 384697c commit 5217b28

2 files changed

Lines changed: 108 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
3+
## v1.1.0
4+
5+
Driven by a real find: a malicious repository whose payload (a
6+
launcher script, a bundled executable, and a disguised script file)
7+
sat inside a zip that v1.0 skipped as an opaque binary.
8+
9+
- Zip archive inspection in worktree mode. Text entries are scanned
10+
with the normal rule engine and reported as
11+
`archive.zip!/entry-name`. A structural warning (ARCHIVE-EXEC)
12+
fires when an archive pairs an executable with a launcher or
13+
script file, or with a large single-line text file. Corrupt or
14+
encrypted archives are reported as uninspectable
15+
(ARCHIVE-UNREADABLE) instead of failing the scan. Caps: 512
16+
entries, the `--max-size` cap per entry, 16 times that per
17+
archive. One level deep; only ZIP is inspected.
18+
- New pattern rules (99 total, up from 94):
19+
- SS095 auth.gg application secret or API key near an auth.gg
20+
reference.
21+
- SS096 Ethereum address and SS097 Bitcoin address, Low severity
22+
and informational, so a hardcoded payout address is classified
23+
instead of surfacing only as entropy noise.
24+
- SS098 private-key persistence: code that writes private key
25+
material, a seed phrase or a mnemonic to a file (same-line
26+
heuristic).
27+
- SS099 download links to archives on file-hosting services
28+
frequently abused for malware lures, including
29+
password-protected archive campaigns.
30+
- One new dependency: the `zip` crate, with only the deflate
31+
feature enabled.
32+
- 177 tests (up from 152).
33+
34+
What v1.1 still cannot do: judge the intent of an encrypted
35+
payload whose strings decrypt only at runtime, inspect encrypted
36+
archives, open archives nested inside other archives, or inspect
37+
non-ZIP archive formats.
38+
39+
## v1.0.0
40+
41+
- Initial release: 94 pattern rules, Shannon entropy heuristic,
42+
worktree and git history scanning, baselines, allowlists, and
43+
text, JSON and SARIF reports. 152 tests.

‎README.md‎

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ characters of a value, plus a hash fingerprint.
2121

2222
## What it does
2323

24-
- **94 pattern rules** for known providers and formats (AWS, GitHub,
24+
- **99 pattern rules** for known providers and formats (AWS, GitHub,
2525
Stripe, OpenAI, database connection strings, private key blocks, and
2626
many more), each with a severity and a plain-language description.
27+
- **Zip archive inspection**: archives are opened, not skipped as
28+
opaque binaries. Text entries are scanned with the normal rules
29+
(findings point at `archive.zip!/entry-name`), and an archive that
30+
pairs an executable with a launcher or script file raises a
31+
dedicated warning. That pairing is how a real malware lure hid its
32+
payload from the v1.0 scanner.
2733
- **Entropy detection**: a second, heuristic engine that measures the
2834
Shannon entropy of candidate strings (quoted literals and assignment
2935
values) and flags likely random secrets that no pattern knows about.
@@ -46,7 +52,7 @@ and, for history mode, the `git` CLI.
4652
Install from source:
4753

4854
```console
49-
cargo install --git https://github.com/RahilSahu/secretsweep --tag v1.0.0
55+
cargo install --git https://github.com/RahilSahu/secretsweep --tag v1.1.0
5056
```
5157

5258
Or build a checkout:
@@ -86,6 +92,9 @@ Worktree mode respects `.gitignore`, skips `.git`, `node_modules`,
8692
`vendor`, `target` and similar generated directories, skips binary files
8793
and files over 1 MiB (configurable with `--max-size`, in KiB), and scans
8894
everything else as text, including lockfiles and dotfiles such as `.env`.
95+
Zip archives are the one binary-looking exception: they are opened and
96+
inspected as described below, because an opaque archive is exactly
97+
where a payload can hide from a line-based scanner.
8998

9099
Git history mode shells out to `git log -p` and scans the lines each
91100
commit added. It needs `git` on the PATH. Merge commits produce no diff
@@ -94,7 +103,7 @@ a merge are found in the branch commits that introduced them.
94103

95104
### Rules
96105

97-
The registry holds 94 pattern rules. Run `secretsweep --list-rules` for
106+
The registry holds 99 pattern rules. Run `secretsweep --list-rules` for
98107
the full table. Summary by area:
99108

100109
| Area | Rules |
@@ -108,12 +117,51 @@ the full table. Summary by area:
108117
| Database connection strings | 7 |
109118
| Private key blocks | 7 |
110119
| Tokens, headers and generic assignments | 9 |
111-
| Other platforms (Shopify, Heroku, Cloudflare, Vault, Grafana, and more) | 17 |
112-
| **Total** | **94** |
120+
| Other platforms (Shopify, Heroku, Cloudflare, Vault, Grafana, auth.gg, and more) | 18 |
121+
| Cryptocurrency addresses (informational, Low severity) | 2 |
122+
| Malware indicators (private-key persistence, file-host lure links) | 2 |
123+
| **Total** | **99** |
113124

114125
Rules are line-based regular expressions (the Rust `regex` engine, so no
115126
lookahead). Each rule reports the line and column of the secret value.
116127

128+
### Archive inspection
129+
130+
Zip archives (detected by `.zip` extension or by their PK header) are
131+
opened instead of skipped. This exists because a real malware lure
132+
found in the wild hid everything that mattered inside a zip: a
133+
launcher script, a bundled executable, and a script payload disguised
134+
as a text file. A scanner that treats archives as opaque binaries
135+
sees none of that.
136+
137+
What happens inside an archive:
138+
139+
- Text-like entries are scanned with the same pattern and entropy
140+
rules as loose files. Findings are reported with paths like
141+
`bundle.zip!/inner/config.txt`, so the entry can be located.
142+
- A structural warning (rule id `ARCHIVE-EXEC`) fires when an archive
143+
contains an executable file (`.exe`, `.dll`, `.scr`, `.com`,
144+
`.msi`, `.sys`) together with a launcher or script file (`.cmd`,
145+
`.bat`, `.ps1`, `.vbs`, `.js` and relatives), or with a large
146+
single-line text file of 50 KB or more, a common disguised-script
147+
shape. Archives of documents or source code, with no executable
148+
inside, do not trigger it.
149+
- An archive that cannot be opened, or whose entries cannot be read
150+
(corrupt, encrypted, or an unsupported compression method), is
151+
reported once as uninspectable (rule id `ARCHIVE-UNREADABLE`, Low
152+
severity) instead of failing the scan.
153+
154+
Safety caps, so a hostile or accidental zip bomb cannot exhaust
155+
memory: at most 512 entries are examined, at most the `--max-size`
156+
cap (1 MiB by default) is extracted per entry, and at most 16 times
157+
that across one archive. Entries are read in memory only; nothing is
158+
written to disk and nothing is executed.
159+
160+
Inspection is one level deep: a zip stored inside another zip is
161+
listed but not opened, and only the ZIP format is inspected. Other
162+
archive formats (`.tar`, `.7z`, `.rar`, and similar) are still
163+
skipped as binary files for now.
164+
117165
### Entropy detection, honestly
118166

119167
Pattern rules only catch secrets that look like something known. The
@@ -182,7 +230,7 @@ jobs:
182230
fetch-depth: 0 # full history if you also scan with --git
183231
- uses: dtolnay/rust-toolchain@stable
184232
- name: Install SecretSweep
185-
run: cargo install --git https://github.com/RahilSahu/secretsweep --tag v1.0.0
233+
run: cargo install --git https://github.com/RahilSahu/secretsweep --tag v1.1.0
186234
- name: Scan worktree
187235
run: secretsweep --format sarif --fail-on high . > secretsweep.sarif
188236
- name: Upload SARIF
@@ -202,7 +250,7 @@ Framework setup:
202250
```yaml
203251
# .pre-commit-config.yaml in your project
204252
- repo: https://github.com/RahilSahu/secretsweep
205-
rev: v1.0.0
253+
rev: v1.1.0
206254
hooks:
207255
- id: secretsweep
208256
```
@@ -224,9 +272,17 @@ the fail-on severity exists.
224272

225273
- Line-based scanning: a secret split across two lines is not detected.
226274
- Worktree mode skips binary files and files over the size cap; both are
227-
counted in the summary line.
275+
counted in the summary line. Zip archives are inspected instead of
276+
skipped, within the caps described above.
277+
- Archive inspection covers ZIP only, one level deep. Encrypted
278+
archives and encrypted entries cannot be read and are reported as
279+
uninspectable; their contents are not scanned, and no scanner can
280+
judge the intent of a payload whose strings only decrypt at
281+
runtime.
228282
- Git history mode does not cover merge commits (see above) and needs
229-
the `git` CLI installed.
283+
the `git` CLI installed. Archives committed to history are not
284+
opened in this mode; history mode scans the text lines each commit
285+
added.
230286
- In git history mode, file paths that git quotes (paths with unusual
231287
characters) may be displayed with their quotes.
232288

0 commit comments

Comments
 (0)