Skip to content

Commit 60bdccd

Browse files
author
Marcio Silva
committed
First write-up for the new "offline attestation" functionality
Signed-off-by: Marcio Silva <[email protected]>
1 parent 215d7d5 commit 60bdccd

File tree

1 file changed

+302
-0
lines changed

1 file changed

+302
-0
lines changed

73-offline-attestation.md

+302
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
<!-- **Note:** When your enhancement is complete, all of these comment blocks
2+
should be removed.
3+
4+
To get started with this template:
5+
6+
- [ ] **Create an issue in keylime/enhancements**
7+
When filing an enhancement tracking issue, please ensure to complete all
8+
fields in that template. One of the fields asks for a link to the enhancement. You
9+
can leave that blank until this enhancement is made a pull request, and then
10+
go back to the enhancement and add the link.
11+
- [ ] **Make a copy of this template.**
12+
name it `NNNN-short-descriptive-title`, where `NNNN` is the issue number (with no
13+
leading-zero padding) assigned to your enhancement above.
14+
- [ ] **Fill out this file as best you can.**
15+
At minimum, you should fill in the "Summary", and "Motivation" sections.
16+
These should be easy if you've preflighted the idea of the enhancement with the
17+
appropriate SIG(s).
18+
- [ ] **Merge early and iterate.**
19+
Avoid getting hung up on specific details and instead aim to get the goals of
20+
the enhancement clarified and merged quickly. The best way to do this is to just
21+
start with the high-level sections and fill out details incrementally in
22+
subsequent PRs.
23+
-->
24+
# enhancement-#40: TPM 2.0 Pre-Boot Event log support
25+
26+
<!--
27+
This is the title of your enhancement. Keep it short, simple, and descriptive. A good
28+
title can help communicate what the enhancement is and should be considered as part of
29+
any review.
30+
-->
31+
32+
<!--
33+
A table of contents is helpful for quickly jumping to sections of a enhancement and for
34+
highlighting any additional information provided beyond the standard enhancement
35+
template.
36+
-->
37+
38+
<!-- toc -->
39+
40+
- [Release Signoff Checklist](#release-signoff-checklist)
41+
- [Summary](#summary)
42+
- [Motivation](#motivation)
43+
- [Goals](#goals)
44+
- [Non-Goals](#non-goals)
45+
- [Proposal](#proposal)
46+
- [User Stories (optional)](#user-stories-optional)
47+
- [Story 1](#story-1)
48+
- [Story 2](#story-2)
49+
- [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional)
50+
- [Risks and Mitigations](#risks-and-mitigations)
51+
- [Design Details](#design-details)
52+
- [Test Plan](#test-plan)
53+
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
54+
- [Drawbacks](#drawbacks)
55+
- [Alternatives](#alternatives)
56+
- [Infrastructure Needed (optional)](#infrastructure-needed-optional)
57+
<!-- /toc -->
58+
59+
## Release Signoff Checklist
60+
61+
<!--
62+
**ACTION REQUIRED:** In order to merge code into a release, there must be an
63+
issue in [keylime/enhancements] referencing this enhancement and targeting a release**.
64+
65+
For enhancements that make changes to code or processes/procedures in core
66+
Keylime i.e., [keylime/keylime], we require the following Release
67+
Signoff checklist to be completed.
68+
69+
Check these off as they are completed for the Release Team to track. These
70+
checklist items _must_ be updated for the enhancement to be released.
71+
-->
72+
73+
- [ ] Enhancement issue in release milestone, which links to pull request in [keylime/enhancements]
74+
- [ ] Core members have approved the issue with the label `implementable`
75+
- [ ] Design details are appropriately documented
76+
- [ ] Test plan is in place
77+
- [ ] User-facing documentation has been created in [keylime/keylime-docs]
78+
79+
<!--
80+
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
81+
-->
82+
83+
## Summary
84+
85+
<!--
86+
This section is incredibly important for producing high quality user-focused
87+
documentation such as release notes or a development roadmap. It should be
88+
possible to collect this information before implementation begins in order to
89+
avoid requiring implementers to split their attention between writing release
90+
notes and implementing the feature itself. Reviewers
91+
should help to ensure that the tone and content of the `Summary` section is
92+
useful for a wide audience.
93+
94+
A good summary is probably at least a paragraph in length.
95+
-->
96+
97+
Provide Keylime with the ability to store all the required information to
98+
perform a full attestation, in a persistent external time-series datastore.
99+
This should also include some proof that a given AIK created on a TPM by an
100+
`agent` was indeed tied to a given EK, a process that is done by the
101+
`registrar` and whose responsibility is to store it on a tamper-resistant
102+
metadatastore (e.g. transparency log)
103+
104+
## Motivation
105+
106+
<!--
107+
This section is for explicitly listing the motivation, goals and non-goals of
108+
this enhancement. Describe why the change is important and the benefits to users.
109+
-->
110+
111+
The main motivation for adding this functionality is to give auditors and other
112+
compliance officers the ability to answer, with a proper degree of certainty
113+
and trust the following question: did node N had its software stack fully
114+
attested at date T? Being date "T" a point time that could be well in the
115+
past, we cannot rely on the accessibility (or even the existence) of the given
116+
node. Furthermore we cannot even rely on the accessibility (or even the
117+
existence) of the server-side components of the Keylime cluster (i.e.,
118+
`registrar` and `verifier`) and thus need to design with these boundary
119+
conditions in mind.
120+
121+
### Goals
122+
123+
<!--
124+
List the specific goals of the enhancement. What is it trying to achieve? How will we
125+
know that this has succeeded?
126+
-->
127+
128+
- Add functionality on the `registrar` to record (in a tamper-resistant
129+
transparency log) the association between the EK and AIK (i.e.
130+
`tpm2_makecredential`)
131+
- Add functionality on the `verifier` to record (in a time-series persistent
132+
datastore) all the information needed to perform attestation standlone (i.e.,
133+
quotes and MB/IMA logs)
134+
- Add a new CLI which will interface with the aforementioned persistent stores,
135+
and will call the main, umodified `verifier` code in order to do post-facto
136+
attestation.
137+
138+
### Non-Goals
139+
140+
<!--
141+
What is out of scope for this enhancement? Listing non-goals helps to focus discussion
142+
and make progress.
143+
-->
144+
145+
- The interaction between the time-series persistent datastore and
146+
tamper-resistant transparency log will be done by keylime user/operator.
147+
Inside the core Keylime, a "plugin" architecture will be adopted (very much
148+
like the "policies" for Measured Boot) and the implementation details of the
149+
code which will interact with such stores are outside of the scope.
150+
151+
152+
## Proposal
153+
154+
<!--
155+
This is where we get down to the specifics of what the proposal actually is.
156+
This should have enough detail that reviewers can understand exactly what
157+
you're proposing, but should not include things like API designs or
158+
implementation. The "Design Details" section below is for the real
159+
nitty-gritty.
160+
-->
161+
162+
- The `registrar` will be modified to, upon initial `agent` registration -
163+
which includes the execution of `tpm2_makecredential` - record the EK, AIK
164+
into a JSON file, sign it (using the private key generated as part of the
165+
certificates for mTLS interaction with both `tenant` and `registrar`) and then
166+
make a record of it on a tamper-resistant transparency log (e.g., Rekor). In
167+
addition to that, it will store the JSON file, the signature, and the public
168+
key on the time-series persistent datastore. This should allow an external
169+
component/user to check, provided that there is trust on the `registrar`, that
170+
a particular AIK is indeed tied to a particular EK. The reason for having this
171+
data stored into a time-series is due to the fact that AIKs are regenereated
172+
every time an `agent` is restarted on Keylime.
173+
- The `verifier` will be modified to take the `json_response` (python
174+
dictionary) from the `agent` - which will include both quotes and logs (MB
175+
and IMA) - `agent` data (python dictionary) from the SQL database (internal to
176+
Keylime) and the `agentAttestState` python object, combine it into a single
177+
record and store it on the time-series persistent datastore.
178+
- Two pieces of information: the name of a python module to be dynamically
179+
imported (which will contain code used to interact with these new proposed
180+
stores) and the connection paramaters (for these new proposed stores) will be
181+
supplied by the user as two new parameters under `[cloud_verifier]` and
182+
`[registrar]` section: `persistent_store_import` and
183+
`persistent_store_connection_data`)
184+
- A new CLI interface - `keylime_attest` - will contact both the transparency
185+
log and the time-series datastore, get a list of AIKs proven to be associated
186+
with an EK, and then call the same code used by the `verifier` (i.e.,
187+
`cloud_verifier_common.process_quote_response`) to perform a series of point in
188+
time attestation on all records retrieved from the persistent datastore.
189+
- An additional minor change: it is expected that the `verifier` will extract
190+
the "TPM clock information" (i.e, "clock", "resetCount", "restartCount",
191+
"safe") and make it available as part of the `json_response`
192+
193+
### Notes/Constraints/Caveats (optional)
194+
195+
<!--
196+
What are the caveats to the proposal?
197+
What are some important details that didn't come across above.
198+
Go in to as much detail as necessary here.
199+
This might be a good place to talk about core concepts and how they relate.
200+
-->
201+
202+
- The `keylime_attest` CLI will call the attestation code used by the
203+
`verifier` without any modification, and should be up to the user to write a
204+
more complex policy if he choses to do so.
205+
206+
### Risks and Mitigations
207+
208+
<!--
209+
What are the risks of this proposal and how do we mitigate. Think broadly.
210+
For example, consider both security and how this will impact the larger
211+
enhancement ecosystem.
212+
213+
How will security be reviewed and by whom?
214+
-->
215+
216+
- The key security aspect here is to convince ourselves (and others) that the
217+
record generated by the `registrar` to indicate the association between EK
218+
and AIK is enough. Once this is done, offline attestation has basically the
219+
same level of security of the online attestation (which was already evaluated)
220+
as it uses the very same code base.
221+
- While we do expect very little impact on KeyLime's scalability by adding this
222+
capability, it is important to remember that we are constantly testing KL in
223+
a configuration with 5K nodes (with both MB and IMA simultaneously activated),
224+
and can provide experimental evidence to back this hypothesis.
225+
226+
## Design Details
227+
228+
<!--
229+
This section should contain enough information that the specifics of your
230+
change are understandable. This may include API specs (though not always
231+
required) or even code snippets. If there's any ambiguity about HOW your
232+
proposal will be implemented, this is the place to discuss them.
233+
-->
234+
235+
- The first PR will provide the "persistent datastore" plugin capability, to be
236+
called from with both `registrar` and `verifier` code. It will include a
237+
default, "null operation" and all the required changes into `config.py` and
238+
`keylime.conf`
239+
- A second PR will give the `verifier` the ability to extract and store "TPM
240+
clock information". This might include changes on the database schema.
241+
- A third PR will provide a CLI utility to perform offline attestation ### Test
242+
Plan
243+
244+
<!--
245+
**Note:** *Not required until targeted at a release.*
246+
247+
Consider the following in developing a test plan for this enhancement:
248+
- Will there be e2e and integration tests, in addition to unit tests?
249+
- How will it be tested in isolation vs with other components?
250+
251+
No need to outline all of the test cases, just the general strategy. Anything
252+
that would count as tricky in the implementation and anything particularly
253+
challenging to test should be called out.
254+
255+
All code is expected to have adequate tests (eventually with coverage
256+
expectations).
257+
-->
258+
259+
- The default "null operation" plugin for the persistent datastore will allow
260+
the base keylime code to be continuosly tested as it is today.
261+
- Given that we are not mandating any kind of specific persistent store,
262+
neither for the time-series datastore nor for the tamper-resistant
263+
transparency log, there are no plans to perform any continous testing on it.
264+
265+
### Upgrade / Downgrade Strategy
266+
267+
<!--
268+
If applicable, how will the component be upgraded and downgraded? Make sure
269+
this is in the test plan.
270+
271+
Consider the following in developing an upgrade/downgrade strategy for this enhancement
272+
-->
273+
274+
- This is an optional feature, and thoroughly backward compatible with current
275+
Keylime deployments.
276+
277+
## Drawbacks
278+
279+
<!--
280+
Why should this enhancement _not_ be implemented?
281+
-->
282+
283+
- No known drawbacks.
284+
285+
## Alternatives
286+
287+
<!--
288+
What other approaches did you consider and why did you rule them out? These do
289+
not need to be as detailed as the proposal, but should include enough
290+
information to express the idea and why it was not acceptable.
291+
-->
292+
293+
- No known alternatives.
294+
295+
## Infrastructure Needed (optional)
296+
297+
<!--
298+
Use this section if you need things infrastructure related specific to your enhancement. Examples include a
299+
new subproject, repos requested, github webhook, changes to CI (travis).
300+
-->
301+
302+
- Some sort of external time-series datastore and tamper-resistant transparency log will be needed in order to enable this feature.

0 commit comments

Comments
 (0)