← All writing

The tools are part of the result.

One fixed input, one moving inputA single hash pin spans two runs. Two separate database stacks, labeled Earlier and Refreshed, connect to that same pin. Only the database changes in this example.ScannerVulnerability dataPinnedby hashEarlierRefreshRefreshedSame tools. Result can change.
One fixed input, one moving inputTwo runs can use the very same pinned scanner. Refresh its vulnerability database between runs and the result may change.

Why I added a pinned scanner environment to ASH, and what reproducibility can and cannot tell you.

ASH: pinned Nix scanner mode and its validation

Automated Security Helper Security

At a glance

A useful report should tell you about the code and about the conditions under which it was checked.

A security check depends on more than the source being checked. It also depends on the tools that were available, the versions they ran, and the data they used. Those inputs belong in the engineering design, even when they are not the first thing a report reader sees.

My Nix-mode contribution to ASH supplies a hash-pinned scanner environment. It gives adopters another way to run the toolchain without first building a container image, while keeping the scan itself in ASH's existing execution model. The goal is a more explainable run, not a blanket promise that every input has stopped changing.

Make the environment an explicit input.

The implementation describes the scanner environment in a Nix flake and locks its inputs by hash. Entering that environment changes the executable search path, then ASH runs its usual local scan inside it. This avoids introducing a second scan engine just to provide a different installation experience.

The indexed ring is the fixed tool environment. The three bars above it are separate inputs, read from top to bottom.

Give the tools a fixed reference.A stationary indexed tool plate sits beneath separate Code, Rules and External data inputs.CodeRulesExternal dataPinned toolsNewer DB vs. older DBSame tools. Verdict unknown.
Give the tools a fixed reference.

A pinned environment makes the executable tools an explicit part of the scan.

A stationary indexed tool plate sits beneath separate Code, Rules and External data inputs.

Diagram key
Indexed ringPinned tools
The executable tools have a known environment.
Top / middle / bottom barsCode / rules / external data
The things those tools inspect or use.

I kept the caller's arguments intact apart from the execution-mode change. Reconstructing an invocation from parsed options can quietly omit an argument that somebody depended on. Passing the invocation through preserves the existing contract and keeps the new mode focused on what it actually owns: supplying tools.

Keep two inputs in view.
  1. Scanner executable and version
  2. Rules and changing external data
  3. Coverage alongside findings

Pinning a binary does not pin a vulnerability database that is refreshed separately.

Two inputs an offline run can verify, on LinkedIn, opens in a new tab follows the same idea into offline scans, where the image and the installed tools were prepared before the run began.

Be precise about the boundary.

A pinned toolchain is useful, but it is not a claim that every scanner has identical inputs forever. A vulnerability database can change independently. A scanner managed by ASH's own Python environment is different from an external executable supplied by the flake. The implementation and its checks distinguish those cases.

The three input bars spread apart while the indexed ring remains fixed. Fixing the tools does not fix these inputs.

Different inputs. Different boundaries.Code, Rules and External data move independently while the tool plate stays in the same position.CodeRulesExternal dataPinned toolsNewer DB vs. older DBSame tools. Verdict unknown.
Different inputs. Different boundaries.

Code, rules and external data remain separate from the pinned tool environment.

Tools pinned in both runsExternal database age differs

Imagine two runs using the same pinned tools, one with a newer database and one with an older database. The environment is known; the scan result is not known in advance.

Code, Rules and External data move independently while the tool plate stays in the same position.

Diagram key
Top barCode
The software being checked.
Middle barRules
The checks applied to it.
Bottom barExternal data
Information supplied from outside the tool environment.

That precision helps adoption. If Nix is unavailable, the mode gives an actionable refusal instead of silently choosing a different environment. An operator who asked for a specific execution model should be able to tell whether that model was used.

The adapter boundary has its own version of this question, which I explored in A scanner adapter carries a contract across tools, on LinkedIn, opens in a new tab: a scanner's name says an integration exists, not that its tool can be reached.

Reproducibility makes a result easier to discuss.

When a team asks why two runs differ, an explicit environment narrows the conversation. The code, rules, external data, and execution conditions can be examined separately. That is a more useful starting point than treating every difference as an unexplained property of the scanner.

The input bars move independently around the fixed ring. A known tool environment is not a promise of identical results.

Be precise about what is fixed.The tool plate remains fixed. Three input tracks preserve their separate positions; no identical-result claim is shown.CodeRulesExternal dataPinned toolsNewer DB vs. older DBSame tools. Verdict unknown.
Be precise about what is fixed.

Pinning tools does not pin every changing input or guarantee identical results.

The tool plate remains fixed. Three input tracks preserve their separate positions; no identical-result claim is shown.

Diagram key
Indexed ringWhat is fixed
The pinned executable tools.
Three separate barsWhat can change
Code, rules and external data.

I see reproducibility as a way to reduce the number of hidden decisions in a system. It is valuable because it makes change inspectable. The next person can see what was fixed in place, what remains live, and where to look when the result changes.

Reuse raises the same discussion. A content cache is a chain of evidence, on LinkedIn, opens in a new tab looks at what a consumer needs to know before trusting a cached result.

For a closer technical look
  • The flake defines Linux and macOS outputs for x86-64 and ARM. The contribution records which platforms were locally exercised and which belong to the CI matrix.
  • The recorded end-to-end run had nine of ten scanners participating; the ASH-managed cdk-nag environment is a separate concern.
  • The vulnerability database used by Grype is refreshed independently and is not frozen by the flake lock.

What I take from it

Pin the scanner tools, then distinguish changes in code, rules, and live vulnerability information when comparing results.

Code and further reading

Also on
The Automated Security Helper project story