Skip to content

Commit b34a540

Browse files
[generate_dump] Fix for deletion flow for all secret files from show-techsupport dump (sonic-net#2571)
- 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 fd4d9c0 commit b34a540

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/generate_dump

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,10 +1697,14 @@ main() {
16971697
# Remove unecessary files
16981698
$RM $V -rf $TARDIR/etc/alternatives $TARDIR/etc/passwd* \
16991699
$TARDIR/etc/shadow* $TARDIR/etc/group* $TARDIR/etc/gshadow* \
1700-
$TARDIR/etc/ssh* $TARDIR/get_creds* $TARDIR/snmpd.conf* \
1701-
$TARDIR/etc/mlnx $TARDIR/etc/mft $TARDIR/etc/sonic/*.cer \
1702-
$TARDIR/etc/sonic/*.crt $TARDIR/etc/sonic/*.pem $TARDIR/etc/sonic/*.key \
1703-
$TARDIR/etc/ssl/*.pem $TARDIR/etc/ssl/certs/ $TARDIR/etc/ssl/private/*
1700+
$TARDIR/etc/ssh* $TARDIR/etc/mlnx $TARDIR/etc/mft \
1701+
$TARDIR/etc/ssl/certs/ $TARDIR/etc/ssl/private/*
1702+
rm_list=$(find -L $TARDIR -type f \( -iname \*.cer -o -iname \*.crt -o \
1703+
-iname \*.pem -o -iname \*.key -o -iname \*snmpd.conf\* -o -iname \*get_creds\* \))
1704+
if [ ! -z "$rm_list" ]
1705+
then
1706+
rm $rm_list
1707+
fi
17041708

17051709
save_log_files &
17061710
save_crash_files &

0 commit comments

Comments
 (0)