code.deps.lockfile-committed

Dependency manifests ship with a committed lockfile

Every dependency manifest in a repository is paired with a committed lockfile, so a build installs the versions that were reviewed rather than whatever resolves on the day.

Medium Attested Preventive

Assertion

for every manifest m in the tree: lockfile(m) is tracked

Evaluated against git ls-files, scanned for manifest and lockfile pairs, collected on-push.

Rationale

A manifest without a lockfile describes a range of acceptable versions, and the build picks one at install time. Two builds from the same commit can get different code, and a malicious release of a transitive dependency reaches production without any change in the repository to review. A committed lockfile pins the exact set, so a dependency change is a diff that a person approves.

Observation

The collector lists tracked files and pairs each manifest with the lockfile its ecosystem expects:

ManifestLockfile
package.jsonpackage-lock.json
go.modgo.sum
pyproject.toml or requirements.inthe project’s lockfile, or requirements.txt with hashes
Any Terraform root.terraform.lock.hcl

The assertion holds when every manifest has its lockfile tracked beside it. A lockfile that exists but is ignored by .gitignore is not tracked and fails. Whether the build actually installs from the lockfile is a property of the build command; the CI toolchain uses the frozen install for each ecosystem so the two cannot disagree.

Remediation

Run the ecosystem’s install once, commit the lockfile it produces, and remove any .gitignore entry that excludes it. For Terraform, run terraform init in the root and commit .terraform.lock.hcl. From then on the lockfile changes only when a dependency is deliberately updated.