1152 Commits

Author SHA1 Message Date
Samuele Pedroni
0a22f58499 asserts,boot,secboot: switch to a secboot version measuring classic
to have the information available when we seal capture classic in
modeenv and bootchains as we do for other mode characteristics

as for now we assume we don't want so support classic/core remodels

some things need to be tested but it's best if the tests are added
when we are actually looking at the full picture of installing classic
systems with modes
2022-09-15 08:18:49 +02:00
Samuele Pedroni
cbddde69ff a/snapasserts: add a test about DeriveSideInfo* ambiguity limitations 2022-07-22 18:25:10 +02:00
Samuele Pedroni
21e2207e9e many: support non-default provenance snap-revisions in DeriveSideInfo*
snapsserts.DeriveSideInfo* cannot deal with snap-revisions with the
same hash but different provenance in the local system assertion
database, this should be an acceptable limitation for a while

the seedwriter code now assumes that the input can be trusted, this is
reasonable

systems.go uses already installed snaps, so it's fine but probably
would still be good to address the TODO in it for efficiency/clarity
as the code in seedwriter DeriveSideInfo is even more clunky now for
this use case, we should be able to find an applicable snap-revision
by other means
2022-07-22 11:30:28 +02:00
Samuele Pedroni
1ca77ad4e2 image,a/snapasserts: doc comment improvements/formatting
from comments on the previous PR and this, thanks @mardy, @MiguelPires
2022-07-21 09:17:14 +02:00
Samuele Pedroni
a58b5b6640 many: snap revision fetching and cross-checking for delegation
snap revision fetching and cross-checking should take provenance into
account and also verify device scope constraints for revision
authority delegation

provenance is taken as a hint from the store, but then matching
assertions must be found and then provenance is double checked

a failure of the latter check is likely a sign of a bug or
error as an attacker that can submit or forge/sign a blob could
as well do one with the expected provenance

provenance goals are tracing and avoiding the risk of polluting
the snap-revision namespace

this leaves alone the DeriveSideInfo* functions mainly used for
asserted local installs, this means they might fail to find a
snap-revision sometimes, they will be updated in a different branch.
2022-07-20 11:03:20 +02:00
Samuele Pedroni
324d046a37 asserts: optionally check device scope constraint of RevisionAuthority 2022-07-18 20:36:18 +02:00
Samuele Pedroni
b670e9a185 many: snapasserts.DeriveSideInfo* take a model assertion
this will be used to perform the device specific part of full cross
checks for delegated authority snap-revisions
2022-07-18 20:36:18 +02:00
Samuele Pedroni
bac14a21a4 many: snapasserts.CrossChecks takes a model assertion optionally
this will be used to perform the device specific part of full cross
checks for delegated authority snap-revisions
2022-07-18 14:28:46 +02:00
Samuele Pedroni
314b359bb3 asserts,snap: expose provenance on snap.Info and validate it
also introduce naming.ValidateProvenance,ValidProvenance and
a DefaultProvenance constant
2022-07-17 18:09:14 +02:00
Michael Vogt
4f2836e6a1 Merge pull request #11941 from alfonsosanchezbeato/extend-model-for-classic
asserts: allow classic + snaps models and add distribution to model
2022-07-15 11:17:38 +02:00
Alfonso Sánchez-Beato
4a1f4c93fc asserts: add distribution field to model, for extended classic model
Allow extended classic models and require for them a distribution field.
2022-07-14 16:29:00 +01:00
Miguel Pires
77534584ce asserts: minor improvements
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-07-08 18:17:59 +01:00
Miguel Pires
438424b702 asserts: improve time range formatting
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-07-08 10:56:01 +01:00
Miguel Pires
24c876c8ce asserts: add more context to key expiry error
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-07-06 15:13:49 +01:00
Samuele Pedroni
050406375e asserts: clarify max-revision error
thanks @mardy
2022-06-30 09:42:23 +02:00
Samuele Pedroni
f47430b08a asserts: enforce a validity pattern for provenance 2022-06-29 17:41:21 +02:00
Samuele Pedroni
b021737ebe asserts: have a single happy return in SnapRevision.checkConsistency
thanks @mardy
2022-06-29 17:31:21 +02:00
Samuele Pedroni
c35638ef4f asserts: allow delegating snap-revision via snap-declaration revision-authority
the contraints check for this is done using RevisionAuthority.Check
2022-06-27 16:12:15 +02:00
Samuele Pedroni
44533f9cb6 many: introduce optional primary key provenance for snap-revision 2022-06-24 10:21:07 +02:00
Paweł Stołowski
386ebcd978 Also add a validation set that doesn't require a specific revision. 2022-06-20 16:49:01 +02:00
Paweł Stołowski
387c216bee Cover the case where same revision of a snap is required by 2 validation sets. 2022-06-20 16:49:01 +02:00
Paweł Stołowski
be2ef2c7da Determine required revisions for missing snaps. 2022-06-20 16:49:01 +02:00
Samuele Pedroni
1f6c27adb7 asserts/info,mkversion.sh: capture max assertion formats in snapd/info 2022-05-17 20:39:12 +02:00
Michael Vogt
7e80a58091 Merge pull request #11709 from mvo5/starred-developers
snap: implement "star" developers
2022-04-28 20:01:04 +02:00
Samuele Pedroni
cbcc460bdc a/snapasserts: tweak/rewrap the DeriveSideInfo* doc comments 2022-04-25 11:05:14 +02:00