From 8cdac3a9c1dab4e3b8c8afc68f51baa45d1ce6d4 Mon Sep 17 00:00:00 2001 From: Luke Hinds Date: Thu, 20 Oct 2022 06:05:48 +0100 Subject: [PATCH 1/5] Add ignore path option Signed-off-by: Luke Hinds --- 91-ignore-path-for-ima.md | 259 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 91-ignore-path-for-ima.md diff --git a/91-ignore-path-for-ima.md b/91-ignore-path-for-ima.md new file mode 100644 index 0000000..2f38e28 --- /dev/null +++ b/91-ignore-path-for-ima.md @@ -0,0 +1,259 @@ + +# enhancement-NNNN: Your short, descriptive title + + + + + + +- [Release Signoff Checklist](#release-signoff-checklist) +- [Summary](#summary) +- [Motivation](#motivation) + - [Goals](#goals) + - [Non-Goals](#non-goals) +- [Proposal](#proposal) + - [User Stories (optional)](#user-stories-optional) + - [Story 1](#story-1) + - [Story 2](#story-2) + - [Notes/Constraints/Caveats (optional)](#notesconstraintscaveats-optional) + - [Risks and Mitigations](#risks-and-mitigations) +- [Design Details](#design-details) + - [Test Plan](#test-plan) + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure Needed (optional)](#infrastructure-needed-optional) + + +## Release Signoff Checklist + + + +- [ ] Enhancement issue in release milestone, which links to pull request in [keylime/enhancements] +- [ ] Core members have approved the issue with the label `in-progress` +- [ ] Design details are appropriately documented +- [ ] Test plan is in place +- [ ] User-facing documentation has been created in [keylime/keylime-docs] + + + +## Summary + + + +It may not always be evident to a user on what the final location of a file may +be. This enhancement proposes a new config value that allows a user to have IMA +measurements ignore the location of a file and only work with the filename +itself. + +## Motivation + + + +Some systems may have files that are in different locations depending on the +system. For example, a file may be in `/usr/bin` on one system and `/bin` on +another. This can cause issues with IMA measurements as the location of the file +is included in the measurement. This enhancement proposes a new config value +that allows a user to have IMA measurements ignore the location of a file and +only work with the filename itself. + +### Goals + + + +Allow users to only state a filename to be measured and not the full path. + +### Non-Goals + + + +## Proposal + + + +A value `ignore-path` is introduced to the `keylime.conf` file. When this value +is set to `True`, the location of a file is ignored when performing IMA +measurements on the verifier. + +### User Stories (optional) + + + +I have a system that has a file that is in different locations depending on the +deployment. I want to measure this file but I don't want to have to specify the +full path to the file, as the value is arbitrary. + +#### Story 1 + +#### Story 2 + +### Notes/Constraints/Caveats (optional) + + + +### Risks and Mitigations + + + +## Design Details + + + +The `ignore-path` value is added to the `keylime.conf` file. When this value is +set to `True`, the location of a file is ignored + +This will be set as False by default, meaning it is an opt-in feature. + +### Test Plan + + + +### Upgrade / Downgrade Strategy + + + +### Dependencie requirements + + + +## Drawbacks + + + +## Alternatives + + + +## Infrastructure Needed (optional) + + From e55675e05ab11ea9a2313389ea797fdf9aadd7b1 Mon Sep 17 00:00:00 2001 From: Luke Hinds Date: Thu, 20 Oct 2022 06:16:07 +0100 Subject: [PATCH 2/5] Change to optional-paths Signed-off-by: Luke Hinds --- 91-ignore-path-for-ima.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/91-ignore-path-for-ima.md b/91-ignore-path-for-ima.md index 2f38e28..666183e 100644 --- a/91-ignore-path-for-ima.md +++ b/91-ignore-path-for-ima.md @@ -95,7 +95,7 @@ A good summary is probably at least a paragraph in length. It may not always be evident to a user on what the final location of a file may be. This enhancement proposes a new config value that allows a user to have IMA -measurements ignore the location of a file and only work with the filename +measurements with a full path and only work with the filename itself. ## Motivation @@ -106,11 +106,15 @@ this enhancement. Describe why the change is important and the benefits to user --> Some systems may have files that are in different locations depending on the -system. For example, a file may be in `/usr/bin` on one system and `/bin` on -another. This can cause issues with IMA measurements as the location of the file -is included in the measurement. This enhancement proposes a new config value -that allows a user to have IMA measurements ignore the location of a file and -only work with the filename itself. +deployment. For example, a file may be in `/opt/my_app` on one system and +`/usr/my_app` on another. This can cause issues with IMA measurements as the +location of the file is included in the allowlist. This enhancement proposes +a new config value that allows a user to have keylime IMA ignore the path of a +file and only work with the filename itself. + +This will especially be useful for users who want an application monitored by +keylime to be able to be deployed in different locations, more than an entire +OS. ### Goals @@ -138,9 +142,10 @@ implementation. The "Design Details" section below is for the real nitty-gritty. --> -A value `ignore-path` is introduced to the `keylime.conf` file. When this value -is set to `True`, the location of a file is ignored when performing IMA -measurements on the verifier. +A value `optional-paths` is introduced to the `keylime.conf` file. When this value +is set to `True`, if a file is without a leading POSIX path separator then the +file is still measured. If the file has a leading POSIX path separator then the +file is measured still, as per the current behaviour. ### User Stories (optional) @@ -151,9 +156,9 @@ the system. The goal here is to make this feel real for users without getting bogged down. --> -I have a system that has a file that is in different locations depending on the -deployment. I want to measure this file but I don't want to have to specify the -full path to the file, as the value is arbitrary. +I have a system that has a file that may be situated in an arbitary location +depending on the deployment. I want to measure this file but I don't want to +have to specify the full path to the file. #### Story 1 @@ -187,8 +192,10 @@ required) or even code snippets. If there's any ambiguity about HOW your proposal will be implemented, this is the place to discuss them. --> -The `ignore-path` value is added to the `keylime.conf` file. When this value is -set to `True`, the location of a file is ignored +The `optional-paths` value is added to the `keylime.conf` file. When this value is +set to `True`, the location of a file is ignored if no proceeding POSIX path is +specified. If a proceeding POSIX path is specified, the file is measured as per +the current behaviour. This will be set as False by default, meaning it is an opt-in feature. From b4d9fb0f260cf007090ee287ea20587348148082 Mon Sep 17 00:00:00 2001 From: Luke Hinds Date: Thu, 20 Oct 2022 06:26:08 +0100 Subject: [PATCH 3/5] Improve wording Signed-off-by: Luke Hinds --- 91-ignore-path-for-ima.md | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/91-ignore-path-for-ima.md b/91-ignore-path-for-ima.md index 666183e..548a32b 100644 --- a/91-ignore-path-for-ima.md +++ b/91-ignore-path-for-ima.md @@ -94,9 +94,9 @@ A good summary is probably at least a paragraph in length. --> It may not always be evident to a user on what the final location of a file may -be. This enhancement proposes a new config value that allows a user to have IMA -measurements with a full path and only work with the filename -itself. +be when creating an allowlist. This enhancement proposes a new config value +that allows a user to work with both filenames with an arbitrary path, alongside +the current behavior of a full path set. ## Motivation @@ -106,15 +106,19 @@ this enhancement. Describe why the change is important and the benefits to user --> Some systems may have files that are in different locations depending on the -deployment. For example, a file may be in `/opt/my_app` on one system and -`/usr/my_app` on another. This can cause issues with IMA measurements as the -location of the file is included in the allowlist. This enhancement proposes -a new config value that allows a user to have keylime IMA ignore the path of a -file and only work with the filename itself. +deployment. For example, a file `widgets` may be in `/opt/my_app` on one system +and `/usr/my_app` on another. This enhancement proposes a new config value that +allows a user to have keylime IMA ignore the path of a file if not present. This will especially be useful for users who want an application monitored by -keylime to be able to be deployed in different locations, more than an entire -OS. +keylime that may deploy to different systems with different paths. + +It would then allow an upstream project to generate signed allowlists that can +be used by downstream systems without having to modify the allowlist to set +deployment specific paths. + +However, those wanting the stronger guarantees of a full path set will still be +able to leverage that behavior. ### Goals @@ -123,7 +127,8 @@ List the specific goals of the enhancement. What is it trying to achieve? How know that this has succeeded? --> -Allow users to only state a filename to be measured and not the full path. +Allow users to only state a filename to be measured and not always the full +path. ### Non-Goals @@ -142,10 +147,11 @@ implementation. The "Design Details" section below is for the real nitty-gritty. --> -A value `optional-paths` is introduced to the `keylime.conf` file. When this value -is set to `True`, if a file is without a leading POSIX path separator then the -file is still measured. If the file has a leading POSIX path separator then the -file is measured still, as per the current behaviour. +A bool config value `optional-paths` is introduced to the `keylime.conf` file. +When this value is set to `True`, if a file is without a leading POSIX path +then the file is still measured. If the file has a leading POSIX path separator +then the file is measured, as per the current behaviour, where the full path +dictates the comparision of the allowlist value to that recorded by IMA. ### User Stories (optional) From 0e57c98ba7d6c1f632713c71394b8df13dadae33 Mon Sep 17 00:00:00 2001 From: Luke Hinds Date: Thu, 20 Oct 2022 06:31:38 +0100 Subject: [PATCH 4/5] Add case for duplicates Signed-off-by: Luke Hinds --- 91-ignore-path-for-ima.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/91-ignore-path-for-ima.md b/91-ignore-path-for-ima.md index 548a32b..e255b06 100644 --- a/91-ignore-path-for-ima.md +++ b/91-ignore-path-for-ima.md @@ -205,6 +205,14 @@ the current behaviour. This will be set as False by default, meaning it is an opt-in feature. +If a file is specified without a file path, alongside a duplicate filename with +a path, the file with the file path will be measured and the file without the +file path will be ignored. + +e.g. + +`as983o... widget` will be ignored if `as983o... /opt/my_app/widget` is present. + ### Test Plan -# enhancement-NNNN: Your short, descriptive title +# enhancement-91: Optional Path for IMA measurement