-
Notifications
You must be signed in to change notification settings - Fork 581
block .py - Addition(s) to pull clevis and /etc/crypttab data for issue #2755 #2756
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
base: main
Are you sure you want to change the base?
Conversation
Added two commands to block.py LUKS loop to grab "clevis luks list <dev>" and grab a copy of the /etc/crypttab file
…k.py Added block.py via upload to extend the LUKS loop and pull clevis and crypttab data.
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
block.py - NBDE/LUKS data - fixed comment to pass flake test. |
Wanted to try putting the /etc/crypttab pull in the LUKS block - as I'm thinking care should likely be taken when pulling this data (ensure there is a LUKS device present, and not pull any sensitive customer data). If this needs to be moved I can/will move this outside (linearly) with other file/data pulls. |
ACK to the change itself, but:
|
sos/report/plugins/block.py
Outdated
@@ -59,11 +59,13 @@ def setup(self): | |||
self.add_blockdev_cmd(cmds, blacklist='ram.*') | |||
|
|||
lsblk = self.collect_cmd_output("lsblk -f -a -l") | |||
# for LUKS devices, collect cryptsetup luksDump | |||
# for LUKS devs, pull cryptsetup luksDump, clevis, and /etc/crypttab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth explaining (on an extra comment line) that we need to collect /etc/crypttab
when any LUKS device exists, hence add_copy_spec
called for every such device. E.g.:
# for LUKS devices, collect cryptsetup, luksDump and clevis
# if a LUKS device exists, ensure /etc/crypttab is collected
That will also resolve the concise language due to line length :).
If LUKS device(s) are present ensure we grab a copy of the /etc/crypttab
Thank you for the guidance Pavel, implemented your suggestion(s) with
regards to pulling /etc/crypttab if LUKS device(s) detected.
…On Fri, Nov 12, 2021 at 12:18 AM Pavel Moravec ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In sos/report/plugins/block.py
<#2756 (comment)>:
> @@ -59,11 +59,13 @@ def setup(self):
self.add_blockdev_cmd(cmds, blacklist='ram.*')
lsblk = self.collect_cmd_output("lsblk -f -a -l")
- # for LUKS devices, collect cryptsetup luksDump
+ # for LUKS devs, pull cryptsetup luksDump, clevis, and /etc/crypttab.
Maybe worth explaining (on an extra comment line) that we need to collect
/etc/crypttab when *any* LUKS device exists, hence add_copy_spec called
for every such device. E.g.:
# for LUKS devices, collect cryptsetup, luksDump and clevis
# if a LUKS device exists, ensure /etc/crypttab is collected
That will also resolve the concise language due to line length :).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2756 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL63NL6PVJ5MDFDGDL6QEADULS5SHANCNFSM5H3RHIPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Kind Regards,
Christopher Bradshaw, RHCE
Senior Technical Support Engineer
***@***.***
(972) 892-4536
Denver, CO
Red Hat <https://www.redhat.com/>
<https://red.ht/sig>
|
Hi Pavel, Thanks again for you suggestions. I'm still new to GIT and this project so not sure if I covered all the issues noted; any help in getting this PR squared away would be greatly appreciated :) |
Hello, One option is to do a rebase, drop&squash individual commits, but this way is more elegant:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single note below, but otherwise echo'ing @pmoravec on needing the squash the fixups commits into a single commit.
if lsblk['status'] == 0: | ||
for line in lsblk['output'].splitlines(): | ||
if 'crypto_LUKS' in line: | ||
dev = line.split()[0] | ||
self.add_cmd_output('cryptsetup luksDump /dev/%s' % dev) | ||
self.add_cmd_output('clevis luks list -d /dev/%s' % dev) | ||
self.add_copy_spec('/etc/crypttab') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not following why this needs to be in the for loop?
If there are no LUKS devices, there should be either not be an /etc/crypttab
or it should be empty, right? add_copy_spec()
gracefully handles when a requested file doesn't exist, and copying an empty/template file doesn't seem all that bad to me.
Is there some condition causing us to not want to collect this file if it exists, yet no LUKS devices are present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right - there won't be an /etc/crypttab if no LUKS devices are present. I figured inserting it into the loop would be a clean way to keep the block module compact and the LUKS data capture contained in a single loop. We could of course move this outside of the LUKS loop and just grab it anyway - just wanted to minimize the chances of pulling any irrelevant data. I can see why it's redundant as it would pull the file for every LUKS device found; but as you say it does handle situations like that gracefully - so I would defer to your direction here :)
@cbrashaw is this still something you plan to work on? |
Hi Arif,
Yes, I plan to circle back to this (time permitting). I can always create a
new pull request if needed.
…On Wed, Nov 20, 2024 at 8:08 AM Arif Ali ***@***.***> wrote:
@cbrashaw <https://github.com/cbrashaw> is this still something you plan
to work on?
—
Reply to this email directly, view it on GitHub
<#2756 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL63NL2XAX2ZT3AV3DO7EUL2BSQXRAVCNFSM6AAAAABSEZX22GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBYHAZTGNJTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Kind Regards,
Christopher Bradshaw, RHCE
He/Him/His
Senior Technical Support Engineer
***@***.***
(972) 892-4536
Denver, CO
Red Hat <https://www.redhat.com/>
<https://red.ht/sig>
|
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines