|
| 1 | +<!-- |
| 2 | +**Note:** When your enhancement is complete, all of these comment blocks 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-50: Learn the keys IMA is using for signature verification |
| 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 | +- [Release Signoff Checklist](#release-signoff-checklist) |
| 40 | +- [Summary](#summary) |
| 41 | +- [Motivation](#motivation) |
| 42 | + - [Goals](#goals) |
| 43 | + - [Non-Goals](#non-goals) |
| 44 | +- [Proposal](#proposal) |
| 45 | + - [User Stories (optional)](#user-stories-optional) |
| 46 | + - [Story 1](#story-1) |
| 47 | + - [Story 2](#story-2) |
| 48 | + - [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional) |
| 49 | + - [Risks and Mitigations](#risks-and-mitigations) |
| 50 | +- [Design Details](#design-details) |
| 51 | + - [Test Plan](#test-plan) |
| 52 | + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) |
| 53 | +- [Drawbacks](#drawbacks) |
| 54 | +- [Alternatives](#alternatives) |
| 55 | +- [Infrastructure Needed (optional)](#infrastructure-needed-optional) |
| 56 | +<!-- /toc --> |
| 57 | + |
| 58 | +## Release Signoff Checklist |
| 59 | + |
| 60 | +<!-- |
| 61 | +**ACTION REQUIRED:** In order to merge code into a release, there must be an |
| 62 | +issue in [keylime/enhancements] referencing this enhancement and targeting a release**. |
| 63 | +
|
| 64 | +For enhancements that make changes to code or processes/procedures in core |
| 65 | +Keylime i.e., [keylime/keylime], we require the following Release |
| 66 | +Signoff checklist to be completed. |
| 67 | +
|
| 68 | +Check these off as they are completed for the Release Team to track. These |
| 69 | +checklist items _must_ be updated for the enhancement to be released. |
| 70 | +--> |
| 71 | + |
| 72 | +- [ ] Enhancement issue in release milestone, which links to pull request in [keylime/enhancements] |
| 73 | +- [ ] Core members have approved the issue with the label `implementable` |
| 74 | +- [ ] Design details are appropriately documented |
| 75 | +- [ ] Test plan is in place |
| 76 | +- [ ] User-facing documentation has been created in [keylime/keylime-docs] |
| 77 | + |
| 78 | +<!-- |
| 79 | +**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone. |
| 80 | +--> |
| 81 | + |
| 82 | +## Summary |
| 83 | + |
| 84 | +<!-- |
| 85 | +This section is incredibly important for producing high quality user-focused |
| 86 | +documentation such as release notes or a development roadmap. It should be |
| 87 | +possible to collect this information before implementation begins in order to |
| 88 | +avoid requiring implementers to split their attention between writing release |
| 89 | +notes and implementing the feature itself. Reviewers |
| 90 | +should help to ensure that the tone and content of the `Summary` section is |
| 91 | +useful for a wide audience. |
| 92 | +
|
| 93 | +A good summary is probably at least a paragraph in length. |
| 94 | +--> |
| 95 | + |
| 96 | +IMA's policy implements support for policy rules that cause keys loaded onto kernel |
| 97 | +keyrings to be logged in the IMA measurement log in 'ima-buf' entries. This now |
| 98 | +provides the opportunity to also learn the keys that IMA is using for signature verification |
| 99 | +from these 'ima-buf' entries, where the DER-encoded public key is reported as part |
| 100 | +of the measurement log entry. The learned keys can then be used to verify the |
| 101 | +subsequent signatures found in the log. |
| 102 | + |
| 103 | + |
| 104 | +## Motivation |
| 105 | + |
| 106 | +Recent extensions to Keylime's allowlist (policy) enable Keylime to verify 'ima-buf' |
| 107 | +entries similar to verifying file entries and their allowed hashes. If IMA is now |
| 108 | +reporting keys loaded onto keyrings then the allowlist must have the corresponding |
| 109 | +entries for the keyrings, otherwise the system will fail log verification. |
| 110 | +Having these entries in the allowlist implies that the system administrator agrees |
| 111 | +to the list of keys being loaded and therefore Keylime can also learn which keys are |
| 112 | +used by a given system for signature verification and also use those keys from the |
| 113 | +measurement log to verify the signatures itself rather than the administrator having |
| 114 | +to provide the keys. |
| 115 | + |
| 116 | +<!-- |
| 117 | +This section is for explicitly listing the motivation, goals and non-goals of |
| 118 | +this enhancement. Describe why the change is important and the benefits to users. |
| 119 | +--> |
| 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 | +The goal of this enhancement is to make the management of IMA signature verification |
| 129 | +keys easier. Since a system administrator has to provide allowed keys' hashes in |
| 130 | +the allowlist already he should not have to provide the IMA signature verification |
| 131 | +keys for Keylime to be able to verify file signatures. |
| 132 | + |
| 133 | +### Non-Goals |
| 134 | + |
| 135 | +<!-- |
| 136 | +What is out of scope for this enhancement? Listing non-goals helps to focus discussion |
| 137 | +and make progress. |
| 138 | +--> |
| 139 | + |
| 140 | +## Proposal |
| 141 | + |
| 142 | +<!-- |
| 143 | +This is where we get down to the specifics of what the proposal actually is. |
| 144 | +This should have enough detail that reviewers can understand exactly what |
| 145 | +you're proposing, but should not include things like API designs or |
| 146 | +implementation. The "Design Details" section below is for the real |
| 147 | +nitty-gritty. |
| 148 | +--> |
| 149 | + |
| 150 | +Based on data from the 'ima-buf' log entries where IMA reports keys loaded |
| 151 | +onto a system's keyrings, Keylime will learn which keyrings are in use |
| 152 | +on a system and can then model those keyrings and the keys associated with |
| 153 | +them. It can then use those keys for signature verification. |
| 154 | + |
| 155 | +The modeled keys and keyrings will be persisted in the database to support |
| 156 | +incremental attestation. |
| 157 | + |
| 158 | +### User Stories (optional) |
| 159 | + |
| 160 | +<!-- |
| 161 | +Detail the things that people will be able to do if this enhancement is implemented. |
| 162 | +Include as much detail as possible so that people can understand the "how" of |
| 163 | +the system. The goal here is to make this feel real for users without getting |
| 164 | +bogged down. |
| 165 | +--> |
| 166 | + |
| 167 | +#### Story 1 |
| 168 | + |
| 169 | +A system administrator using an IMA policy rule like the following does not |
| 170 | +need to manage a system's IMA signature verification keys anymore since Keylime |
| 171 | +will learn about the existence of the .ima keyring and the keys loaded onto it. |
| 172 | + |
| 173 | + measure func=KEY_CHECK keyrings=.ima |
| 174 | + |
| 175 | +### Notes/Constraints/Caveats (optional) |
| 176 | + |
| 177 | +<!-- |
| 178 | +What are the caveats to the proposal? |
| 179 | +What are some important details that didn't come across above. |
| 180 | +Go in to as much detail as necessary here. |
| 181 | +This might be a good place to talk about core concepts and how they relate. |
| 182 | +--> |
| 183 | + |
| 184 | +### Risks and Mitigations |
| 185 | + |
| 186 | +<!-- |
| 187 | +What are the risks of this proposal and how do we mitigate. Think broadly. |
| 188 | +For example, consider both security and how this will impact the larger |
| 189 | +enhancement ecosystem. |
| 190 | +
|
| 191 | +How will security be reviewed and by whom? |
| 192 | +--> |
| 193 | + |
| 194 | +## Design Details |
| 195 | + |
| 196 | +<!-- |
| 197 | +This section should contain enough information that the specifics of your |
| 198 | +change are understandable. This may include API specs (though not always |
| 199 | +required) or even code snippets. If there's any ambiguity about HOW your |
| 200 | +proposal will be implemented, this is the place to discuss them. |
| 201 | +--> |
| 202 | + |
| 203 | +The Keyime database will need to be extended with a column for storing |
| 204 | +the keyrings and keys learned from the IMA log. |
| 205 | +Every time a system is attestated to starting with log entry 0 the previously |
| 206 | +learned keyring and keys are discarded since the IMA log is expected to |
| 207 | +again report the keyrings and keys. |
| 208 | + |
| 209 | +### Test Plan |
| 210 | + |
| 211 | +<!-- |
| 212 | +**Note:** *Not required until targeted at a release.* |
| 213 | +
|
| 214 | +Consider the following in developing a test plan for this enhancement: |
| 215 | +- Will there be e2e and integration tests, in addition to unit tests? |
| 216 | +- How will it be tested in isolation vs with other components? |
| 217 | +
|
| 218 | +No need to outline all of the test cases, just the general strategy. Anything |
| 219 | +that would count as tricky in the implementation and anything particularly |
| 220 | +challenging to test should be called out. |
| 221 | +
|
| 222 | +All code is expected to have adequate tests (eventually with coverage |
| 223 | +expectations). |
| 224 | +--> |
| 225 | + |
| 226 | +### Upgrade / Downgrade Strategy |
| 227 | + |
| 228 | +<!-- |
| 229 | +If applicable, how will the component be upgraded and downgraded? Make sure |
| 230 | +this is in the test plan. |
| 231 | +
|
| 232 | +Consider the following in developing an upgrade/downgrade strategy for this enhancement |
| 233 | +--> |
| 234 | + |
| 235 | +The keylime database will be upgradable and downgradable with an |
| 236 | +SQL Alchemy script. |
| 237 | + |
| 238 | +### Dependencie requirements |
| 239 | + |
| 240 | +<!-- |
| 241 | +If your new change requires new dependencies, please outline and demonstrate that your selected dependency |
| 242 | +is well maintained and packaged in Keylime's supported Operating Systems (currently Debian Stable |
| 243 | +and as of time writing Fedora 32/33). |
| 244 | +
|
| 245 | +During code implementation you will also be expected to add the package to CI , the keylime ansible role and |
| 246 | +keylimes main installer (`keylime/installers.sh`). |
| 247 | +
|
| 248 | +If the package is not available in the supported Operated systems, the PR will not be merged into master. |
| 249 | +
|
| 250 | +Adding the package in `requirements.txt` is not sufficent for master which is where we tag releases from. |
| 251 | +
|
| 252 | +You may however be able to work within an experimental branch until a package is made available. If this is |
| 253 | +the case, please outline it in this enhancement. |
| 254 | +
|
| 255 | +--> |
| 256 | + |
| 257 | +No new dependencies will be introduced. |
| 258 | + |
| 259 | +## Drawbacks |
| 260 | + |
| 261 | +<!-- |
| 262 | +Why should this enhancement _not_ be implemented? |
| 263 | +--> |
| 264 | + |
| 265 | +None known. |
| 266 | + |
| 267 | +## Alternatives |
| 268 | + |
| 269 | +<!-- |
| 270 | +What other approaches did you consider and why did you rule them out? These do |
| 271 | +not need to be as detailed as the proposal, but should include enough |
| 272 | +information to express the idea and why it was not acceptable. |
| 273 | +--> |
| 274 | + |
| 275 | +If a system administrator does not provide this type of an IMA policy rule then |
| 276 | +he/she will have to provide the IMA signature verification keys as before. |
| 277 | + |
| 278 | +## Infrastructure Needed (optional) |
| 279 | + |
| 280 | +<!-- |
| 281 | +Use this section if you need things infrastructure related specific to your enhancement. Examples include a |
| 282 | +new subproject, repos requested, github webhook, changes to CI (travis). |
| 283 | +--> |
0 commit comments