Commit Graph

20 Commits (b80ee080937ce364f7324c297f23e40af6d88892)

Author SHA1 Message Date
Harald Hoyer 09356085b6 ci: enable shellcheck for everything 2021-03-31 11:31:17 +02:00
Harald Hoyer 895dd4eb25 fix(integrity): shellcheck for modules.d/98integrity 2021-03-29 11:21:13 +02:00
Harald Hoyer 9a52c3fdb0 style: shfmt reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w .
```
2021-03-13 20:10:43 +01:00
Petr Vorel cd181d2c4c doc: Fix integrity key name
Default value of EVMKEYDESC (in evm-enable.sh) is "evm-key" and it's
also specified previously in this README file.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2019-08-29 10:21:22 +00:00
Sullivan (CTR), Austin e0ec6f10d4 Fixed issue #420 2018-07-02 12:42:32 +02:00
Matthias Gerstner f48fb6f4ce 98integrity: support X.509-only EVM configuration
Previously if no symmetric key was configured for EVM, then the
initialization process was aborted. It can be a valid use case, however,
to only use EVM digital signatures. In this case only X.509 certificates
need to be loaded.

With this change EVM initialization will continue if any of the
symmetric or X.509 keys could be loaded.
2018-01-25 12:15:36 +01:00
Matthias Gerstner cb02ff635c 98integrity: support loading x509 into the trusted/builtin .evm keyring
This implements logic analogous to the one already implemented in
ima-keys-load.sh, only for the .evm/_evm keyrings.

If the kernel was built with CONFIG_IMA_TRUSTED_KEYRING then the kernel
initially creates and configures .ima and .evm keyrings. These keyrings
only accept x509 certificates that have been signed by a local CA which
belongs to the kernel builtin trusted keyring.

Thus if such a keyring is already present then additional evm keys
should be loaded into them. If this is not the case then the _evm
keyring needs to be created in userspace and keys will be loaded into
it instead.

Before this change dracut always created the _evm keyring and loaded
keys into it without considering an existing .evm keyring. In case of
CONFIG_IMA_TRUSTED_KEYRING being enabled, the _evm keyring will not be
used by the kernel, however, and EVM digital signatures will not work as
expected.
2018-01-25 12:15:36 +01:00
Matthias Gerstner a1c1be4f3e 98integrity: fix inconsistent whitespace 2018-01-25 12:15:36 +01:00
Jason Dana ab66ef2d4a Check the proper variable for a custom IMA keys directory 2017-04-27 07:55:58 -04:00
Harald Hoyer fc44fdb5ac integrity/ima-policy-load.sh: s/echo -n/printf 2016-10-20 13:58:25 +02:00
Stefan Berger 479b5cd94f 98integrity: support validating the IMA policy file signature
IMA validates file signatures based on the security.ima xattr. As of
Linux-4.7, instead of cat'ing the IMA policy into the securityfs policy,
the IMA policy pathname can be written, allowing the IMA policy file
signature to be validated.

This patch first attempts to write the pathname, but on failure falls
back to cat'ing the IMA policy contents .

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2016-10-13 23:02:40 +02:00
Mimi Zohar 41ac16b26f Define new script to load keys on the IMA keyring (update)
This patch supports loading keys either on the _ima keyring or, as of
Linux 3.17, on the trusted .ima keyring.  Only certificates signed by
a key on the system keyring can be loaded onto the trusted .ima keyring.

Changelog:
- Update 98integrity/README
2015-08-03 12:36:05 +02:00
Mimi Zohar 396d3cc7ff Extend evm-enable.sh to load the EVM public key
Create the _evm keyring and load the EVM public key on it.
2015-08-03 12:36:05 +02:00
Mimi Zohar b05ad85b0c Remove 98integrity's dependency on selinux
Loading the EVM key(s) is not dependent on selinux.  Remove
the dependency.
2015-08-03 12:36:05 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer 56a4cffd30 98integrity/module-setup.sh: depend on selinux dracut module 2012-02-13 18:17:40 +01:00
Harald Hoyer 16457c869d mount securityfs in a seperate dracut module 2011-09-20 11:16:53 +02:00
Harald Hoyer 5ce355f6c0 turn off masterkey,ecryptfs,integrity by default 2011-08-11 14:27:26 +02:00
Roberto Sassu 0c71fb672f dracut: added new module integrity
This module initializes the EVM software and permits to load a custom IMA
policy.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2011-07-28 15:01:34 +02:00