Open SjoerdV opened 1 year ago
possible solution (just for inspiration):
lsblk -lo KNAME,TYPE | grep " crypt"
lsblk -lo NAME,KNAME,PKNAME,FSTYPE,TYPE,MOUNTPOINT | grep -e " $KNAME " | grep " swap "
extra check:
lsblk -lo NAME,KNAME,PKNAME,FSTYPE,TYPE,MOUNTPOINT | grep " swap " | wc -l
Or for each discovered swap device, check to see if it's an LV, then check all PVs of that VG to see if they're LUKS devices.
This would not be completely robust for complex scenarios (nested PVs, etc.) but should cover most cases.
Describe the bug Concerning test CRYP-7931. When a swap volume is inside a LUKS encrypted volume group, the test outputs 'Found 0 encrypted and 1 unencrypted swap devices in use.'
Version
Expected behavior I would expect the test to output 'Found 1 encrypted and 0 unencrypted swap devices in use.'
Output
Additional context relevant source code: https://github.com/CISOfy/lynis/blob/59a3c4b5368cdbd96ba7cdddf0dce5410b30163c/include/tests_crypto#L188 disk setup: