Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to /sys/kernel/security/ is only effective for the current session #9

Open
utkarsh2102 opened this issue Apr 26, 2021 · 3 comments

Comments

@utkarsh2102
Copy link

utkarsh2102 commented Apr 26, 2021

Hello,

[CC: @ibmcb]

I see there's:

keylime-deb/postinst

Lines 33 to 35 in 219cad9

# The "keylime" user belongs to tss, and we need to give access to /sys/kernel/security/<x>
chown -R tss:tss /sys/kernel/security/tpm0
chown -R tss:tss /sys/kernel/security/ima

But this is only in effect for the current session. As soon as there's a reboot, these changes are essentially lost. So I believe it'd be a good idea to set this via the systemd services as well?

Something along the lines of:
ExecStartPre=-/bin/chown -R tss:tss /sys/kernel/security/tpm0

What do you think?

@galmasi
Copy link
Contributor

galmasi commented May 4, 2021

I agree. We have a particular blind spot in this regard, because our deployments are net-booted, and setting something for a session is the same as setting it forever. Please feel free to submit a PR with the change.

@utkarsh2102
Copy link
Author

Hi,

Thanks. Actually it's best if this is implemented via a udev rule. I'll work on it and let you know when it's ready.
Though I wanted to ask if /sys/kernel/security/tpm0 and /sys/kernel/security/ima is being used somewhere? (And how?)
I couldn't understand its need on a quick look; sorry if it was straightforward and if I am missing something.

@galmasi
Copy link
Contributor

galmasi commented May 6, 2021

We also tried a udev rule and it proved complicated, but you know best.

We (keylime) are the exclusive users of /sys/kernel/security/ima and tpm0/binary_bios_measurements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants