Measure data again even when it has not changed
Hi Mimi,
I have a query related to measuring data (by IMA subsystem) when that data has been already been measured.
Consider the following sequence of events:
=> At time T0 IMA hook is called by another subsystem to measure data "foo". IMA measures it.
=> At time T1 data is "bar". IMA measures it.
=> At time T2 data is "foo" again. But IMA doesn't measure it since it is already in the measured list.
But for the subsystem making the call to IMA, the state has changed and "foo" has to be measured again.
One way to address the above is to use unique "event name" in each call so that IMA measures the given data every time.
Is there a better way to address the above?
thanks,
-lakshmi
Mimi Zohar
maintainerQuoted 15 lines · Lakshmi Ramasubramanian
Hi Mimi,
I have a query related to measuring data (by IMA subsystem) when that data has been already been measured.
Consider the following sequence of events:
=> At time T0 IMA hook is called by another subsystem to measure data "foo". IMA measures it.
=> At time T1 data is "bar". IMA measures it.
=> At time T2 data is "foo" again. But IMA doesn't measure it since it is already in the measured list.
Quoted 7 lines
But for the subsystem making the call to IMA, the state has changed and "foo" has to be measured again.
One way to address the above is to use unique "event name" in each call so that IMA measures the given data every time.
Is there a better way to address the above?
Most likely the file is being re-measured, but the new value already exists in the hash table so it isn't being added to the IMA measurement list or extending the TPM. When IMA was upstreamed, there was concern about TPM performance and the number of measurements being extended. We've improved TPM performance quite a bit. If you're not concerned about TPM performance, I would define a new template data field based on i_version.
Mimi
Quoted 22 lines · Mimi Zohar
Quoted 21 lines · Lakshmi Ramasubramanian
Hi Mimi,
I have a query related to measuring data (by IMA subsystem) when that data has been already been measured.
Consider the following sequence of events:
=> At time T0 IMA hook is called by another subsystem to measure data "foo". IMA measures it.
=> At time T1 data is "bar". IMA measures it.
=> At time T2 data is "foo" again. But IMA doesn't measure it since it is already in the measured list.
But for the subsystem making the call to IMA, the state has changed and "foo" has to be measured again.
One way to address the above is to use unique "event name" in each call so that IMA measures the given data every time.
Quoted 8 lines
Quoted 1 line
Is there a better way to address the above?
Most likely the file is being re-measured, but the new value already exists in the hash table so it isn't being added to the IMA measurement list or extending the TPM. When IMA was upstreamed, there was concern about TPM performance and the number of measurements being extended. We've improved TPM performance quite a bit. If you're not concerned about TPM performance, I would define a new template data field based on
i_version.
In the use case I am considering the entity being measured is not a file, but a memory buffer - it is for measuring an LSM's data constructs. So i_version is not available in this case.
When LSM's data changes from A to B and then back to A, hash(A) already exists in IMA's hash table. So A is not measured again.
Since LSM state change is not expected to be frequent, TPM performance shouldn't be a concern.
thanks,
-lakshmi
Quoted 37 lines · Lakshmi Ramasubramanian
Quoted 22 lines · Mimi Zohar
Quoted 21 lines · Lakshmi Ramasubramanian
Hi Mimi,
I have a query related to measuring data (by IMA subsystem) when that data has been already been measured.
Consider the following sequence of events:
=> At time T0 IMA hook is called by another subsystem to measure data "foo". IMA measures it.
=> At time T1 data is "bar". IMA measures it.
=> At time T2 data is "foo" again. But IMA doesn't measure it since it is already in the measured list.
But for the subsystem making the call to IMA, the state has changed and "foo" has to be measured again.
One way to address the above is to use unique "event name" in each call so that IMA measures the given data every time.
Quoted 8 lines
Quoted 1 line
Is there a better way to address the above?
Most likely the file is being re-measured, but the new value already exists in the hash table so it isn't being added to the IMA measurement list or extending the TPM. When IMA was upstreamed, there was concern about TPM performance and the number of measurements being extended. We've improved TPM performance quite a bit. If you're not concerned about TPM performance, I would define a new template data field based on
i_version.In the use case I am considering the entity being measured is not a file, but a memory buffer - it is for measuring an LSM's data constructs. So
i_versionis not available in this case.
Quoted 5 lines
When LSM's data changes from A to B and then back to A, hash(A) already exists in IMA's hash table. So A is not measured again.
Since LSM state change is not expected to be frequent, TPM performance shouldn't be a concern.
Wouldn't a unique event name result in a new measurement every time?
Mimi
Quoted 38 lines · Mimi Zohar
Quoted 37 lines · Lakshmi Ramasubramanian
Quoted 22 lines · Mimi Zohar
Quoted 21 lines · Lakshmi Ramasubramanian
Hi Mimi,
I have a query related to measuring data (by IMA subsystem) when that data has been already been measured.
Consider the following sequence of events:
=> At time T0 IMA hook is called by another subsystem to measure data "foo". IMA measures it.
=> At time T1 data is "bar". IMA measures it.
=> At time T2 data is "foo" again. But IMA doesn't measure it since it is already in the measured list.
But for the subsystem making the call to IMA, the state has changed and "foo" has to be measured again.
One way to address the above is to use unique "event name" in each call so that IMA measures the given data every time.
Quoted 8 lines
Quoted 1 line
Is there a better way to address the above?
Most likely the file is being re-measured, but the new value already exists in the hash table so it isn't being added to the IMA measurement list or extending the TPM. When IMA was upstreamed, there was concern about TPM performance and the number of measurements being extended. We've improved TPM performance quite a bit. If you're not concerned about TPM performance, I would define a new template data field based on
i_version.In the use case I am considering the entity being measured is not a file, but a memory buffer - it is for measuring an LSM's data constructs. So
i_versionis not available in this case.
Quoted 8 lines
Quoted 5 lines
When LSM's data changes from A to B and then back to A, hash(A) already exists in IMA's hash table. So A is not measured again.
Since LSM state change is not expected to be frequent, TPM performance shouldn't be a concern.
Wouldn't a unique event name result in a new measurement every time?
Adding Stephen.
Yes - but the LSM would call the IMA hook only when there is a change in the state.
I have posted a patch set for this last night -
it defines IMA hooks for measuring LSM data and uses that to measure SELinux data constructs. It can be used by other security modules as well. Please take a look.
thanks,
-lakshmi
Quoted 51 lines · Lakshmi Ramasubramanian
Quoted 38 lines · Mimi Zohar
Quoted 37 lines · Lakshmi Ramasubramanian
Quoted 22 lines · Mimi Zohar
Quoted 21 lines · Lakshmi Ramasubramanian
Hi Mimi,
I have a query related to measuring data (by IMA subsystem) when that data has been already been measured.
Consider the following sequence of events:
=> At time T0 IMA hook is called by another subsystem to measure data "foo". IMA measures it.
=> At time T1 data is "bar". IMA measures it.
=> At time T2 data is "foo" again. But IMA doesn't measure it since it is already in the measured list.
But for the subsystem making the call to IMA, the state has changed and "foo" has to be measured again.
One way to address the above is to use unique "event name" in each call so that IMA measures the given data every time.
Quoted 8 lines
Quoted 1 line
Is there a better way to address the above?
Most likely the file is being re-measured, but the new value already exists in the hash table so it isn't being added to the IMA measurement list or extending the TPM. When IMA was upstreamed, there was concern about TPM performance and the number of measurements being extended. We've improved TPM performance quite a bit. If you're not concerned about TPM performance, I would define a new template data field based on
i_version.In the use case I am considering the entity being measured is not a file, but a memory buffer - it is for measuring an LSM's data constructs. So
i_versionis not available in this case.Quoted 8 lines
Quoted 5 lines
When LSM's data changes from A to B and then back to A, hash(A) already exists in IMA's hash table. So A is not measured again.
Since LSM state change is not expected to be frequent, TPM performance shouldn't be a concern.
Wouldn't a unique event name result in a new measurement every time?
Adding Stephen.
Quoted 7 lines
Yes - but the LSM would call the IMA hook only when there is a change in the state.
I have posted a patch set for this last night -
it defines IMA hooks for measuring LSM data and uses that to measure SELinux data constructs. It can be used by other security modules as well. Please take a look.
To provide more context, the patch set is enabling the measurement of LSM state variables (e.g. SELinux enabled and enforcing among others) and LSM policy (e.g. the SELinux policy). An appraiser may want to know either or both of:
1) What is the current state/policy of the system, e.g. is it currently enforcing an expected policy?
2) Has the system ever been in a state/policy that was unexpected/unauthorized, e.g. was it switched to permissive mode at some point earlier or did it load an unexpected/unauthorized policy earlier?