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

Show disklayout.conf and diskrestore.sh content in "rear -D recover" log #2285

Closed
jsmeix opened this issue Nov 25, 2019 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@jsmeix
Copy link
Member

jsmeix commented Nov 25, 2019

Basically always when there is a user report where "rear recover" failed
I would like to see the user's disklayout.conf and diskrestore.sh
to have it easier to imagine what goes on on the user's system.

Therefore I would like to print the disklayout.conf and diskrestore.sh content
into the "rear -D recover" log (i.e. only in case of debugscript mode).

What I worry about is that disklayout.conf and diskrestore.sh
can contain secrets, e.g. "Disk layout file syntax" in
https://github.com/rear/rear/blob/master/doc/user-guide/06-layout-configuration.adoc
reads (excerpt)

LUKS Devices
crypt ... [cipher=<cipher>] ... [password=<password>]
...
TCG Opal 2-compliant Self-Encrypting Disks
opaldisk ... [password=<password>]

which means the "rear -D recover" log can contain secrets, cf.
#2156

On the other hand I assume that currently the "rear -D recover" log
may already contain the cipher and password values for LUKS
and/or TCG Opal 2-compliant Self-Encrypting Disks
via the normal set -x output.

@jsmeix jsmeix added enhancement Adaptions and new features discuss / RFC labels Nov 25, 2019
@jsmeix jsmeix added this to the ReaR v2.6 milestone Nov 25, 2019
@jsmeix jsmeix self-assigned this Nov 25, 2019
@jsmeix
Copy link
Member Author

jsmeix commented Nov 25, 2019

@OliverO2
FYI see this issue #2285
because it is also about that ReaR's debugscript log may contain
the password value for TCG Opal 2-compliant Self-Encrypting Disks
via the set -x output, cf. #2156

@OliverO2
Copy link
Contributor

@jsmeix
I just had a short look, but to me it seems like the password is protected from appearing in the log:

echo "# Protect against passwords appearing in the log file"

@jsmeix
Copy link
Member Author

jsmeix commented Nov 26, 2019

@OliverO2
from plain looking at the code of the create_opaldisk function
I think it only switches off set -x inside diskrestore.sh
while the confidential commands are running
but I think it does not redirect stderr to /dev/null
while the create_opaldisk function is running.
So I think set -x output may appear in the log
while create_opaldisk is running.

On the other hand it seems $OPAL_DISK_PASSWORD
is nowhere evaluated while the create_opaldisk function is running
because it is always used as \$OPAL_DISK_PASSWORD so that
$OPAL_DISK_PASSWORD is only evaluated while diskrestore.sh
is running and there set -x is switched off.

But I found unescaped $OPAL_DISK_PASSWORD
several times in various functions in
usr/share/rear/lib/opaladmin-workflow.sh

On first glance I cannot see whether or not set -x could be set
while those functions are running.

@OliverO2
Copy link
Contributor

Yes, the opaladmin workflow contains no special debugscripts protection. But this is an isolated workflow which does not interfere with the rest of ReaR.

If a need should arise to debug this workflow with -x and send out the log, the user should use demo passwords only or scrutinize the log for any production password used.

@jsmeix jsmeix modified the milestones: ReaR v2.6, ReaR v2.7 Apr 29, 2020
@github-actions
Copy link

Stale issue message

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

No branches or pull requests

2 participants