-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: integrity checks for Ubuntu Release files #106
Conversation
This reverts commit 6bf6d46.
This commit adds the functionalities to add public keys to validate archive InRelease file signatures. Instead of downloading the "Release" files for different suites, download the signed "InRelease" file and validate the signature with the provided key(s). This commit extends the chisel release with public keys definitions. They are stored in ASCII armored format in the top-level public-keys property by name. And they are referenced by name in the public-keys list property in archive definitions. An example of the extended chisel release file is at the bottom. Example chisel.yaml: format: chisel-v1 archives: ubuntu: version: 22.04 components: [main, universe] suites: [jammy, jammy-updates, jammy-security] public-keys: [ubuntu] ubuntu-fips: version: 22.04 pro: fips components: [main] suites: [jammy] public-keys: [ubuntu-fips] ubuntu-fips-updates: version: 22.04 pro: fips-updates components: [main] suites: [jammy] public-keys: [ubuntu-fips] public-keys: ubuntu: id: C2B15A6A7FCD95FD armor: | -----BEGIN PGP PUBLIC KEY BLOCK----- mQINBFzZxGABEADSWmX0+K//0cosKPyr5m1ewmwWKjRo/KBPTyR8icHhbBWfFd8T DtYggvQHPU0YnKRcWits0et8JqSgZttNa28s7SaSUTBzfgzFJZgULAi/4i8u8TUj +KH2zSoUX55NKC9aozba1cR66jM6O/BHXK5YoZzTpmiY1AHlIWAJ9s6cCClhnYMR ... E+SWDGxtgwixyPziL56UavL/eeYJWeS/WqvGzZzsAtgSujFVLKWyUaRi0NvYW3h/ I50Tzj0Pkm8GtgvP2UqAWvy+iRpeUQ2ji0Nc =j6+P -----END PGP PUBLIC KEY BLOCK----- ubuntu-fips: id: E173597E2CAB05C1 armor: | -----BEGIN PGP PUBLIC KEY BLOCK----- mQINBE+tgXgBEADfiL1KNFHT4H4Dw0OR9LemR8ebsFl+b9E44IpGhgWYDufj0gaM /UJ1Ti3bHfRT39VVZ6cv1P4mQy0bnAKFbYz/wo+GhzjBWtn6dThYv7n+KL8bptSC Xgg1a6en8dCCIA/pwtS2Ut/g4Eu6Z467dvYNlMgCqvg+prKIrXf5ibio48j3AFvd ... mguPI1KLfnVnXnsT5JYMbG2DCLHI/OIvnpRq8v955glZ5L9aq8bNnOwC2BK6MVUs pbJRpGLQ29hbeH8jnRPOPQ+Sbwa2C8/ZSoBa/L6JGl5RDaOLQ1w= =6Bkw -----END PGP PUBLIC KEY BLOCK-----
This commit introduces a new chisel-release yaml format named "chisel-v2". The major changes in this format is the introduction of the "public-keys" field, which is used in archive definitions to verify archive InRelease files.
spread test is failing as expected because of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, those updates are currently in progress as far as I know. |
This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106
This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106
This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106
This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106
This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Here is a first pass.
internal/testutil/reindent_test.go
Outdated
}, { | ||
raw: "\n", | ||
prefix: "\t", | ||
result: "\t\n\t", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. It's indenting an empty line with zero content, and may create actual issues depending on what else shows up after it. Imagine AddPrefix("foo\n") + "bar".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you. We went for a naive implementation which produces strange cases. I have changed it and made it more complex.
Once approved and before merging, please wait for the corresponding chisel-releases PRs to be merged so that we can re-run the Spread tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to recap the plan:
- v0.8.1 has just been released, including the fix for
KnownFields(false)
. This will give existing users a longer grace period for migrating to formatchisel-v2v1
, whenever that comes - with v0.8.1 in place and communicated, we wait some time and then we can then update the
chisel-releases
, adding thepublic-keys
fields tochisel-v1
. While v0.8 will fail, v0.8.1 will work (let's say early Jan 2024) - this PR can then also be merged
- after this PR, https://github.com/canonical/chisel/pull/108/files can also be reviewed and merged
- we'll then release Chisel v0.9.0 with support for both
chisel-v1
andchisel-v2v1
formats (at this stage, v0.8.1 still works) - after some time, we can then deprecate the
chisel-v1
format fromchisel-releases
. v0.8.0 and v0.8.1 will no longer work, but v0.9.0 will (let's also give it some time between the v0.9.0 release and the migration tochisel-v2v1
)
@cjdcordeiro Sure it just caught me by surprise because that was not the plan last time we discussed. I will amend the PRs and timelines to match the new direction. |
Y sry about that @letFunny . I think only #106 would need to be amended though |
FYI: note the updated comment above (#106 (review)) - we shall update the chisel-releases format to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, thanks Alberto.
Only final nitpicks, and then we need to sync with the Rocks team on the exact release date.
internal/setup/fetch_test.go
Outdated
@@ -12,6 +12,8 @@ import ( | |||
// TODO Implement local test server instead of using live repository. | |||
|
|||
func (s *S) TestFetch(c *C) { | |||
c.Skip("TODO chisel-releases need to be updated with public-keys for this test to pass") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For our own tracking, this still needs addressing.
According to the new plan:
|
* feat(22.04): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(22.04): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
* feat(24.04): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(24.04): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
* feat(23.10): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(23.10): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
* feat(20.04): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(20.04): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
* feat(23.04): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(23.04): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm merging this now per our agreement, but please DO NOT RELEASE THIS before both v1-public-keys
and public-keys
are supported. We don't want a release in the wild that supports one and not the other as otherwise we'll have introduced the need for a new transition.
Y agreed. We'll wait for a coming PR with those changes before releasing v0.9.0 |
* feat(22.04): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(22.04): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
* feat(22.04): add ubuntu archive signing key 2018 This commit adds the Ubuntu Archive Automatic Signing Key (2018) as a "public-key" in the chisel.yaml. The armored data was obtained by executing the following commands on a Ubuntu 22.04 machine: $ gpg --keyserver keyserver.ubuntu.com --receive-keys 871920D1991BC93C $ gpg --armor --export 871920D1991BC93C BREAKING CHANGE: This commit introduces the new chisel yaml format "chisel-v2", in which ``public-keys`` (top-level) and ``archive.<name>.public-keys`` fields are introduced. This changes is related to the addition of integrity checks in chisel. [1] [1] canonical/chisel#106 * fix(22.04): revert chisel.yaml format to chisel-v1 * fix: rename public-keys to v1-public-keys
Chisel will download InRelease files instead of Release files, the former being the signed version of the latter. For each archive and its components/suites, the signature in the InRelease file will be verified against the public keys associated with that archive.
These public keys will be stored in the chisel-release chisel.yaml file, as a new top-level property called public-keys. Keys themselves will be stored in ASCII armored format together with their key id. Lastly, the archive definition will reference these public keys by name.
Example chisel.yaml: