I ran my CBOM scanner against a public benchmark. It scored 14%. Here is how I got it to 56.5%.

2026-11-28来源 dev.toEnglish

Every security scanner claims it "finds cryptography." But what happens when you test it against a denominator someone else owns?

I maintain cbom-tools, a zero-dependency CycloneDX CBOM scanner. Recently, I wrote a 50-line adapter to ShorList — an open catalogue of 2,099 concrete ways cryptography appears in real code. It has 1,429 positive forms and 172 decoy rows (code that mentions crypto but doesn't use it, where the scanner must stay completely silent).

I ran the whole catalogue. The first result was brutal.

The Baseline: 203 / 1,429 (14.2%)
Out of 1,429 positive forms, it only caught 203 (14.2%). But the false positives hurt more: it flagged 16 out of 172 decoys as real uses.

Why? Because my scanner was basically doing string matching:

If an API string literally said "AES/GCM/NoPadding", it was found.

But the moment the algorithm degraded into a registry ID (TLS_AES_256_GCM_SHA384), a curve name (secp384r1), or a CLI flag, the score dropped to zero. Four whole families (DH, EC, EdDSA, LMS/XMSS) were completely invisible.

And the false alarms? Code that said logging.warning("refused sha1") was reported as using SHA-1. Comments, deny-lists (BLOCKED_CIPHERS), and disabled switches ({"Ed448": False}) were all being reported as active crypto. "Mentioned" was being treated as "used" — which is the difference between a dumb inventory and a compliance claim.

The Fix: Parse structure, and know when to shut up
I rewrote the engine based on two rules:

1.Decompose registered identifiers. A TLS suite is not one algorithm, it's a combination. TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 becomes ECDH + RSA + AES. A group like ffdhe2048 becomes DH with a size of 2048.

2.Is this actually a use? Since CycloneDX has no "not-a-use" marker, suppression must equal omission. If the name is inside a log string, a comment, a deny-list, or a JSON policy with "Effect": "Deny", the scanner now skips it entirely. (But hashlib.md5(data, usedforsecurity=False) is still caught — because the algorithm is the key there).

The Result: 807 / 1,429 (56.5%), 0 decoys
After the rewrite, I ran the full 2,099 rows again. Same adapter, same decoys:

Positive forms recognised: 203 → 807 (56.5%)

Decoys flagged: 16 → 0

Key sizes extracted: 0/53 → 119/208

What still sucks (and what I'm doing next)
I'm not here to claim a perfect score. The scanner still cannot open .conf / .sh / .tf files (CLI remains 0/115). It has no CWE mapping for the defect axis (0/162).

But this is the whole point of open-source measurement. I published the adapter and raw results as a PR to the ShorList repo. It's still open, not merged. If the maintainer looks at it and tells me my adapter is wrong, I'd rather fix the adapter than leave a wrong number in the record.

If you want to see the raw JSON and the fingerprints, the PR is here: shorlist/shorlist#4

Three things I learned the hard way:

1.Publish your denominator.

2.Build the negative control first.

3.A low number you can defend beats a high one you cannot.

原文:https://www.a8q9.cn/en/article/i-ran-my-cbom-scanner-against-a-public-benchmark-it-scored-14-here-is-how-i-got--52d46e.html

相关文章