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

Wipe LUKS Disk Encryption Key for Root Disk from RAM during Shutdown to defeat Cold Boot Attacks #1858

Closed
wants to merge 3 commits into from

Conversation

adrelanos
Copy link

Purpose of this pull request: Receiving some early feedback if this approach looks acceptable.

  • Work in progress.
  • Console output are yet to be improved and documentation written.
  • Untested by me. Will test soon.
  • Tests I am not sure yet how this could realistically be tested.

Changes

  • Confirm in console output if encrypted mounts (root disk) is unmounted. (Because that is a pre-condition for wiping the LUKS full disk encryption key from RAM.)
  • Wipe LUKS Disk Encryption Key for Root Disk from RAM during Shutdown to defeat Cold Boot Attacks.

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #997

@pvalena
Copy link
Contributor

pvalena commented Jul 26, 2022

@lnykryn WDYT?

@@ -0,0 +1,5 @@
echo "Checking for mounted disks..."
dmsetup ls --target crypt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably depend on this properly.

echo "Checking for mounted disks..."
dmsetup ls --target crypt
echo "WIPE RAM!"
/bin/sdmem -f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This as well.

@adrelanos
Copy link
Author

I didn't update this PR yet.

Meanwhile the code has developed a lot further . It is now being tested by me in Kicksecure. The required depend was already added.

I would very much like if dracut was interested to merge (upstream) this functionality.

Here's the code that I have so far:

Design documentation:
https://www.kicksecure.com/wiki/Dev/RAM_Wipe

General user documentation on cold boot attacks:
https://www.kicksecure.com/wiki/Cold_Boot_Attack_Defense

A related issue is #1862 that's why I am currently using echo "..." > /dev/kmsg but that surely can be resolved.

Whatever seems required to upstream, I'd be happy to modify the code to the best of my abilities and/or licensing to accommodate dracut because I very much appreciate dracut and would like this feature to be easily, widely available. (Not only in Kicksecure.)

@stale
Copy link

stale bot commented Aug 31, 2022

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Aug 31, 2022
@stale stale bot closed this Sep 8, 2022
@LaszloGombos LaszloGombos added enhancement Issue adding new functionality and removed stale communication is stuck labels Jun 3, 2023
@LaszloGombos LaszloGombos reopened this Jun 3, 2023
@LaszloGombos LaszloGombos removed the request for review from danimo June 3, 2023 14:30
@LaszloGombos
Copy link
Collaborator

Closing in favor of #2471 as it seem #2471 does not need a new dependency.

Please reopen if I misunderstood.

@adrelanos
Copy link
Author

Wiping all the RAM is different only clean LUKS unmount.

ram-wipe is now implemented as a separate package:

I'd be happy if dracut was interested in this, picking this up but upstreaming seems quite difficult for me.

Effective ram-wipe however depends on #2471 which will help a ton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue adding new functionality modules Issue tracker for all modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wipe LUKS Disk Encryption Key for Root Disk from RAM during Shutdown to defeat Cold Boot Attacks
5 participants