Skip to content

Commit e1c8243

Browse files
[202205][generate_dump] Fix for a deletion flow for all secret files 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]>
1 parent 9f2984a commit e1c8243

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

scripts/generate_dump

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,10 +1607,14 @@ main() {
16071607
# Remove unecessary files
16081608
$RM $V -rf $TARDIR/etc/alternatives $TARDIR/etc/passwd* \
16091609
$TARDIR/etc/shadow* $TARDIR/etc/group* $TARDIR/etc/gshadow* \
1610-
$TARDIR/etc/ssh* $TARDIR/get_creds* $TARDIR/snmpd.conf* \
1611-
$TARDIR/etc/mlnx $TARDIR/etc/mft $TARDIR/etc/sonic/*.cer \
1612-
$TARDIR/etc/sonic/*.crt $TARDIR/etc/sonic/*.pem $TARDIR/etc/sonic/*.key \
1613-
$TARDIR/etc/ssl/*.pem $TARDIR/etc/ssl/certs/ $TARDIR/etc/ssl/private/*
1610+
$TARDIR/etc/ssh* $TARDIR/etc/mlnx $TARDIR/etc/mft \
1611+
$TARDIR/etc/ssl/certs/ $TARDIR/etc/ssl/private/*
1612+
rm_list=$(find -L $TARDIR -type f \( -iname \*.cer -o -iname \*.crt -o \
1613+
-iname \*.pem -o -iname \*.key -o -iname \*snmpd.conf\* -o -iname \*get_creds\* \))
1614+
if [ ! -z "$rm_list" ]
1615+
then
1616+
rm $rm_list
1617+
fi
16141618

16151619
save_log_files &
16161620
save_crash_files &

0 commit comments

Comments
 (0)