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

luks_device: add support for keyslots #664

Merged
merged 8 commits into from
Oct 29, 2023

Conversation

zemdreg
Copy link
Contributor

@zemdreg zemdreg commented Oct 15, 2023

SUMMARY

Added support for setting specific key slots when using the luks_device module. Introduces the following new parameters:

  • keyslot for setting the keyslot during container creation
  • new_keyslot for adding new keyslots
  • remove_keyslot for removing a keyslot
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

luks_device

ADDITIONAL INFORMATION

@github-actions
Copy link

github-actions bot commented Oct 15, 2023

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main:
https://ansible-collections.github.io/community.crypto/branch/main

Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I've added some first comments.

plugins/modules/luks_device.py Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
@zemdreg zemdreg changed the title [WIP] luks_device: add support for keyslots luks_device: add support for keyslots Oct 22, 2023
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
def is_luks_slot_set(self, device, keyslot):
''' check if a keyslot is set
'''
result = self._run_command([self._cryptsetup_bin, 'luksDump', device])
Copy link
Contributor

Choose a reason for hiding this comment

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

I really wish --dump-json-metadata would also be available for LUKS1. That way extracting this information would be a lot easier...

plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
plugins/modules/luks_device.py Outdated Show resolved Hide resolved
… check all possible locations for LUKS2 header
@felixfontein felixfontein merged commit 6504e67 into ansible-collections:main Oct 29, 2023
126 checks passed
@felixfontein
Copy link
Contributor

@sgufler thanks a lot for your contribution!

felixfontein added a commit that referenced this pull request Oct 29, 2023
@zemdreg zemdreg deleted the luks_device_keyslots branch February 11, 2024 11:28
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

Successfully merging this pull request may close these issues.

2 participants