• Roberto Sassu's avatar
    ima: Allow imasig requirement to be satisfied by EVM portable signatures · 7aa5783d
    Roberto Sassu authored
    System administrators can require that all accessed files have a signature
    by specifying appraise_type=imasig in a policy rule.
    
    Currently, IMA signatures satisfy this requirement. Appended signatures may
    also satisfy this requirement, but are not applicable as IMA signatures.
    IMA/appended signatures ensure data source authentication for file content
    and prevent any change. EVM signatures instead ensure data source
    authentication for file metadata. Given that the digest or signature of the
    file content must be included in the metadata, EVM signatures provide the
    same file data guarantees of IMA signatures, as well as providing file
    metadata guarantees.
    
    This patch lets systems protected with EVM signatures pass appraisal
    verification if the appraise_type=imasig requirement is specified in the
    policy. This facilitates deployment in the scenarios where only EVM
    signatures are available.
    
    The patch makes the following changes:
    
    file xattr types:
    security.ima: IMA_XATTR_DIGEST/IMA_XATTR_DIGEST_NG
    security.evm: EVM_XATTR_PORTABLE_DIGSIG
    
    execve(), mmap(), open() behavior (with appraise_type=imasig):
    before: denied (file without IMA signature, imasig requirement not met)
    after: allowed (file with EVM portable signature, imasig requirement met)
    
    open(O_WRONLY) behavior (without appraise_type=imasig):
    before: allowed (file without IMA signature, not immutable)
    after: denied (file with EVM portable signature, immutable)
    
    In addition, similarly to IMA signatures, this patch temporarily allows
    new files without or with incomplete metadata to be opened so that content
    can be written.
    Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    7aa5783d
ima_appraise.c 15.9 KB