Message ID | 20201119232611.30114-1-tusharsu@linux.microsoft.com (mailing list archive) |
---|---|
Headers | show |
Series | IMA: support for measuring kernel integrity critical data | expand |
On Thu 2020-11-19 15:26:03, Tushar Sugandhi wrote: > Kernel integrity critical data can be defined as the in-memory kernel > data which if accidentally or maliciously altered, can compromise the > integrity of the system. Is that an useful definition? > There are several kernel subsystems that contain integrity critical > data - e.g. LSMs like SELinux, or AppArmor; or device-mapper targets > like dm-crypt, dm-verity etc. Examples of critical data could be kernel > in-memory r/o structures, hash of the memory structures, or data that > represents a linux kernel subsystem state. > > This patch set defines a new IMA hook namely ima_measure_critical_data() > to measure the critical data. Kernel subsystems can use this > functionality, to take advantage of IMA's measuring and quoting > abilities - thus ultimately enabling remote attestation for the > subsystem specific information stored in the kernel memory. How is it supposed to be useful? I'm pretty sure there are critical data that are not measured by proposed module... and that are written under normal circumstances. Best regards, Pavel
Thanks Pavel for looking at this series. On 2020-11-20 4:46 a.m., Pavel Machek wrote: > On Thu 2020-11-19 15:26:03, Tushar Sugandhi wrote: >> Kernel integrity critical data can be defined as the in-memory kernel >> data which if accidentally or maliciously altered, can compromise the >> integrity of the system. > > Is that an useful definition? I will rework on the definition in the next iteration. Meanwhile, if you have any feedback on what can we add to the definition, that would help is. > >> There are several kernel subsystems that contain integrity critical >> data - e.g. LSMs like SELinux, or AppArmor; or device-mapper targets >> like dm-crypt, dm-verity etc. Examples of critical data could be kernel >> in-memory r/o structures, hash of the memory structures, or data that >> represents a linux kernel subsystem state. >> >> This patch set defines a new IMA hook namely ima_measure_critical_data() >> to measure the critical data. Kernel subsystems can use this >> functionality, to take advantage of IMA's measuring and quoting >> abilities - thus ultimately enabling remote attestation for the >> subsystem specific information stored in the kernel memory. > > How is it supposed to be useful? > > I'm pretty sure there are critical data that are not measured by > proposed module... and that are written under normal circumstances. > The goal of this series is to introduce the IMA hook measure_critical_data() and the necessary policies to use it; and illustrate that use with one example (SELinux). It is not scalable to identify and update all the critical data sources to use the proposed module at once. A piecemeal approach to add more critical data measurement in subsequent patches would be easy to implement and review. Please let me know if you have more thoughts on this. (what critical data you think would be useful to measure etc.) ~Tushar > Best regards, > > Pavel > -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
Hi! > >How is it supposed to be useful? > > > >I'm pretty sure there are critical data that are not measured by > >proposed module... and that are written under normal circumstances. > > > The goal of this series is to introduce the IMA hook > measure_critical_data() and the necessary policies to use it; and > illustrate that use with one example (SELinux). It is not scalable to > identify and update all the critical data sources to use the proposed > module at once. > > A piecemeal approach to add more critical data measurement in subsequent > patches would be easy to implement and review. Basically every other data structure in kernel is "critical" by your definition, and you can't really measure them all; some of them change rather often. Going piecemeal does not really help here. Example of critical data structure: page table entries for process I own. Best regards, Pavel
Hi Pavel, On Sun, 2020-11-22 at 22:00 +0100, Pavel Machek wrote: > Hi! > > > >How is it supposed to be useful? > > > > > >I'm pretty sure there are critical data that are not measured by > > >proposed module... and that are written under normal circumstances. > > > > > The goal of this series is to introduce the IMA hook > > measure_critical_data() and the necessary policies to use it; and > > illustrate that use with one example (SELinux). It is not scalable to > > identify and update all the critical data sources to use the proposed > > module at once. > > > > A piecemeal approach to add more critical data measurement in subsequent > > patches would be easy to implement and review. > > Basically every other data structure in kernel is "critical" by your > definition, and you can't really measure them all; some of them change > rather often. Going piecemeal does not really help here. Agreed, measuring data structures that change is not really applicable. However, measuring data structures that once initialized don't change, does make sense (similar concept to __ro_after_init). The attestation server doesn't need to know anything about the measurement, other than more than a single measurement is indicative of a problem. Mimi > Example of critical data structure: page table entries for process I > own. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
Hi! > > > >How is it supposed to be useful? > > > > > > > >I'm pretty sure there are critical data that are not measured by > > > >proposed module... and that are written under normal circumstances. > > > > > > > The goal of this series is to introduce the IMA hook > > > measure_critical_data() and the necessary policies to use it; and > > > illustrate that use with one example (SELinux). It is not scalable to > > > identify and update all the critical data sources to use the proposed > > > module at once. > > > > > > A piecemeal approach to add more critical data measurement in subsequent > > > patches would be easy to implement and review. > > > > Basically every other data structure in kernel is "critical" by your > > definition, and you can't really measure them all; some of them change > > rather often. Going piecemeal does not really help here. > > Agreed, measuring data structures that change is not really applicable. > However, measuring data structures that once initialized don't change, > does make sense (similar concept to __ro_after_init). The attestation > server doesn't need to know anything about the measurement, other than > more than a single measurement is indicative of a problem. So, why not simply measure everything that is ro_after_init? But... I really fail to see how this is useful. It is trivial to "backdoor" kernel w/o modifying anything that is ro_after_init. (Example: page tables). Pavel
On Mon, 2020-11-23 at 18:18 +0100, Pavel Machek wrote: > > > Basically every other data structure in kernel is "critical" by your > > > definition, and you can't really measure them all; some of them change > > > rather often. Going piecemeal does not really help here. > > > > Agreed, measuring data structures that change is not really applicable. > > However, measuring data structures that once initialized don't change, > > does make sense (similar concept to __ro_after_init). The attestation > > server doesn't need to know anything about the measurement, other than > > more than a single measurement is indicative of a problem. > > So, why not simply measure everything that is ro_after_init? I guess we could, but the original discussion, a long time ago prior to LSM stacking, was limited to measuring the LSM hooks. Mimi -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel