Skip to content

Commit

Permalink
[202205][generate_dump] Fix for a deletion flow for all secret files …
Browse files Browse the repository at this point in the history
…in the techsupport dump (#2572)

- What I did
Fixed a deletion flow for all secret files in the tech support dump.

- How I did it
Delete files by using the find and rm Linux utilities.

- How to verify it
Run the show_techsupport/test_techsupport_no_secret.py

Signed-off-by: Vadym Hlushko <[email protected]>
  • Loading branch information
vadymhlushko-mlnx authored Dec 29, 2022
1 parent 9f2984a commit e1c8243
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -1607,10 +1607,14 @@ main() {
# Remove unecessary files
$RM $V -rf $TARDIR/etc/alternatives $TARDIR/etc/passwd* \
$TARDIR/etc/shadow* $TARDIR/etc/group* $TARDIR/etc/gshadow* \
$TARDIR/etc/ssh* $TARDIR/get_creds* $TARDIR/snmpd.conf* \
$TARDIR/etc/mlnx $TARDIR/etc/mft $TARDIR/etc/sonic/*.cer \
$TARDIR/etc/sonic/*.crt $TARDIR/etc/sonic/*.pem $TARDIR/etc/sonic/*.key \
$TARDIR/etc/ssl/*.pem $TARDIR/etc/ssl/certs/ $TARDIR/etc/ssl/private/*
$TARDIR/etc/ssh* $TARDIR/etc/mlnx $TARDIR/etc/mft \
$TARDIR/etc/ssl/certs/ $TARDIR/etc/ssl/private/*
rm_list=$(find -L $TARDIR -type f \( -iname \*.cer -o -iname \*.crt -o \
-iname \*.pem -o -iname \*.key -o -iname \*snmpd.conf\* -o -iname \*get_creds\* \))
if [ ! -z "$rm_list" ]
then
rm $rm_list
fi

save_log_files &
save_crash_files &
Expand Down

0 comments on commit e1c8243

Please sign in to comment.