-
-
Notifications
You must be signed in to change notification settings - Fork 52
Description
ref. https://zenn.dev/shunsuke_suzuki/scraps/7cfc2d3a5c6d04
Overview
Verify the checksum of downloaded file, and if the checksum is wrong make the installation failure.
Motivation
Make aqua secure.
Prevent the supply chain atack.
Consideration
We have to keep aqua simple. We should avoid making aqua complicated by introducing checksum verification.
Proposal of Specification
When a tool is installed, aqua verifies the checksum as the following.
- Download the file in the temporal directory
- Calculate the checksum from the downloaded file
- Read the file
.aqua-checksums.jsonon the same directory as aqua configuration file. If.aqua-checksums.jsonisn't found, aqua treats the file is empty - Get the expected checksum of downloaded file from
.aqua-checksums.json - If the actual checksum is different from the expected checksum, make the installation failure. If the checksum isn't found in
.aqua-checksums.json, the actual checksum is added to.aqua-checksums.json - Install the file
⚠️ Note
If the file is falsified before the correct checksum is added to .aqua-checksums.json, it is difficult to detect the falsification.
💡 Ignore the specific checksum verification
If you would like to ignore the specific checksum verification, you can do it by removing the checksum from .aqua-checksums.json.
.aqua-checksums.json
Pairs of package id and checksum are recorded.
e.g.
{
"github_archive/github.com/tfutils/tfenv/v2.2.3": "0b42330aeed675ad3e5dd6063dbd1daabecb36180e515cca1c6e105dd7a1fa49"
}This file is created and updated by aqua automatically, so you don't have to update this file manually.
Question: Should .aqua-checksums.json be managed with Git?
Coming soon
Algorithm to calculate checksums
sha256 is used for goreleaser by default, so aqua would also support sha256 by default.
In future, aqua may support other algorithms too.
Idea: command to update .aqua-checksums.json like terraform providers lock
Coming soon
Future work
- Verify Registry
- Verify aqua-proxy
- Support checksum algorithm other than sha256
- Get checksums from GitHub Releases's file