-
Notifications
You must be signed in to change notification settings - Fork 661
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
[generate_dump] remove secrets from dump files #1886
[generate_dump] remove secrets from dump files #1886
Conversation
azp /run |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
need to back port this to 202012, 202006, 201911 |
scripts/generate_dump
Outdated
@@ -180,6 +181,13 @@ save_cmd() { | |||
redirect_eval="" | |||
fi | |||
|
|||
# Cleanup metthod need do post procress on dump file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
scripts/generate_dump
Outdated
echo "Remove secret from '$filepath' files." | ||
|
||
# Remove tacacs & radius passkey from config DB | ||
sed -i -E 's/\"passkey\"\s*:\s*\"([^\"]*)\"/\"passkey\":\"\"/g' $filepath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
scripts/generate_dump
Outdated
echo "Remove secret from etc files." | ||
# Remove tacacs passkey from tacplus_nss.conf | ||
local secret_regex='s/(secret=)([^,|\S]*)(.*)/\1***\3/g' | ||
sed -i -E $secret_regex $TARDIR/etc/tacplus_nss.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -155,6 +154,7 @@ save_bcmcmd_all_ns() { | |||
# cmd: The command to run. Make sure that arguments with spaces have quotes | |||
# filename: the filename to save the output as in $BASE/dump | |||
# do_gzip: (OPTIONAL) true or false. Should the output be gzipped | |||
# cleanup_method: (OPTIONAL) the cleanup method to procress dump file after it generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently when do_gzip=true, dump output been redirect to gzip command with pipeline.
However, sed can work with pipeline, so I will investigate if we can invoke cleanup method in pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, UT failed because azure pipeline issue.
There is no 202006 branch. Is it a typo or do you really want creating that branch and backport? In reply to: 949225407 |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Could you add some test cases in sonic-mgmt? I see some files in tests/show_techsupport/ |
This commit could not be cleanly cherry-picked to 202012. Please submit another PR. |
…to 202012 #### What I did Add bash functions to remove secrets from dump files. #### How I did it For tacacs key, radius key, snmp community srring, use sed command with regex to remove user secrets from dump files. For certs, update tar command exclude list to remove those certs from dump file. #### How to verify it Run 'show techsupport' command and check secrets removed from dump files. #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed)
…12 (#1938) #### What I did Add bash functions to remove secrets from dump files. #### How I did it For tacacs key, radius key, snmp community srring, use sed command with regex to remove user secrets from dump files. For certs, update tar command exclude list to remove those certs from dump file. #### How to verify it Run 'show techsupport' command and check secrets removed from dump files. #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed)
Remove secrets from dump files. What I did Add bash functions to remove secrets from dump files. How I did it For tacacs key, radius key, snmp community srring, use sed command with regex to remove user secrets from dump files. For certs, update tar command exclude list to remove those certs from dump file. How to verify it Run 'show techsupport' command and check secrets removed from dump files. Previous command output (if the output of a command-line utility has changed) New command output (if the output of a command-line utility has changed) # Conflicts: # scripts/generate_dump
Backport [generate_dump] remove secrets from dump files #1886 to 201911 What I did Add bash functions to remove secrets from dump files. How I did it For tacacs key, radius key, snmp community srring, use sed command with regex to remove user secrets from dump files. For certs, update tar command exclude list to remove those certs from dump file. How to verify it Run 'show techsupport' command and check secrets removed from dump files.
* c3691d3 [202012][pfcwd] Convert polling interval from ms to us in LUA scripts (sonic-net#1909) * 549c804 Mux state order change (sonic-net#1902) * 6b0b2c4 Update acl type check logic (sonic-net#1886) Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
Submodule update for sonic-utilities with following change: ec9e5ee Backport [generate_dump] remove secrets from dump files sonic-net#1886 to 202012 (sonic-net#1938) ce3b856 [fdbshow]: Handle FDB cleanup gracefully. (sonic-net#1926) 1437bf2 [202012] Add DHCPv6 Relay counter and ipv6 helper CLI (sonic-net#1917)
Remove secrets from dump files.
What I did
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)