sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget /translations/zh_CN/security/ipemodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/zh_TW/security/ipemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/it_IT/security/ipemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/ja_JP/security/ipemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/ko_KR/security/ipemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/sp_SP/security/ipemodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh:/var/lib/git/docbuild/linux/Documentation/security/ipe.rsthKubhsection)}(hhh](htitle)}(h9Integrity Policy Enforcement (IPE) - Kernel Documentationh]h9Integrity Policy Enforcement (IPE) - Kernel Documentation}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhnote)}(hThis is documentation targeted at developers, instead of administrators. If you're looking for documentation on the usage of IPE, please see :doc:`IPE admin guide `.h]h paragraph)}(hThis is documentation targeted at developers, instead of administrators. If you're looking for documentation on the usage of IPE, please see :doc:`IPE admin guide `.h](hThis is documentation targeted at developers, instead of administrators. If you’re looking for documentation on the usage of IPE, please see }(hhhhhNhNubh)}(h-:doc:`IPE admin guide `h]hinline)}(hhh]hIPE admin guide}(hhhhhNhNubah}(h]h ](xrefstdstd-doceh"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]refdoc security/ipe refdomainhreftypedoc refexplicitrefwarn reftarget/admin-guide/LSM/ipeuh1hhhhKhhubh.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hhh](h)}(hHistorical Motivationh]hHistorical Motivation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK ubh)}(hXThe original issue that prompted IPE's implementation was the creation of a locked-down system. This system would be born-secure, and have strong integrity guarantees over both the executable code, and specific *data files* on the system, that were critical to its function. These specific data files would not be readable unless they passed integrity policy. A mandatory access control system would be present, and as a result, xattrs would have to be protected. This lead to a selection of what would provide the integrity claims. At the time, there were two main mechanisms considered that could guarantee integrity for the system with these requirements:h](hThe original issue that prompted IPE’s implementation was the creation of a locked-down system. This system would be born-secure, and have strong integrity guarantees over both the executable code, and specific }(hjhhhNhNubhemphasis)}(h *data files*h]h data files}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubhX on the system, that were critical to its function. These specific data files would not be readable unless they passed integrity policy. A mandatory access control system would be present, and as a result, xattrs would have to be protected. This lead to a selection of what would provide the integrity claims. At the time, there were two main mechanisms considered that could guarantee integrity for the system with these requirements:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh block_quote)}(h%1. IMA + EVM Signatures 2. DM-Verity h]henumerated_list)}(hhh](h list_item)}(hIMA + EVM Signaturesh]h)}(hjPh]hIMA + EVM Signatures}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjNubah}(h]h ]h"]h$]h&]uh1jLhjIubjM)}(h DM-Verity h]h)}(h DM-Verityh]h DM-Verity}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjeubah}(h]h ]h"]h$]h&]uh1jLhjIubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jGhjCubah}(h]h ]h"]h$]h&]uh1jAhhhKhjhhubh)}(hBoth options were carefully considered, however the choice to use DM-Verity over IMA+EVM as the *integrity mechanism* in the original use case of IPE was due to three main reasons:h](h`Both options were carefully considered, however the choice to use DM-Verity over IMA+EVM as the }(hjhhhNhNubj()}(h*integrity mechanism*h]hintegrity mechanism}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubh? in the original use case of IPE was due to three main reasons:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjB)}(hX1. Protection of additional attack vectors: * With IMA+EVM, without an encryption solution, the system is vulnerable to offline attack against the aforementioned specific data files. Unlike executables, read operations (like those on the protected data files), cannot be enforced to be globally integrity verified. This means there must be some form of selector to determine whether a read should enforce the integrity policy, or it should not. At the time, this was done with mandatory access control labels. An IMA policy would indicate what labels required integrity verification, which presented an issue: EVM would protect the label, but if an attacker could modify filesystem offline, the attacker could wipe all the xattrs - including the SELinux labels that would be used to determine whether the file should be subject to integrity policy. With DM-Verity, as the xattrs are saved as part of the Merkel tree, if offline mount occurs against the filesystem protected by dm-verity, the checksum no longer matches and the file fails to be read. * As userspace binaries are paged in Linux, dm-verity also offers the additional protection against a hostile block device. In such an attack, the block device reports the appropriate content for the IMA hash initially, passing the required integrity check. Then, on the page fault that accesses the real data, will report the attacker's payload. Since dm-verity will check the data when the page fault occurs (and the disk access), this attack is mitigated. 2. Performance: * dm-verity provides integrity verification on demand as blocks are read versus requiring the entire file being read into memory for validation. 3. Simplicity of signing: * No need for two signatures (IMA, then EVM): one signature covers an entire block device. * Signatures can be stored externally to the filesystem metadata. * The signature supports an x.509-based signing infrastructure. h](jH)}(hhh]jM)}(h)Protection of additional attack vectors: h]h)}(h(Protection of additional attack vectors:h]h(Protection of additional attack vectors:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1jLhjubah}(h]h ]h"]h$]h&]jjjhjjuh1jGhjubjB)}(hX* With IMA+EVM, without an encryption solution, the system is vulnerable to offline attack against the aforementioned specific data files. Unlike executables, read operations (like those on the protected data files), cannot be enforced to be globally integrity verified. This means there must be some form of selector to determine whether a read should enforce the integrity policy, or it should not. At the time, this was done with mandatory access control labels. An IMA policy would indicate what labels required integrity verification, which presented an issue: EVM would protect the label, but if an attacker could modify filesystem offline, the attacker could wipe all the xattrs - including the SELinux labels that would be used to determine whether the file should be subject to integrity policy. With DM-Verity, as the xattrs are saved as part of the Merkel tree, if offline mount occurs against the filesystem protected by dm-verity, the checksum no longer matches and the file fails to be read. * As userspace binaries are paged in Linux, dm-verity also offers the additional protection against a hostile block device. In such an attack, the block device reports the appropriate content for the IMA hash initially, passing the required integrity check. Then, on the page fault that accesses the real data, will report the attacker's payload. Since dm-verity will check the data when the page fault occurs (and the disk access), this attack is mitigated. h]h bullet_list)}(hhh](jM)}(hXWith IMA+EVM, without an encryption solution, the system is vulnerable to offline attack against the aforementioned specific data files. Unlike executables, read operations (like those on the protected data files), cannot be enforced to be globally integrity verified. This means there must be some form of selector to determine whether a read should enforce the integrity policy, or it should not. At the time, this was done with mandatory access control labels. An IMA policy would indicate what labels required integrity verification, which presented an issue: EVM would protect the label, but if an attacker could modify filesystem offline, the attacker could wipe all the xattrs - including the SELinux labels that would be used to determine whether the file should be subject to integrity policy. With DM-Verity, as the xattrs are saved as part of the Merkel tree, if offline mount occurs against the filesystem protected by dm-verity, the checksum no longer matches and the file fails to be read. h](h)}(hWith IMA+EVM, without an encryption solution, the system is vulnerable to offline attack against the aforementioned specific data files.h]hWith IMA+EVM, without an encryption solution, the system is vulnerable to offline attack against the aforementioned specific data files.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjubh)}(hXUnlike executables, read operations (like those on the protected data files), cannot be enforced to be globally integrity verified. This means there must be some form of selector to determine whether a read should enforce the integrity policy, or it should not.h]hXUnlike executables, read operations (like those on the protected data files), cannot be enforced to be globally integrity verified. This means there must be some form of selector to determine whether a read should enforce the integrity policy, or it should not.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubh)}(hXAt the time, this was done with mandatory access control labels. An IMA policy would indicate what labels required integrity verification, which presented an issue: EVM would protect the label, but if an attacker could modify filesystem offline, the attacker could wipe all the xattrs - including the SELinux labels that would be used to determine whether the file should be subject to integrity policy.h]hXAt the time, this was done with mandatory access control labels. An IMA policy would indicate what labels required integrity verification, which presented an issue: EVM would protect the label, but if an attacker could modify filesystem offline, the attacker could wipe all the xattrs - including the SELinux labels that would be used to determine whether the file should be subject to integrity policy.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubh)}(hWith DM-Verity, as the xattrs are saved as part of the Merkel tree, if offline mount occurs against the filesystem protected by dm-verity, the checksum no longer matches and the file fails to be read.h]hWith DM-Verity, as the xattrs are saved as part of the Merkel tree, if offline mount occurs against the filesystem protected by dm-verity, the checksum no longer matches and the file fails to be read.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubeh}(h]h ]h"]h$]h&]uh1jLhjubjM)}(hXAs userspace binaries are paged in Linux, dm-verity also offers the additional protection against a hostile block device. In such an attack, the block device reports the appropriate content for the IMA hash initially, passing the required integrity check. Then, on the page fault that accesses the real data, will report the attacker's payload. Since dm-verity will check the data when the page fault occurs (and the disk access), this attack is mitigated. h]h)}(hXAs userspace binaries are paged in Linux, dm-verity also offers the additional protection against a hostile block device. In such an attack, the block device reports the appropriate content for the IMA hash initially, passing the required integrity check. Then, on the page fault that accesses the real data, will report the attacker's payload. Since dm-verity will check the data when the page fault occurs (and the disk access), this attack is mitigated.h]hXAs userspace binaries are paged in Linux, dm-verity also offers the additional protection against a hostile block device. In such an attack, the block device reports the appropriate content for the IMA hash initially, passing the required integrity check. Then, on the page fault that accesses the real data, will report the attacker’s payload. Since dm-verity will check the data when the page fault occurs (and the disk access), this attack is mitigated.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jLhjubeh}(h]h ]h"]h$]h&]bullet*uh1jhhhK#hjubah}(h]h ]h"]h$]h&]uh1jAhhhK#hjubjH)}(hhh]jM)}(h Performance: h]h)}(h Performance:h]h Performance:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjGubah}(h]h ]h"]h$]h&]uh1jLhjDubah}(h]h ]h"]h$]h&]jjjhjjstartKuh1jGhjubjB)}(h* dm-verity provides integrity verification on demand as blocks are read versus requiring the entire file being read into memory for validation. h]j)}(hhh]jM)}(hdm-verity provides integrity verification on demand as blocks are read versus requiring the entire file being read into memory for validation. h]h)}(hdm-verity provides integrity verification on demand as blocks are read versus requiring the entire file being read into memory for validation.h]hdm-verity provides integrity verification on demand as blocks are read versus requiring the entire file being read into memory for validation.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjmubah}(h]h ]h"]h$]h&]uh1jLhjjubah}(h]h ]h"]h$]h&]j<j=uh1jhhhK@hjfubah}(h]h ]h"]h$]h&]uh1jAhhhK@hjubjH)}(hhh]jM)}(hSimplicity of signing: h]h)}(hSimplicity of signing:h]hSimplicity of signing:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1jLhjubah}(h]h ]h"]h$]h&]jjjhjjjeKuh1jGhjubjB)}(h* No need for two signatures (IMA, then EVM): one signature covers an entire block device. * Signatures can be stored externally to the filesystem metadata. * The signature supports an x.509-based signing infrastructure. h]j)}(hhh](jM)}(hXNo need for two signatures (IMA, then EVM): one signature covers an entire block device.h]h)}(hXNo need for two signatures (IMA, then EVM): one signature covers an entire block device.h]hXNo need for two signatures (IMA, then EVM): one signature covers an entire block device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1jLhjubjM)}(h?Signatures can be stored externally to the filesystem metadata.h]h)}(hjh]h?Signatures can be stored externally to the filesystem metadata.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjubah}(h]h ]h"]h$]h&]uh1jLhjubjM)}(h>The signature supports an x.509-based signing infrastructure. h]h)}(h=The signature supports an x.509-based signing infrastructure.h]h=The signature supports an x.509-based signing infrastructure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjubah}(h]h ]h"]h$]h&]uh1jLhjubeh}(h]h ]h"]h$]h&]j<j=uh1jhhhKFhjubah}(h]h ]h"]h$]h&]uh1jAhhhKFhjubeh}(h]h ]h"]h$]h&]uh1jAhhhK!hjhhubh)}(hxThe next step was to choose a *policy* to enforce the integrity mechanism. The minimum requirements for the policy were:h](hThe next step was to choose a }(hjhhhNhNubj()}(h*policy*h]hpolicy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubhR to enforce the integrity mechanism. The minimum requirements for the policy were:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKKhjhhubjB)}(hX1. The policy itself must be integrity verified (preventing trivial attack against it). 2. The policy itself must be resistant to rollback attacks. 3. The policy enforcement must have a permissive-like mode. 4. The policy must be able to be updated, in its entirety, without a reboot. 5. Policy updates must be atomic. 6. The policy must support *revocations* of previously authored components. 7. The policy must be auditable, at any point-of-time. h]jH)}(hhh](jM)}(hTThe policy itself must be integrity verified (preventing trivial attack against it).h]h)}(hTThe policy itself must be integrity verified (preventing trivial attack against it).h]hTThe policy itself must be integrity verified (preventing trivial attack against it).}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhj9ubah}(h]h ]h"]h$]h&]uh1jLhj6ubjM)}(h8The policy itself must be resistant to rollback attacks.h]h)}(hjSh]h8The policy itself must be resistant to rollback attacks.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjQubah}(h]h ]h"]h$]h&]uh1jLhj6ubjM)}(h8The policy enforcement must have a permissive-like mode.h]h)}(hjjh]h8The policy enforcement must have a permissive-like mode.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhjhubah}(h]h ]h"]h$]h&]uh1jLhj6ubjM)}(hIThe policy must be able to be updated, in its entirety, without a reboot.h]h)}(hIThe policy must be able to be updated, in its entirety, without a reboot.h]hIThe policy must be able to be updated, in its entirety, without a reboot.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjubah}(h]h ]h"]h$]h&]uh1jLhj6ubjM)}(hPolicy updates must be atomic.h]h)}(hjh]hPolicy updates must be atomic.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjubah}(h]h ]h"]h$]h&]uh1jLhj6ubjM)}(hHThe policy must support *revocations* of previously authored components.h]h)}(hHThe policy must support *revocations* of previously authored components.h](hThe policy must support }(hjhhhNhNubj()}(h *revocations*h]h revocations}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubh# of previously authored components.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKUhjubah}(h]h ]h"]h$]h&]uh1jLhj6ubjM)}(h4The policy must be auditable, at any point-of-time. h]h)}(h3The policy must be auditable, at any point-of-time.h]h3The policy must be auditable, at any point-of-time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjubah}(h]h ]h"]h$]h&]uh1jLhj6ubeh}(h]h ]h"]h$]h&]jjjhjjuh1jGhj2ubah}(h]h ]h"]h$]h&]uh1jAhhhKNhjhhubh)}(hXIMA, as the only integrity policy mechanism at the time, was considered against these list of requirements, and did not fulfill all of the minimum requirements. Extending IMA to cover these requirements was considered, but ultimately discarded for a two reasons:h]hXIMA, as the only integrity policy mechanism at the time, was considered against these list of requirements, and did not fulfill all of the minimum requirements. Extending IMA to cover these requirements was considered, but ultimately discarded for a two reasons:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubjB)}(hXQ1. Regression risk; many of these changes would result in dramatic code changes to IMA, which is already present in the kernel, and therefore might impact users. 2. IMA was used in the system for measurement and attestation; separation of measurement policy from local integrity policy enforcement was considered favorable. h]jH)}(hhh](jM)}(hRegression risk; many of these changes would result in dramatic code changes to IMA, which is already present in the kernel, and therefore might impact users. h]h)}(hRegression risk; many of these changes would result in dramatic code changes to IMA, which is already present in the kernel, and therefore might impact users.h]hRegression risk; many of these changes would result in dramatic code changes to IMA, which is already present in the kernel, and therefore might impact users.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjubah}(h]h ]h"]h$]h&]uh1jLhjubjM)}(hIMA was used in the system for measurement and attestation; separation of measurement policy from local integrity policy enforcement was considered favorable. h]h)}(hIMA was used in the system for measurement and attestation; separation of measurement policy from local integrity policy enforcement was considered favorable.h]hIMA was used in the system for measurement and attestation; separation of measurement policy from local integrity policy enforcement was considered favorable.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchj)ubah}(h]h ]h"]h$]h&]uh1jLhjubeh}(h]h ]h"]h$]h&]jjjhjjuh1jGhj ubah}(h]h ]h"]h$]h&]uh1jAhhhK_hjhhubh)}(hDue to these reasons, it was decided that a new LSM should be created, whose responsibility would be only the local integrity policy enforcement.h]hDue to these reasons, it was decided that a new LSM should be created, whose responsibility would be only the local integrity policy enforcement.}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjhhubeh}(h]historical-motivationah ]h"]historical motivationah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hRole and Scopeh]hRole and Scope}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjchhhhhKkubh)}(hXIPE, as its name implies, is fundamentally an integrity policy enforcement solution; IPE does not mandate how integrity is provided, but instead leaves that decision to the system administrator to set the security bar, via the mechanisms that they select that suit their individual needs. There are several different integrity solutions that provide a different level of security guarantees; and IPE allows sysadmins to express policy for theoretically all of them.h]hXIPE, as its name implies, is fundamentally an integrity policy enforcement solution; IPE does not mandate how integrity is provided, but instead leaves that decision to the system administrator to set the security bar, via the mechanisms that they select that suit their individual needs. There are several different integrity solutions that provide a different level of security guarantees; and IPE allows sysadmins to express policy for theoretically all of them.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjchhubh)}(hX.IPE does not have an inherent mechanism to ensure integrity on its own. Instead, there are more effective layers available for building systems that can guarantee integrity. It's important to note that the mechanism for proving integrity is independent of the policy for enforcing that integrity claim.h]hX0IPE does not have an inherent mechanism to ensure integrity on its own. Instead, there are more effective layers available for building systems that can guarantee integrity. It’s important to note that the mechanism for proving integrity is independent of the policy for enforcing that integrity claim.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjchhubh)}(h#Therefore, IPE was designed around:h]h#Therefore, IPE was designed around:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjchhubjB)}(he1. Easy integrations with integrity providers. 2. Ease of use for platform administrators/sysadmins. h]jH)}(hhh](jM)}(h+Easy integrations with integrity providers.h]h)}(hjh]h+Easy integrations with integrity providers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjubah}(h]h ]h"]h$]h&]uh1jLhjubjM)}(h3Ease of use for platform administrators/sysadmins. h]h)}(h2Ease of use for platform administrators/sysadmins.h]h2Ease of use for platform administrators/sysadmins.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hjubah}(h]h ]h"]h$]h&]uh1jLhjubeh}(h]h ]h"]h$]h&]jjjhjjuh1jGhjubah}(h]h ]h"]h$]h&]uh1jAhhhK|hjchhubeh}(h]role-and-scopeah ]h"]role and scopeah$]h&]uh1hhhhhhhhKkubh)}(hhh](h)}(hDesign Rationale:h]hDesign Rationale:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hIPE was designed after evaluating existing integrity policy solutions in other operating systems and environments. In this survey of other implementations, there were a few pitfalls identified:h]hIPE was designed after evaluating existing integrity policy solutions in other operating systems and environments. In this survey of other implementations, there were a few pitfalls identified:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjB)}(hXZ1. Policies were not readable by humans, usually requiring a binary intermediary format. 2. A single, non-customizable action was implicitly taken as a default. 3. Debugging the policy required manual steps to determine what rule was violated. 4. Authoring a policy required an in-depth knowledge of the larger system, or operating system. h]jH)}(hhh](jM)}(hUPolicies were not readable by humans, usually requiring a binary intermediary format.h]h)}(hUPolicies were not readable by humans, usually requiring a binary intermediary format.h]hUPolicies were not readable by humans, usually requiring a binary intermediary format.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jLhj ubjM)}(hDA single, non-customizable action was implicitly taken as a default.h]h)}(hj(h]hDA single, non-customizable action was implicitly taken as a default.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj&ubah}(h]h ]h"]h$]h&]uh1jLhj ubjM)}(hODebugging the policy required manual steps to determine what rule was violated.h]h)}(hj?h]hODebugging the policy required manual steps to determine what rule was violated.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj=ubah}(h]h ]h"]h$]h&]uh1jLhj ubjM)}(h]Authoring a policy required an in-depth knowledge of the larger system, or operating system. h]h)}(h\Authoring a policy required an in-depth knowledge of the larger system, or operating system.h]h\Authoring a policy required an in-depth knowledge of the larger system, or operating system.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjTubah}(h]h ]h"]h$]h&]uh1jLhj ubeh}(h]h ]h"]h$]h&]jjjhjjuh1jGhjubah}(h]h ]h"]h$]h&]uh1jAhhhKhjhhubh)}(h,IPE attempts to avoid all of these pitfalls.h]h,IPE attempts to avoid all of these pitfalls.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hPolicyh]hPolicy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h Plain Texth]h Plain Text}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hIPE's policy is plain-text. This introduces slightly larger policy files than other LSMs, but solves two major problems that occurs with some integrity policy solutions on other platforms.h]hIPE’s policy is plain-text. This introduces slightly larger policy files than other LSMs, but solves two major problems that occurs with some integrity policy solutions on other platforms.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe first issue is one of code maintenance and duplication. To author policies, the policy has to be some form of string representation (be it structured, through XML, JSON, YAML, etcetera), to allow the policy author to understand what is being written. In a hypothetical binary policy design, a serializer is necessary to write the policy from the human readable form, to the binary form, and a deserializer is needed to interpret the binary form into a data structure in the kernel.h]hXThe first issue is one of code maintenance and duplication. To author policies, the policy has to be some form of string representation (be it structured, through XML, JSON, YAML, etcetera), to allow the policy author to understand what is being written. In a hypothetical binary policy design, a serializer is necessary to write the policy from the human readable form, to the binary form, and a deserializer is needed to interpret the binary form into a data structure in the kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXaEventually, another deserializer will be needed to transform the binary from back into the human-readable form with as much information preserved. This is because a user of this access control system will have to keep a lookup table of a checksum and the original file itself to try to understand what policies have been deployed on this system and what policies have not. For a single user, this may be alright, as old policies can be discarded almost immediately after the update takes hold. For users that manage computer fleets in the thousands, if not hundreds of thousands, with multiple different operating systems, and multiple different operational needs, this quickly becomes an issue, as stale policies from years ago may be present, quickly resulting in the need to recover the policy or fund extensive infrastructure to track what each policy contains.h]hXaEventually, another deserializer will be needed to transform the binary from back into the human-readable form with as much information preserved. This is because a user of this access control system will have to keep a lookup table of a checksum and the original file itself to try to understand what policies have been deployed on this system and what policies have not. For a single user, this may be alright, as old policies can be discarded almost immediately after the update takes hold. For users that manage computer fleets in the thousands, if not hundreds of thousands, with multiple different operating systems, and multiple different operational needs, this quickly becomes an issue, as stale policies from years ago may be present, quickly resulting in the need to recover the policy or fund extensive infrastructure to track what each policy contains.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXWith now three separate serializer/deserializers, maintenance becomes costly. If the policy avoids the binary format, there is only one required serializer: from the human-readable form to the data structure in kernel, saving on code maintenance, and retaining operability.h]hXWith now three separate serializer/deserializers, maintenance becomes costly. If the policy avoids the binary format, there is only one required serializer: from the human-readable form to the data structure in kernel, saving on code maintenance, and retaining operability.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe second issue with a binary format is one of transparency. As IPE controls access based on the trust of the system's resources, it's policy must also be trusted to be changed. This is done through signatures, resulting in needing signing as a process. Signing, as a process, is typically done with a high security bar, as anything signed can be used to attack integrity enforcement systems. It is also important that, when signing something, that the signer is aware of what they are signing. A binary policy can cause obfuscation of that fact; what signers see is an opaque binary blob. A plain-text policy, on the other hand, the signers see the actual policy submitted for signing.h]hXThe second issue with a binary format is one of transparency. As IPE controls access based on the trust of the system’s resources, it’s policy must also be trusted to be changed. This is done through signatures, resulting in needing signing as a process. Signing, as a process, is typically done with a high security bar, as anything signed can be used to attack integrity enforcement systems. It is also important that, when signing something, that the signer is aware of what they are signing. A binary policy can cause obfuscation of that fact; what signers see is an opaque binary blob. A plain-text policy, on the other hand, the signers see the actual policy submitted for signing.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] plain-textah ]h"] plain textah$]h&]uh1hhjhhhhhKubeh}(h]policyah ]h"]policyah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h Boot Policyh]h Boot Policy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXIPE, if configured appropriately, is able to enforce a policy as soon as a kernel is booted and usermode starts. That implies some level of storage of the policy to apply the minute usermode starts. Generally, that storage can be handled in one of three ways:h]hXIPE, if configured appropriately, is able to enforce a policy as soon as a kernel is booted and usermode starts. That implies some level of storage of the policy to apply the minute usermode starts. Generally, that storage can be handled in one of three ways:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjB)}(hXS1. The policy file(s) live on disk and the kernel loads the policy prior to an code path that would result in an enforcement decision. 2. The policy file(s) are passed by the bootloader to the kernel, who parses the policy. 3. There is a policy file that is compiled into the kernel that is parsed and enforced on initialization. h]jH)}(hhh](jM)}(hThe policy file(s) live on disk and the kernel loads the policy prior to an code path that would result in an enforcement decision.h]h)}(hThe policy file(s) live on disk and the kernel loads the policy prior to an code path that would result in an enforcement decision.h]hThe policy file(s) live on disk and the kernel loads the policy prior to an code path that would result in an enforcement decision.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj$ubah}(h]h ]h"]h$]h&]uh1jLhj!ubjM)}(hUThe policy file(s) are passed by the bootloader to the kernel, who parses the policy.h]h)}(hUThe policy file(s) are passed by the bootloader to the kernel, who parses the policy.h]hUThe policy file(s) are passed by the bootloader to the kernel, who parses the policy.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj<ubah}(h]h ]h"]h$]h&]uh1jLhj!ubjM)}(hgThere is a policy file that is compiled into the kernel that is parsed and enforced on initialization. h]h)}(hfThere is a policy file that is compiled into the kernel that is parsed and enforced on initialization.h]hfThere is a policy file that is compiled into the kernel that is parsed and enforced on initialization.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjTubah}(h]h ]h"]h$]h&]uh1jLhj!ubeh}(h]h ]h"]h$]h&]jjjhjjuh1jGhjubah}(h]h ]h"]h$]h&]uh1jAhhhKhjhhubh)}(hThe first option has problems: the kernel reading files from userspace is typically discouraged and very uncommon in the kernel.h]hThe first option has problems: the kernel reading files from userspace is typically discouraged and very uncommon in the kernel.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX#The second option also has problems: Linux supports a variety of bootloaders across its entire ecosystem - every bootloader would have to support this new methodology or there must be an independent source. It would likely result in more drastic changes to the kernel startup than necessary.h]hX#The second option also has problems: Linux supports a variety of bootloaders across its entire ecosystem - every bootloader would have to support this new methodology or there must be an independent source. It would likely result in more drastic changes to the kernel startup than necessary.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXDThe third option is the best but it's important to be aware that the policy will take disk space against the kernel it's compiled in. It's important to keep this policy generalized enough that userspace can load a new, more complicated policy, but restrictive enough that it will not overauthorize and cause security issues.h]hXJThe third option is the best but it’s important to be aware that the policy will take disk space against the kernel it’s compiled in. It’s important to keep this policy generalized enough that userspace can load a new, more complicated policy, but restrictive enough that it will not overauthorize and cause security issues.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe initramfs provides a way that this bootup path can be established. The kernel starts with a minimal policy, that trusts the initramfs only. Inside the initramfs, when the real rootfs is mounted, but not yet transferred to, it deploys and activates a policy that trusts the new root filesystem. This prevents overauthorization at any step, and keeps the kernel policy to a minimal size.h]hXThe initramfs provides a way that this bootup path can be established. The kernel starts with a minimal policy, that trusts the initramfs only. Inside the initramfs, when the real rootfs is mounted, but not yet transferred to, it deploys and activates a policy that trusts the new root filesystem. This prevents overauthorization at any step, and keeps the kernel policy to a minimal size.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hStartuph]hStartup}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXbNot every system, however starts with an initramfs, so the startup policy compiled into the kernel will need some flexibility to express how trust is established for the next phase of the bootup. To this end, if we just make the compiled-in policy a full IPE policy, it allows system builders to express the first stage bootup requirements appropriately.h]hXbNot every system, however starts with an initramfs, so the startup policy compiled into the kernel will need some flexibility to express how trust is established for the next phase of the bootup. To this end, if we just make the compiled-in policy a full IPE policy, it allows system builders to express the first stage bootup requirements appropriately.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]startupah ]h"]startupah$]h&]uh1hhjhhhhhKubeh}(h] boot-policyah ]h"] boot policyah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hUpdatable, Rebootless Policyh]hUpdatable, Rebootless Policy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXAs requirements change over time (vulnerabilities are found in previously trusted applications, keys roll, etcetera). Updating a kernel to change the meet those security goals is not always a suitable option, as updates are not always risk-free, and blocking a security update leaves systems vulnerable. This means IPE requires a policy that can be completely updated (allowing revocations of existing policy) from a source external to the kernel (allowing policies to be updated without updating the kernel).h]hXAs requirements change over time (vulnerabilities are found in previously trusted applications, keys roll, etcetera). Updating a kernel to change the meet those security goals is not always a suitable option, as updates are not always risk-free, and blocking a security update leaves systems vulnerable. This means IPE requires a policy that can be completely updated (allowing revocations of existing policy) from a source external to the kernel (allowing policies to be updated without updating the kernel).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hAdditionally, since the kernel is stateless between invocations, and reading policy files off the disk from kernel space is a bad idea(tm), then the policy updates have to be done rebootlessly.h]hAdditionally, since the kernel is stateless between invocations, and reading policy files off the disk from kernel space is a bad idea(tm), then the policy updates have to be done rebootlessly.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXTo allow an update from an external source, it could be potentially malicious, so this policy needs to have a way to be identified as trusted. This is done via a signature chained to a trust source in the kernel. Arbitrarily, this is the ``SYSTEM_TRUSTED_KEYRING``, a keyring that is initially populated at kernel compile-time, as this matches the expectation that the author of the compiled-in policy described above is the same entity that can deploy policy updates.h](hTo allow an update from an external source, it could be potentially malicious, so this policy needs to have a way to be identified as trusted. This is done via a signature chained to a trust source in the kernel. Arbitrarily, this is the }(hj hhhNhNubhliteral)}(h``SYSTEM_TRUSTED_KEYRING``h]hSYSTEM_TRUSTED_KEYRING}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, a keyring that is initially populated at kernel compile-time, as this matches the expectation that the author of the compiled-in policy described above is the same entity that can deploy policy updates.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]updatable-rebootless-policyah ]h"]updatable, rebootless policyah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hAnti-Rollback / Anti-Replayh]hAnti-Rollback / Anti-Replay}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6hhhhhMubh)}(hOver time, vulnerabilities are found and trusted resources may not be trusted anymore. IPE's policy has no exception to this. There can be instances where a mistaken policy author deploys an insecure policy, before correcting it with a secure policy.h]hOver time, vulnerabilities are found and trusted resources may not be trusted anymore. IPE’s policy has no exception to this. There can be instances where a mistaken policy author deploys an insecure policy, before correcting it with a secure policy.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6hhubh)}(hAssuming that as soon as the insecure policy is signed, and an attacker acquires the insecure policy, IPE needs a way to prevent rollback from the secure policy update to the insecure policy update.h]hAssuming that as soon as the insecure policy is signed, and an attacker acquires the insecure policy, IPE needs a way to prevent rollback from the secure policy update to the insecure policy update.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj6hhubh)}(hInitially, IPE's policy can have a policy_version that states the minimum required version across all policies that can be active on the system. This will prevent rollback while the system is live.h]hInitially, IPE’s policy can have a policy_version that states the minimum required version across all policies that can be active on the system. This will prevent rollback while the system is live.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj6hhubhwarning)}(hX@However, since the kernel is stateless across boots, this policy version will be reset to 0.0.0 on the next boot. System builders need to be aware of this, and ensure the new secure policies are deployed ASAP after a boot to ensure that the window of opportunity is minimal for an attacker to deploy the insecure policy.h]h)}(hX@However, since the kernel is stateless across boots, this policy version will be reset to 0.0.0 on the next boot. System builders need to be aware of this, and ensure the new secure policies are deployed ASAP after a boot to ensure that the window of opportunity is minimal for an attacker to deploy the insecure policy.h]hX@However, since the kernel is stateless across boots, this policy version will be reset to 0.0.0 on the next boot. System builders need to be aware of this, and ensure the new secure policies are deployed ASAP after a boot to ensure that the window of opportunity is minimal for an attacker to deploy the insecure policy.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjsubah}(h]h ]h"]h$]h&]uh1jqhj6hhhhhNubeh}(h]anti-rollback-anti-replayah ]h"]anti-rollback / anti-replayah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hImplicit Actions:h]hImplicit Actions:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXqThe issue of implicit actions only becomes visible when you consider a mixed level of security bars across multiple operations in a system. For example, consider a system that has strong integrity guarantees over both the executable code, and specific *data files* on the system, that were critical to its function. In this system, three types of policies are possible:h](hThe issue of implicit actions only becomes visible when you consider a mixed level of security bars across multiple operations in a system. For example, consider a system that has strong integrity guarantees over both the executable code, and specific }(hjhhhNhNubj()}(h *data files*h]h data files}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j'hjubhi on the system, that were critical to its function. In this system, three types of policies are possible:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjB)}(hX11. A policy in which failure to match any rules in the policy results in the action being denied. 2. A policy in which failure to match any rules in the policy results in the action being allowed. 3. A policy in which the action taken when no rules are matched is specified by the policy author. h]jH)}(hhh](jM)}(h^A policy in which failure to match any rules in the policy results in the action being denied.h]h)}(h^A policy in which failure to match any rules in the policy results in the action being denied.h]h^A policy in which failure to match any rules in the policy results in the action being denied.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hjubah}(h]h ]h"]h$]h&]uh1jLhjubjM)}(h_A policy in which failure to match any rules in the policy results in the action being allowed.h]h)}(h_A policy in which failure to match any rules in the policy results in the action being allowed.h]h_A policy in which failure to match any rules in the policy results in the action being allowed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hjubah}(h]h ]h"]h$]h&]uh1jLhjubjM)}(h`A policy in which the action taken when no rules are matched is specified by the policy author. h]h)}(h_A policy in which the action taken when no rules are matched is specified by the policy author.h]h_A policy in which the action taken when no rules are matched is specified by the policy author.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjubah}(h]h ]h"]h$]h&]uh1jLhjubeh}(h]h ]h"]h$]h&]jjjhjjuh1jGhjubah}(h]h ]h"]h$]h&]uh1jAhhhM#hjhhubh)}(h0The first option could make a policy like this::h]h/The first option could make a policy like this:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM*hjhhubh literal_block)}(h.op=EXECUTE integrity_verified=YES action=ALLOWh]h.op=EXECUTE integrity_verified=YES action=ALLOW}hj/sbah}(h]h ]h"]h$]h&]hhuh1j-hhhM,hjhhubh)}(hX!In the example system, this works well for the executables, as all executables should have integrity guarantees, without exception. The issue becomes with the second requirement about specific data files. This would result in a policy like this (assuming each line is evaluated in order)::h]hX In the example system, this works well for the executables, as all executables should have integrity guarantees, without exception. The issue becomes with the second requirement about specific data files. This would result in a policy like this (assuming each line is evaluated in order):}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjhhubj.)}(hop=EXECUTE integrity_verified=YES action=ALLOW op=READ integrity_verified=NO label=critical_t action=DENY op=READ action=ALLOWh]hop=EXECUTE integrity_verified=YES action=ALLOW op=READ integrity_verified=NO label=critical_t action=DENY op=READ action=ALLOW}hjKsbah}(h]h ]h"]h$]h&]hhuh1j-hhhM4hjhhubh)}(hX2This is somewhat clear if you read the docs, understand the policy is executed in order and that the default is a denial; however, the last line effectively changes that default to an ALLOW. This is required, because in a realistic system, there are some unverified reads (imagine appending to a log file).h]hX2This is somewhat clear if you read the docs, understand the policy is executed in order and that the default is a denial; however, the last line effectively changes that default to an ALLOW. This is required, because in a realistic system, there are some unverified reads (imagine appending to a log file).}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjhhubh)}(hbThe second option, matching no rules results in an allow, is clearer for the specific data files::h]haThe second option, matching no rules results in an allow, is clearer for the specific data files:}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM?hjhhubj.)}(h:op=READ integrity_verified=NO label=critical_t action=DENYh]h:op=READ integrity_verified=NO label=critical_t action=DENY}hjusbah}(h]h ]h"]h$]h&]hhuh1j-hhhMBhjhhubh)}(hrAnd, like the first option, falls short with the execution scenario, effectively needing to override the default::h]hqAnd, like the first option, falls short with the execution scenario, effectively needing to override the default:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhjhhubj.)}(hop=EXECUTE integrity_verified=YES action=ALLOW op=EXECUTE action=DENY op=READ integrity_verified=NO label=critical_t action=DENYh]hop=EXECUTE integrity_verified=YES action=ALLOW op=EXECUTE action=DENY op=READ integrity_verified=NO label=critical_t action=DENY}hjsbah}(h]h ]h"]h$]h&]hhuh1j-hhhMGhjhhubh)}(hThis leaves the third option. Instead of making users be clever and override the default with an empty rule, force the end-user to consider what the appropriate default should be for their scenario and explicitly state it::h]hThis leaves the third option. Instead of making users be clever and override the default with an empty rule, force the end-user to consider what the appropriate default should be for their scenario and explicitly state it:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjhhubj.)}(hDEFAULT op=EXECUTE action=DENY op=EXECUTE integrity_verified=YES action=ALLOW DEFAULT op=READ action=ALLOW op=READ integrity_verified=NO label=critical_t action=DENYh]hDEFAULT op=EXECUTE action=DENY op=EXECUTE integrity_verified=YES action=ALLOW DEFAULT op=READ action=ALLOW op=READ integrity_verified=NO label=critical_t action=DENY}hjsbah}(h]h ]h"]h$]h&]hhuh1j-hhhMQhjhhubeh}(h]implicit-actionsah ]h"]implicit actions:ah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hPolicy Debugging:h]hPolicy Debugging:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMXubh)}(hXWhen developing a policy, it is useful to know what line of the policy is being violated to reduce debugging costs; narrowing the scope of the investigation to the exact line that resulted in the action. Some integrity policy systems do not provide this information, instead providing the information that was used in the evaluation. This then requires a correlation with the policy to evaluate what went wrong.h]hXWhen developing a policy, it is useful to know what line of the policy is being violated to reduce debugging costs; narrowing the scope of the investigation to the exact line that resulted in the action. Some integrity policy systems do not provide this information, instead providing the information that was used in the evaluation. This then requires a correlation with the policy to evaluate what went wrong.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhjhhubh)}(hX1Instead, IPE just emits the rule that was matched. This limits the scope of the investigation to the exact policy line (in the case of a specific rule), or the section (in the case of a DEFAULT). This decreases iteration and investigation times when policy failures are observed while evaluating policies.h]hX1Instead, IPE just emits the rule that was matched. This limits the scope of the investigation to the exact policy line (in the case of a specific rule), or the section (in the case of a DEFAULT). This decreases iteration and investigation times when policy failures are observed while evaluating policies.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahjhhubh)}(hXIPE's policy engine is also designed in a way that it makes it obvious to a human of how to investigate a policy failure. Each line is evaluated in the sequence that is written, so the algorithm is very simple to follow for humans to recreate the steps and could have caused the failure. In other surveyed systems, optimizations occur (sorting rules, for instance) when loading the policy. In those systems, it requires multiple steps to debug, and the algorithm may not always be clear to the end-user without reading the code first.h]hXIPE’s policy engine is also designed in a way that it makes it obvious to a human of how to investigate a policy failure. Each line is evaluated in the sequence that is written, so the algorithm is very simple to follow for humans to recreate the steps and could have caused the failure. In other surveyed systems, optimizations occur (sorting rules, for instance) when loading the policy. In those systems, it requires multiple steps to debug, and the algorithm may not always be clear to the end-user without reading the code first.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghjhhubeh}(h]policy-debuggingah ]h"]policy debugging:ah$]h&]uh1hhjhhhhhMXubh)}(hhh](h)}(hSimplified Policy:h]hSimplified Policy:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMpubh)}(hX~Finally, IPE's policy is designed for sysadmins, not kernel developers. Instead of covering individual LSM hooks (or syscalls), IPE covers operations. This means instead of sysadmins needing to know that the syscalls ``mmap``, ``mprotect``, ``execve``, and ``uselib`` must have rules protecting them, they must simple know that they want to restrict code execution. This limits the amount of bypasses that could occur due to a lack of knowledge of the underlying system; whereas the maintainers of IPE, being kernel developers can make the correct choice to determine whether something maps to these operations, and under what conditions.h](hFinally, IPE’s policy is designed for sysadmins, not kernel developers. Instead of covering individual LSM hooks (or syscalls), IPE covers operations. This means instead of sysadmins needing to know that the syscalls }(hj hhhNhNubj)}(h``mmap``h]hmmap}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, }(hj hhhNhNubj)}(h ``mprotect``h]hmprotect}(hj1 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, }(hj hhhNhNubj)}(h ``execve``h]hexecve}(hjC hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, and }(hj hhhNhNubj)}(h ``uselib``h]huselib}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhXs must have rules protecting them, they must simple know that they want to restrict code execution. This limits the amount of bypasses that could occur due to a lack of knowledge of the underlying system; whereas the maintainers of IPE, being kernel developers can make the correct choice to determine whether something maps to these operations, and under what conditions.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMrhj hhubeh}(h]simplified-policyah ]h"]simplified policy:ah$]h&]uh1hhjhhhhhMpubeh}(h]design-rationaleah ]h"]design rationale:ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hImplementation Notesh]hImplementation Notes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj} hhhhhM|ubh)}(hhh](h)}(hAnonymous Memoryh]hAnonymous Memory}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hXAnonymous memory isn't treated any differently from any other access in IPE. When anonymous memory is mapped with ``+X``, it still comes into the ``file_mmap`` or ``file_mprotect`` hook, but with a ``NULL`` file object. This is submitted to the evaluation, like any other file. However, all current trust properties will evaluate to false, as they are all file-based and the operation is not associated with a file.h](htAnonymous memory isn’t treated any differently from any other access in IPE. When anonymous memory is mapped with }(hj hhhNhNubj)}(h``+X``h]h+X}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, it still comes into the }(hj hhhNhNubj)}(h ``file_mmap``h]h file_mmap}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh or }(hj hhhNhNubj)}(h``file_mprotect``h]h file_mprotect}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh hook, but with a }(hj hhhNhNubj)}(h``NULL``h]hNULL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh file object. This is submitted to the evaluation, like any other file. However, all current trust properties will evaluate to false, as they are all file-based and the operation is not associated with a file.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubjr)}(hThis also occurs with the ``kernel_load_data`` hook, when the kernel is loading data from a userspace buffer that is not backed by a file. In this scenario all current trust properties will also evaluate to false.h]h)}(hThis also occurs with the ``kernel_load_data`` hook, when the kernel is loading data from a userspace buffer that is not backed by a file. In this scenario all current trust properties will also evaluate to false.h](hThis also occurs with the }(hj hhhNhNubj)}(h``kernel_load_data``h]hkernel_load_data}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh hook, when the kernel is loading data from a userspace buffer that is not backed by a file. In this scenario all current trust properties will also evaluate to false.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jqhj hhhhhNubeh}(h]anonymous-memoryah ]h"]anonymous memoryah$]h&]uh1hhj} hhhhhMubh)}(hhh](h)}(hSecurityfs Interfaceh]hSecurityfs Interface}(hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj' hhhhhMubh)}(hgThe per-policy securityfs tree is somewhat unique. For example, for a standard securityfs policy tree::h]hfThe per-policy securityfs tree is somewhat unique. For example, for a standard securityfs policy tree:}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubj.)}(hZMyPolicy |- active |- delete |- name |- pkcs7 |- policy |- update |- versionh]hZMyPolicy |- active |- delete |- name |- pkcs7 |- policy |- update |- version}hjF sbah}(h]h ]h"]h$]h&]hhuh1j-hhhMhj' hhubh)}(hGThe policy is stored in the ``->i_private`` data of the MyPolicy inode.h](hThe policy is stored in the }(hjT hhhNhNubj)}(h``->i_private``h]h ->i_private}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjT ubh data of the MyPolicy inode.}(hjT hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubeh}(h]securityfs-interfaceah ]h"]securityfs interfaceah$]h&]uh1hhj} hhhhhMubeh}(h]implementation-notesah ]h"]implementation notesah$]h&]uh1hhhhhhhhM|ubh)}(hhh](h)}(hTestsh]hTests}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hDIPE has KUnit Tests for the policy parser. Recommended kunitconfig::h]hCIPE has KUnit Tests for the policy parser. Recommended kunitconfig:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj.)}(hXCONFIG_KUNIT=y CONFIG_SECURITY=y CONFIG_SECURITYFS=y CONFIG_PKCS7_MESSAGE_PARSER=y CONFIG_SYSTEM_DATA_VERIFICATION=y CONFIG_FS_VERITY=y CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y CONFIG_BLOCK=y CONFIG_MD=y CONFIG_BLK_DEV_DM=y CONFIG_DM_VERITY=y CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y CONFIG_NET=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_BLK_DEV_INITRD=y CONFIG_SECURITY_IPE=y CONFIG_IPE_PROP_DM_VERITY=y CONFIG_IPE_PROP_DM_VERITY_SIGNATURE=y CONFIG_IPE_PROP_FS_VERITY=y CONFIG_IPE_PROP_FS_VERITY_BUILTIN_SIG=y CONFIG_SECURITY_IPE_KUNIT_TEST=yh]hXCONFIG_KUNIT=y CONFIG_SECURITY=y CONFIG_SECURITYFS=y CONFIG_PKCS7_MESSAGE_PARSER=y CONFIG_SYSTEM_DATA_VERIFICATION=y CONFIG_FS_VERITY=y CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y CONFIG_BLOCK=y CONFIG_MD=y CONFIG_BLK_DEV_DM=y CONFIG_DM_VERITY=y CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y CONFIG_NET=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_BLK_DEV_INITRD=y CONFIG_SECURITY_IPE=y CONFIG_IPE_PROP_DM_VERITY=y CONFIG_IPE_PROP_DM_VERITY_SIGNATURE=y CONFIG_IPE_PROP_FS_VERITY=y CONFIG_IPE_PROP_FS_VERITY_BUILTIN_SIG=y CONFIG_SECURITY_IPE_KUNIT_TEST=y}hj sbah}(h]h ]h"]h$]h&]hhuh1j-hhhMhj hhubh)}(hIn addition, IPE has a python based integration `test suite `_ that can test both user interfaces and enforcement functionalities.h](h0In addition, IPE has a python based integration }(hj hhhNhNubh reference)}(h@`test suite `_h]h test suite}(hj hhhNhNubah}(h]h ]h"]h$]h&]name test suiterefuri0https://github.com/microsoft/ipe/tree/test-suiteuh1j hj ubhtarget)}(h3 h]h}(h] test-suiteah ]h"] test suiteah$]h&]refurij uh1j referencedKhj ubhD that can test both user interfaces and enforcement functionalities.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]testsah ]h"]testsah$]h&]uh1hhhhhhhhMubeh}(h]5integrity-policy-enforcement-ipe-kernel-documentationah ]h"]9integrity policy enforcement (ipe) - kernel documentationah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j j j`j]jjjz jw jjjjjjjjj3j0jjjjj j jr jo j j~ j$ j! jy jv j j j j u nametypes}(j j`jjz jjjjj3jjj jr j j$ jy j j uh}(j hj]jjjcjw jjjjjjjjjj0jjj6jjj jjo j j~ j} j! j jv j' j j j j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages](hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "2" (ordinal 2)h]h>Enumerated list start value not ordinal-1: “2” (ordinal 2)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~ ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j| hjubj} )}(hhh]h)}(h:Enumerated list start value not ordinal-1: "3" (ordinal 3)h]h>Enumerated list start value not ordinal-1: “3” (ordinal 3)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]levelKtypej sourcehlineKuh1j| hjubetransform_messages] transformerN include_log] decorationNhhub.