{"id":11380,"date":"2024-11-26T15:07:38","date_gmt":"2024-11-26T20:07:38","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=11380"},"modified":"2025-01-21T18:51:30","modified_gmt":"2025-01-21T23:51:30","slug":"quick-sed-for-sanitizing-config-files","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=11380","title":{"rendered":"Quick sed For Sanitizing Config Files"},"content":{"rendered":"\n<p>When sending configuration files to other people for reference, I like to redact any credential-type information &#8230; endpoints that allow you to post data without creds, auth configs, etc. Sometimes I replace the string with REDACTED and sometimes I just drop the line completely. <\/p>\n\n\n\n<p>Make a copy of the config files elsewhere, then run sed<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# Retain parameter but replace value with REDACTED\nsed -i &#039;s|http_post_url: &quot;https:\/\/.*&quot;|post_url: &quot;REDACTED&quot;|&#039; *.yaml\n\n# Remove line from config\nsed -i &#039;\/authorization: Basic\/d&#039; *.yaml\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>When sending configuration files to other people for reference, I like to redact any credential-type information &#8230; endpoints that allow you to post data without creds, auth configs, etc. Sometimes I replace the string with REDACTED and sometimes I just drop the line completely. Make a copy of the config files elsewhere, then run sed<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[632,294,780],"class_list":["post-11380","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-bash","tag-linux","tag-sed"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11380"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11380\/revisions"}],"predecessor-version":[{"id":11381,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11380\/revisions\/11381"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}