↓ Skip to main content
Python

What broke when I scanned a repo

Getting ready for quantum computers - This article is part of a series.
Part 5: This Article
I expected one command and one report. I got a TLS error, a 401, a “filename too long”, test files that wouldn’t stay excluded, and an empty file, before the first useful CBOM. Then the CBOM found one algorithm out of fourteen.
Left: five problems before the first CBOM: JVM TLS trust (fix: Windows trust store), GitHub Packages 401 (fix: build three repos from source), filename too long (fix: core.longpaths), tests not excluded on Windows (fix: run on Linux), empty module CBOM (fix: use cbom.json). Right: results on PyJWT 2.15.1. Documented algorithms: 14. Source scan found: 1 (RSA). File scan found: 34 items, mostly test keys and docs. Default policy: RSA quantum-vulnerable, ECDSA and Ed25519 keys no verdict.
Five problems, then three surprises

Part 4 explained what a CBOM is and how to read one. This part generates real ones from an existing open-source repository, with the problems written down as they happened. All versions and numbers are from 4 December 2026.

The repository: PyJWT
#

I picked PyJWT (version 2.15.1, commit 0d231bf):

  • It is widely used and small (12 Python files in the library itself).
  • All its asymmetric crypto goes through pyca/cryptography, which CBOMkit says it covers “100%”.
  • Its documentation lists exactly which algorithms it supports, so I know the right answer: 14 entries, HS256/384/512 (HMAC), RS256/384/512 (RSA PKCS#1 v1.5), PS256/384/512 (RSA-PSS), ES256, ES256K, ES384 and ES512 (ECDSA), and EdDSA (Ed25519 and Ed448).

Eleven of those fourteen are public-key signatures, every one quantum-vulnerable.

Three ways to run CBOMkit
#

WayWhat it needsWhat I did
CBOMkit service (web UI, API, database)Docker or Podman, make productionNot available on this machine
cbomkit-action v2.3.0GitHub Actions, or Java 21 to run the jar yourselfBuilt the jar and ran it locally
cbomkit-theia v1.1.2Go to build; Docker only for image scansBuilt it and scanned the checkout as a directory

The action is a Docker container on GitHub, but inside it is one Java program that reads a few GITHUB_* environment variables. Running that jar myself is where the problems started.

Where it got hard
#

1. Maven couldn’t reach Maven Central: PKIX path building failed
#

What. The first mvn package stopped with unable to find valid certification path to requested target.

Why. Java doesn’t use the operating system’s certificate list; it ships its own trust store. Later the same week I found out why that mattered on this machine: its antivirus inspects every HTTPS connection and re-signs the server’s certificate with its own root, which it added to Windows’ list but not to Java’s. To Java, Maven Central looked like an impostor, so every download failed.

Fix. Tell the JVM to use the Windows store for the build:

export MAVEN_OPTS="-Djavax.net.ssl.trustStoreType=Windows-ROOT"

Know what that does: Java now trusts whatever Windows trusts, the antivirus’s root included. On a clean machine or a CI runner you don’t need it.

2. 401 Unauthorized from GitHub Packages
#

What. Could not transfer artifact org.pqca:cbomkit-lib:pom:1.3.0 ... status code: 401.

Why. cbomkit-action depends on cbomkit-lib, which depends on sonar-cryptography-plugin, and both are published only to GitHub Packages. GitHub’s Maven registry docs say “you need an access token to publish, install, and delete private, internal, and public packages”; my gh token didn’t have the read:packages scope.

Fix. Either add that scope to a token in ~/.m2/settings.xml, or build the chain from source, bottom up. I built it. Note the tag names don’t follow one pattern (1.7.0, v1.3.0, v2.3.0):

git -c core.longpaths=true clone --depth 1 --branch 1.7.0  https://github.com/cbomkit/sonar-cryptography
git clone --depth 1 --branch v1.3.0 https://github.com/cbomkit/cbomkit-lib
git clone --depth 1 --branch v2.3.0 https://github.com/cbomkit/cbomkit-action

for d in sonar-cryptography cbomkit-lib; do
  (cd "$d" && mvn -B -q -DskipTests -Dspotless.check.skip=true install)
done
(cd cbomkit-action && mvn -B -q -DskipTests -Dspotless.check.skip=true package)
# -> cbomkit-action/target/CBOMkit-action.jar (about 69 MB), needs Java 21

3. A compile error that was really a clone error
#

What. cannot find symbol: class JcaAlgorithmParameterGeneratorGetInstance.

Why. On Windows, git clone printed Filename too long for a few deeply nested files, skipped them, and finished anyway. My script only showed the last line of git’s output, so I missed it, and the build failed later.

Fix. git -c core.longpaths=true clone ... (already in the block above). Lesson: when a well-tested project doesn’t compile, check the checkout first (git status showed the missing files).

4. Test files scanned on Windows, excluded on Linux
#

What. The same scan of PyJWT read 26 files and gave 16 findings on Windows, and 13 files and 8 findings on Linux. The extra ones were all in tests/.

Why. The Python indexer’s default exclude list is regular expressions such as tests/ and /test_*\.py$. It matches them against the file’s relative path, which on Windows is written with backslashes (tests\test_algorithms.py), so nothing matched.

Fix. Run it on Linux, which is what the GitHub Action does anyway. I used WSL with a Temurin 21 JDK:

export GITHUB_WORKSPACE=$PWD/pyjwt GITHUB_OUTPUT=$PWD/gh_output \
       CBOMKIT_OUTPUT_DIR=$PWD/cbom CBOMKIT_LANGUAGES=python
: > gh_output
java -jar CBOMkit-action.jar
# Found project module '' [13 .py files]
# Scanned 13 files with 3419 lines in 2.52 seconds.
# Wrote cbom .../cbom/cbom.json with 8 findings

5. An empty per-module CBOM
#

What. On my test project the log said cbom_app.json with 0 findings, then cbom.json with 17 findings.

Why. I didn’t find out. The action writes one CBOM per module and one consolidated file, and in my run only the consolidated one had content.

Fix. Use cbom.json, and check a CBOM’s component count before believing “nothing found”.

Result 1: the source scan found one algorithm out of fourteen
#

The consolidated CBOM had five components: one algorithm, RSA (OID 1.2.840.113549.1.1.1), and four RSA keys, all in jwt/algorithms.py at lines 641 to 675. No ECDSA, no RSA-PSS, no EdDSA, no HMAC, no SHA-2.

The reason is in how PyJWT is written, which is also how most libraries are written:

def sign(self, msg: bytes, key: RSAPrivateKey) -> bytes:
    signature: bytes = key.sign(msg, padding.PKCS1v15(), self.hash_alg())
    return signature

The key arrives as a parameter, from the application. The hash is a class attribute picked when the algorithm object is created. The scanner follows cryptographic objects from where they are created (a generate_private_key or RSAPublicNumbers(...) call), which is why the only findings were the lines that build RSA keys from JWK numbers. HMAC goes through Python’s standard hmac module, which isn’t one of the covered libraries.

My ground-truth file from part 4, where every algorithm is created and used in the same function, scored seven out of seven. So the scanner works; it sees direct use. A library that hands algorithm choice to its caller is close to invisible to it, and the real answer (“which algorithm does my service sign tokens with?”) lives in the application that calls jwt.encode(..., algorithm="ES256").

Result 2: the file scan found keys, mostly ones that don’t matter
#

cbomkit-theia dir pyjwt took about a second and returned 34 components:

WhereWhat theia foundMatters?
tests/keys/RSA, ECDSA and Ed25519 private keys; an RSA certificate valid 2015 to 2018Test fixtures
docs/usage.rst, README.rst, CHANGELOG.rst5 private keys and 5 JWTs in examplesDocumentation
tests/*.py6 “generic-api-key” hits, 2 private keys, 2 JWTsTest data
jwt/algorithms.py3 “generic-api-key” hits (a type alias, a def sign( line, a base64 decode)False positives

theia uses gitleaks for secrets, so it reports anything that looks like a key. For a CBOM, the fix is an ignore file in the scanned directory:

# .cbomkitignore
tests/
docs/
*.rst

Two smaller things: theia’s locations are relative to the scanned directory, while the source scanner wrote absolute paths from my machine (scrub those before sharing a CBOM); and theia built from the v1.1.2 tag still reports its version as edge in the CBOM metadata.

Result 3: the policy graded RSA and ignored the rest
#

CBOMkit’s built-in check is a Rego policy, quantum_safe.rego. I ran it with OPA v1.23.0:

opa eval -d quantum_safe.rego -i cbom.json -f pretty 'data.policies.quantum_safe.findings'
CBOMquantum-vulnerableNANo verdict
Source scanRSA4 keys
File scanRSA, SHA256-RSA, RSASHA256ECDSA key, 2 Ed25519 keys, 27 others

The policy only grades components whose assetType is algorithm. An ECDSA or Ed25519 key found in a file gets no finding at all. A CBOM with just those three keys returns an empty list, and the CBOMkit README says what an empty list means: “if no quantum-vulnerable components are found, or if no rule matches … the CBOM is assumed to be quantum-safe”. Three quantum-vulnerable keys, reported as quantum-safe. The README calls this policy “a proof of concept”, and it is right to; the next post adds a rule for keys.

What I learned
#

  1. Build problems are not the tool’s verdict. Four of the five problems were my environment (Windows, an antivirus between Java and the internet, a token scope). Run CBOMkit where its authors do: Linux, ideally the GitHub Action.
  2. Know the right answer before you scan. PyJWT’s docs list 14 algorithms; without that I’d have accepted “RSA” as the whole story.
  3. Source scanning sees direct use only. Scan the application that chooses the algorithm, not just the library that offers it.
  4. File scanning is noisy by design. Ignore tests and docs, then read what’s left.
  5. “No findings” is not “quantum-safe”. Check what the policy grades before trusting its summary.

Keywords
#

KeywordMeaning here
CBOMkitPQCA’s CBOM toolset. Its parts have names: hyperion (source scanner), theia (files and images), coeus (viewer)
sonar-cryptographyThe SonarQube plugin that is CBOMkit’s source scanner (“hyperion”)
cbomkit-actionA GitHub Action that runs that scanner on a checked-out repository, no SonarQube needed
cbomkit-theiaA Go command-line tool that scans a directory or container image for certificates, keys and configs
JWTJSON Web Token: a signed token, often used for logins between services
OPA / RegoOpen Policy Agent and its policy language; CBOMkit’s “quantum-safe” check is written in it
Trust storeThe list of root certificates a program trusts for TLS; the JVM keeps its own
GitHub PackagesGitHub’s package registry; reading from it needs a token even for public packages

Next in this series: So how am I getting ready?

Takeaways
#

  • CBOMkit runs fine from source, but expect GitHub Packages auth, Java 21 and Linux paths; the GitHub Action avoids all three.
  • On PyJWT the source scan found 1 of 14 documented algorithms, because algorithm choice is passed in by the caller.
  • cbomkit-theia found real key material, almost all of it in tests and docs; use .cbomkitignore.
  • The stock quantum-safe policy ignores keys and treats “no match” as safe; extend it before using it as a gate.

References
#

Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.
Getting ready for quantum computers - This article is part of a series.
Part 5: This Article

Related

Where is my crypto?

In part 1 I admitted that I couldn’t list the cryptography in my own projects. An SBOM didn’t help: it tells me which libraries I ship, not that line 13 of one file signs with ECDSA on P-256, or that an old certificate is still sitting in a container image. A CBOM is the list that does. Where a CBOM’s data comes from, and what it holds Part 3 ended with the PQCA’s first recommendation: start with an inventory. A CBOM is the standard format for that inventory. This part explains the format and how to read it.

Who's already working on it?

The new locks I ran in the last post didn’t appear by themselves. Somebody wrote that code, tested it, proved parts of it correct, and built the tools that tell you where the old locks are hiding. When I went looking for who, a lot of roads led to one place: the PQCA. Four projects, four recommendations Part 1 covered what breaks and what replaces it, and part 2 ran the replacements. Standards bodies decide which algorithms to use; this part is about who builds them in the open, and what they tell the rest of us to do.

Saved today, read tomorrow

In 1943 the US Army started keeping copies of Soviet telegrams it couldn’t read. Some of them were read years later, and they named spies. I think of that story every time someone tells me quantum computers are “still years away”. If names like RSA, X25519 or ECDSA are new to you, the primer explains what each one does, in plain words.