-
Notifications
You must be signed in to change notification settings - Fork 51
Make cpanm install more secure #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Have a known-good local fatpacked copy of cpanm from https://github.com/miyagawa/cpanminus. Pin at version 1.7043.
Instead of fetching cpanm from GitHub, copy our local fatpacked cpanm into the context directory of each Perl image, so it can be installed into /usr/local/bin.
Looks a bit ugly copying cpanm in so many times, but due to the way Docker Hub works, it can't be helped...
Why not instead just replace |
That can work too, although if I read #39 correctly it was concern about the repo (or even github itself) being compromised at the time of image build. I'd go the commit/tag route myself if it were GPG-signed (or there's some other way to externally verify the authenticity; perhaps an alternate might be to fetch from CPAN instead of GitHub, via plain I'm not too keen on this PR itself since we make copies of cpanm, so alternatives are very much welcome! |
If GitHub is compromised, our whole build process is a bit sketchy (minus
any hash verification Git might do internally).
You could simply embed a known-good sha256 of a known-good commit of
`cpanm`. By default, normal CPAN doesn't do much verification either, does
it?
|
I checked CPAN, it provides a CHECKSUMS file per author that contains SHA256 for the dists, so e.g. for App-cpanminus-1.7043:
Normal
While it would seem we can certainly use |
Although it fetches that checksum via HTTP from the same (potentially
compromised) host, so really only verifies transmission integrity, right?
It'd probably be viable to scrape the checksum from that file and embed it
here, although that'd be for the tar not the fatpack, so slightly less
useful. 😇
|
Yeah, it is a bit of a bother to checksum against the dist then unpack and install, but it is doable. I'll whip up another PR. Thanks! |
Now unneeded since #41 is merged. Thanks! |
Use a local known-good fatpacked copy of cpanm and install it instead of
fetching it from GitHub.
Fixes #39.