A Simple Protocol for Remote Attestation of System Integrity

A Simple Protocol for Remote Attestation of System Integrity

26/10/2018 A Simple Protocol for Remote Attestation of System Integrity Roberto Sassu Cyber Security and Privacy Lab (CSPL) Linux Security Summit Europe 2018 Outline • Problem • Background • Our Proposal • Conclusions 2 Remote Attestation – Problem Remote attestation (RA) definition: integrity evaluation done by a remote verifier to check whether a system can accomplish its tasks as expected Evaluating the integrity of OS (kernel + applications + their state) is very complex • Reference measurements and verification services are not available • It is unclear what information must be supplied to verifiers and how to analyze them RA cannot be easily integrated into existing products because • A dedicated server must be added to the infrastructure • Two separate protocols must be implemented for secure communication and attestation 3 Background Integrity is the expectation that a system/application behaves as defined by the developer Measurement from Core Root of Trust for Measurement (CRTM) up to the application Measurement at OS-level (Linux) is done by Integrity Measurement Architecture (IMA) Evaluation done by comparing actual measurements with reference values 4 Background – Explicit RA PCR: Platform Configuration Register TPM current PCR value IMA measurement list tpm_pcr_extend() Hash 000… 012… PCR Digest Component measurement 10 012… systemd Hash … 345… 10 345… udev 10 678… sshd Hash … 678… … RA agent measurement remote attestation dedicated protocol 5 Verifier Background – Implicit RA PCR: Platform Configuration Register TPM current PCR value IMA measurement list tpm_pcr_extend() Hash 000… 012… PCR Digest Component measurement 10 012… systemd Hash … 345… 10 345… udev key generation 10 678… sshd Hash … 678… with desired PCR value TPM … … from repository or == key TLS extension X.509 extension (only once) [TCG Subject Key cryptolib Attestation Evidence (SKAE)] measurement remote attestation TLS 6 Management System (Verifier) certificate Simple RA Protocol with Implicit RA Implicit RA is more suitable for integration into existing products, as it only requires • Switching from software keys to TPM keys • An additional verification of an X.509 extension (SKAE) Problem: IMA PCR is not predictable • Depends on which and when files are executed • Depends on the content of mutable files Solution: make IMA PCR predictable • IMA Digest lists extension to address unpredictable file access • Enhanced Policy-Reduced Integrity Measurement Architecture (PRIMA) to handle mutable files 7 IMA Digest Lists (NEW) don’t store measurement if file digest is known by IMA measurement list measurement list PCR Digest Digest Flags PCR Digest IMA 10 … /bin/bash immutable IMA 11 digest lists 10 … … 11 … always store measurement (NEW) digest lists (whitelists) (NEW) store measurement preloaded at kernel init if file digest is unknown kernel space kernel space user space user space open open /bin/bash /bin/bash current behavior (PCR #10) current behavior (PCR #10) new behavior (PCR #11) 8 Mutable Files in the IMA Measurement List PCR Digest Component 11 known digest lists systemd sshd ? ? 11 unknown mutable file IMA measurement list mutable files ? ? insecure Verification fails udev app How to deal with mutable files? 9 Alternative Solution for Evaluation of Mutable Files Evaluate the processes writing mutable files, instead of measuring them systemd sshd ? ? If processes are not compromised, they mutable HMAC files must have updated mutable files correctly ? ? insecure udev app Protect mutable files against offline attacks with an HMAC (key not sealed to OS!) 10 Unknown Impact of Process Actions without MAC Without Mandatory Access Control all applications with enough privileges systemd sshd can update mutable files ? ? mutable HMAC files bug ? ? insecure udev app Some applications are more susceptible to attacks during execution and can be used as an entry point 11 True System State Differs from Reported State bug bug An attacker can exploit an insecure pipe/ app and make it produce malicious systemd socket sshd ? ? byte sequences mutable 010101… HMAC files These byte sequences can be bug bug used to exploit bugs in other ? ? insecure udev apps, without being detected app Offline protection (HMAC) does not help to detect such malicious file modifications 12 Protect Mutable Files with Mandatory Access Control MAC can protect the critical part of the system (TCB) by enforcing an integrity MAC policy, such as Biba or Clark-Wilson systemd sshd Mutable files inside the TCB can be written mutable HMAC only by the TCB files bug insecure udev TCB app MAC and integrity policy become part of the evidence to be sent to verifiers [1] [1] Policy-Reduced Integrity Measurement Architecture (PRIMA) Trent Jaeger, Reiner Sailer, and Umesh Shankar 13 Integrity Models – Biba vs Clark-Wilson High integrity Read from filtering interface allowed if Low integrity code can reliably handle malicious data subject subject subject subject object object object object filtering interface subject subject subject Biba model Clark-Wilson model 14 PRIMA Overview and Drawbacks PRIMA finds from the SELinux policy a minimal TCB that satisfies Clark-Wilson requirements Only code and immutable files that belong to the TCB must be measured Drawbacks that limit application in the industry • Unlikely to find a small TCB • A generic policy (e.g. in Fedora) considers all the possible application usage scenarios • ~100,000 allow rules, only ~2.5% of rules are requested by a running system • TCB must be adapted for each specific use case • Offline attacks are not taken into account 15 Our Proposal to Simplify and Complete PRIMA • Reduce TCB size by considering processes interactions discovered on the target system • With a new Linux Security Module (LSM), called Infoflow LSM • Detect malicious updates of mutable files throughout their entire lifetime • PRIMA does not guarantee that TCB protection was enabled before reboot 16 Reduce TCB size Example: information flow analysis for sshd (included in the TCB) sshd_key_t common perms etc_t sshd_t ftpd_t With PRIMA, Kerberos5 would be specific krb5_conf_t added to the TCB (high risk) or would perms read have to be manually excluded write realmd_t (too much effort) Permissions taken from SELinux policy of Fedora 27 17 Reduce TCB size Example: information flow analysis for sshd (included in the TCB) sshd_key_t common perms etc_t sshd_t ftpd_t specific With our proposal, Kerberos5 is krb5_conf_t perms automatically excluded realmd_t (Kerberos5 disabled) write Permissions taken from SELinux policy of Fedora 27 18 Detect Malicious Updates of Mutable Files State of the art • IMA Appraisal/EVM protect the integrity of data/metadata against offline attacks • EVM key is sealed with TPM, but not to OS (IMA PCR unpredictable) • EVM key can be used when TCB protection is disabled Our proposal • Seal EVM key to predictable IMA PCR, extended with digest lists and integrity policy • EVM key can be used only when TCB protection is enabled • If TCB protection is disabled, the unsealed EVM key is erased before integrity violations • A valid HMAC implies that the mutable file was updated by the TCB and code/data was known • With this guarantee, mutable files can be excluded from measurement 19 Exclude Mutable Files from Measurement (NEW) don’t store measurement if HMAC is valid and EVM key is sealed to OS measurement list measurement list PCR Digest PCR Digest IMA 10 … IMA 11 digest lists 10 … 11 integrity policy always store (NEW) store measurement if measurement access denied HMAC is missing or invalid if appraisal is kernel space enabled kernel space user space user space open open audit.log HMAC audit.log HMAC current behavior (PCR #10) current behavior (PCR #10) new behavior (PCR #11) 20 Chained Integrity Verification across Reboots Administrator Insecure: key not generated by TPM, or bound to different policy event log (untrusted) PCR Component Insecure good 11 Digest lists/policy EVM key system 12 Insecure EVM key PCR Component EVM key deleted bad 11 Digest lists/policy unsealing read system EVM key EVM key 12 EVM key write 11 Corrupted file Verifier mutable HMAC vN file vN PCR Component unknown good attack good 11 Digest lists/policy system system read system 12 EVM key write write mutable HMAC v1 mutable HMAC vN file v1 HMAC v1 file vN 1st boot Nth boot 21 Setup phase Deployment phase Implicit RA – Verification Options Certificate 2. verify attestation data Authority 1. send CSR 3. return certificate PCR Component Data 11 Digest Digest lists lists/policy Integrity policy 12 EVM key AIK certificate Option 1: trust CA system cryptolib TPM 4. secure communication Management protocol System (Verifier) TPM key Option 2: verify SKAE with event log and data (from a repository/protocol extension) only once 22 Infoflow LSM Implementation – Setup Phase (NEW) Infoflow LSM (discover) SELinux 1. check 2. record SELinux policy request interaction kernel space read user space sshd_t sshd_key_t discovered Information TCB subjects rules flow analyzer and objects target apps 3. perform information Target system flow analysis administrator 23 Infoflow LSM Implementation – Deployment Phase Digest IMA Lists 5. check if digest is in the digest list Integrity (NEW) Infoflow 4. check Clark-Wilson rules policy LSM (enforce) EVM EVM 3. check metadata key TCB subjects (NEW) Infoflow 2. check if subject and object are in the TCB and objects LSM (select) SELinux SELinux 1. check request policy kernel space read user space sshd_t sshd_key_t 24 Source Code Digest lists source code •

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    28 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us