Problem
For a software quality assurance course, I took an existing open-source static security scanner for Kubernetes YAML manifests (it flags things like hard-coded secrets, privileged containers and mounted Docker sockets) and added three QA practices: fuzzing, forensic logging and continuous integration.
First it had to run. It crashed on startup (missing imports, and the folder argument was never passed in), its requirements.txt was a Windows-only UTF-16 dump of 120 packages, and one sample file stopped the whole scan with a KeyError. I fixed those, trimmed the requirements to the 8 packages the code actually imports, and otherwise left the original code alone.
Fuzzing
fuzz.py has two parts:
- Whole tool. It writes 9 bad input files (invalid UTF-8, empty, huge, NULL bytes, binary, an empty list, a self-referencing YAML anchor, a complex key and the Big List of Naughty Strings) and runs the scanner on each one. All 9 crashed it.
- 10 methods, 500 random calls each. Inputs include edge-case values, naughty strings, a real manifest with one random change, self-referencing and deeply nested dicts, and a 20,000-key dict. A call over 1 second counts as a hang.

9 of 10 methods crashed, with 37 distinct crash types and 8 hangs, and the fuzzer reached 100% line and branch coverage on all 10. The bugs fell into a few patterns:
- Unbounded recursion. Five methods recurse with no limit, so a self-referencing or deeply nested dict raises
RecursionError. - Quadratic loops.
scanForSecretswalks the whole dict again for every key, and another method checks keys against a list instead of a set, so big inputs hang. - No input checks. Several methods crash on
None, numbers or bytes, assume every key is a string, or index into values without checking their length. - One bad file stops everything. A folder with no valid manifests crashes the report writer instead of writing an empty report.
The only method that never crashed, checkIfValidSecret, was also the only one that checked its input type first. The fuzzer is seeded, so every run gives the same results in about 15 seconds.
Forensic logging
I added a logger to 10 methods: scan start and finish, files found, skipped and scanned, load and parse errors, and each security finding. Secrets are logged by key name only, so the log can’t leak them, and logging is turned off while fuzzing so 5,000 junk inputs don’t flood it. I took logging back out of two methods that run many times per file, because they filled the log with the same lines.
Continuous integration
The project’s old workflow never ran: it targeted branches this repo doesn’t have, used outdated actions and installed the wrong packages. The new GitHub Actions workflow runs on every push and pull request, runs all four test files, scans the sample manifests, runs the fuzzer with coverage, and uploads the crashes, coverage report, log and scan results as an artifact. A run takes about a minute and a half.
Getting it green meant fixing the existing tests. 40 lines were out of date with what the scanner now returns, and I fixed them without changing any expected values. 63 tests read files that only exist on the original author’s computer, so they now skip with a clear message everywhere else. Final count: 112 passed, 63 skipped.