summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.ibm.com>2023-04-28 08:23:14 -0400
committerArmin Kuster <akuster808@gmail.com>2023-05-06 07:54:09 -0400
commitb9abf0e09bfea8f08cc7f2d68998f014abba5b3b (patch)
tree0d593215195952055dddbcd6f09cd11cc7624a79
parent76f1f539a678725211283294c8b6735186055694 (diff)
downloadmeta-security-b9abf0e09bfea8f08cc7f2d68998f014abba5b3b.tar.gz
integrity: Update the README for IMA support
Update the README describing how IMA support can be used. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-integrity/README.md20
1 files changed, 11 insertions, 9 deletions
diff --git a/meta-integrity/README.md b/meta-integrity/README.md
index 816b40d..1a37280 100644
--- a/meta-integrity/README.md
+++ b/meta-integrity/README.md
@@ -76,7 +76,7 @@ other layers needed. e.g.:
76 76
77It has some dependencies on a suitable BSP; in particular the kernel 77It has some dependencies on a suitable BSP; in particular the kernel
78must have a recent enough IMA/EVM subsystem. The layer was tested with 78must have a recent enough IMA/EVM subsystem. The layer was tested with
79Linux 3.19 and uses some features (like loading X509 certificates 79Linux 6.1 and uses some features (like loading X509 certificates
80directly from the kernel) which were added in that release. Your 80directly from the kernel) which were added in that release. Your
81mileage may vary with older kernels. 81mileage may vary with older kernels.
82 82
@@ -89,10 +89,17 @@ Adding the layer only enables IMA (see below regarding EVM) during
89compilation of the Linux kernel. To also activate it when building 89compilation of the Linux kernel. To also activate it when building
90the image, enable image signing in the local.conf like this: 90the image, enable image signing in the local.conf like this:
91 91
92 DISTRO_FEATURES:append = " integrity ima"
93
92 IMAGE_CLASSES += "ima-evm-rootfs" 94 IMAGE_CLASSES += "ima-evm-rootfs"
95
93 IMA_EVM_KEY_DIR = "${INTEGRITY_BASE}/data/debug-keys" 96 IMA_EVM_KEY_DIR = "${INTEGRITY_BASE}/data/debug-keys"
94 IMA_EVM_PRIVKEY = "${IMA_EVM_KEY_DIR}/privkey_ima.pem" 97 IMA_EVM_PRIVKEY = "${IMA_EVM_KEY_DIR}/privkey_ima.pem"
95 IMA_EVM_X509 = "${IMA_EVM_KEY_DIR}/x509_ima.der" 98 IMA_EVM_X509 = "${IMA_EVM_KEY_DIR}/x509_ima.der"
99 IMA_EVM_ROOT_CA = "${IMA_EVM_KEY_DIR}/ima-local-ca.pem"
100
101 # The following policy enforces IMA & EVM signatures
102 IMA_EVM_POLICY = "${INTEGRITY_BASE}/recipes-security/ima_policy_appraise_all/files/ima_policy_appraise_all"
96 103
97This uses the default keys provided in the "data" directory of the layer. 104This uses the default keys provided in the "data" directory of the layer.
98Because everyone has access to these private keys, such an image 105Because everyone has access to these private keys, such an image
@@ -113,10 +120,7 @@ for that are included in the layer. This is also how the
113 cd $IMA_EVM_KEY_DIR 120 cd $IMA_EVM_KEY_DIR
114 # In that shell, create the keys. Several options exist: 121 # In that shell, create the keys. Several options exist:
115 122
116 # 1. Self-signed keys. 123 # 1. Keys signed by a new CA.
117 $INTEGRITY_BASE/scripts/ima-gen-self-signed.sh
118
119 # 2. Keys signed by a new CA.
120 # When asked for a PEM passphrase, that will be for the root CA. 124 # When asked for a PEM passphrase, that will be for the root CA.
121 # Signing images then will not require entering that passphrase, 125 # Signing images then will not require entering that passphrase,
122 # only creating new certificates does. Most likely the default 126 # only creating new certificates does. Most likely the default
@@ -125,13 +129,11 @@ for that are included in the layer. This is also how the
125 # $INTEGRITY_BASE/scripts/ima-gen-local-ca.sh 129 # $INTEGRITY_BASE/scripts/ima-gen-local-ca.sh
126 # $INTEGRITY_BASE/scripts/ima-gen-CA-signed.sh 130 # $INTEGRITY_BASE/scripts/ima-gen-CA-signed.sh
127 131
128 # 3. Keys signed by an existing CA. 132 # 2. Keys signed by an existing CA.
129 # $INTEGRITY_BASE/scripts/ima-gen-CA-signed.sh <CA.pem> <CA.priv> 133 # $INTEGRITY_BASE/scripts/ima-gen-CA-signed.sh <CA.pem> <CA.priv>
130 exit 134 exit
131 135
132When using ``ima-self-signed.sh`` as described above, self-signed keys 136The ``ima-gen-local-ca.sh`` and ``ima-gen.sh`` scripts create a root CA
133are created. Alternatively, one can also use keys signed by a CA. The
134``ima-gen-local-ca.sh`` and ``ima-gen.sh`` scripts create a root CA
135and sign the signing keys with it. The ``ima-evm-rootfs.bbclass`` then 137and sign the signing keys with it. The ``ima-evm-rootfs.bbclass`` then
136supports adding tha CA's public key to the kernel's system keyring by 138supports adding tha CA's public key to the kernel's system keyring by
137compiling it directly into the kernel. Because it is unknown whether 139compiling it directly into the kernel. Because it is unknown whether