Dependency cooldowns - #860
Open
filippomc wants to merge 6 commits into
Open
Conversation
|
|
||
| # Dependency updates need neither java nor the openapi generator. | ||
| if args.update_dependencies: | ||
| return update_js_dependencies(root_path, args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes CH-286
Implemented solution
Mitigates supply-chain attacks across both stacks: package versions published in the
last 7 days are never installed, and application images now install from lock
files. Most malicious releases are detected and pulled within days of publication;
the cooldown window skips that blast window entirely, at the cost of adopting genuine
releases a week late.
What's included
Python cooldown
pip installin the repository (Dockerfiles,dev-setup.sh,install.sh,CI configs, application templates) carries
--uploaded-prior-to=P7D.pip install --upgrade pip(bootstraps the pip thatunderstands the flag) and installs from
pylock.toml(the cooldown was applied atlock time; pip errors otherwise).
blueprintcodefresh template bumpedpython:3.7 → 3.12,
test/docker-compose.yml3.9 → 3.12.JavaScript cooldown (Yarn 1 → Yarn 4 migration)
(pinned via
packageManager, installed through corepack — no binary committed).npmMinimalAgeGate: "7d"lives in exactly two places: the root.yarnrc.yml(developers; yarn merges rc files from ancestor directories) and the
cloudharness-frontend-buildbase image (container builds, incl. downstream apps).vector; re-enabled only for
puppeteerviadependenciesMeta.--frozen-lockfile→--immutableeverywhere;--timeout(a hard error inYarn 4) replaced by
httpTimeout/env.PEP 751 lock files for applications
requirements.txtcarries apylock.tomlbesideit, and its Dockerfile installs from the lock (full tree, hashes).
image: requirements are installed there first and a freeze constrains
pip lock,so the lock records what the deployed image really provides (e.g. setuptools pins
to the base image's version). Nothing of the lock toolchain enters deploy images.
libraries/andtools/stayunlocked so apps keep inheriting their updates.
harness-generate dependenciesNew generation mode that audits and refreshes every lock file:
audit fix); a failed refresh restores the previous lock instead of leaving apartial one.
npm audit fix+npm update(both--package-lock-only).pylock.tomlregenerated in the base image, discovered by aDockerfile that actually installs them; base images scanned with the same helpers
skaffold/codefresh use (
guess_build_dependencies_from_dockerfile,find_dockerfiles_paths) — downstream-defined images work without configuration.Image names resolve through the generated
skaffold.yaml(
cloud-harness/cloudharness-flask), with--registry/--tagoverrides.-i/--interactive(confirm per project),--audit-only(report, writenothing),
--upgrade(raise declared ranges — can cross majors),--registry,--tag,--cooldown-days N(default 7; without the flag yarn follows.yarnrc.yml).(range change /
resolutionsentry / fix still quarantined).corepack enablewhen the yarn on PATH is too old (only whenattached to a terminal).
Also fixed on the way
test/test-e2e/yarn.lockin an earlier commit was a partial lock (failed--immutable, crashedyarn npm audit); repaired, and the tool now can'treproduce that state.
pip install fastapi-code-generatorinch_cli_tools/openapi.pynowcarries the cooldown flag.
samples/django-ninja/test-e2eDockerfiles installed JS deps without a frozenlockfile; pinned.
Known limitations
pylock.tomlfiles are single-platform (amd64 / CPython 3.12 — matching theimages).
pip lockis experimental in pip.test/test-e2e, used byharness-test) has no cooldown: npm gainedmin-release-ageonly in 11.10.0.requirements.txtalone no longer changes an image — regenerate the lockand commit both.
corepack enableonce (yarn refuses with that instructionuntil then).
test/test-e2e:extract-zipneeds puppeteer 25(semver-major),
glob/inflightsit under EOL tslint/lint-staged tooling.How to test this PR
Prereqs:
conda activate ch,sh install.sh,corepack enable, Docker running.