{"id":37669,"date":"2023-11-06T21:18:20","date_gmt":"2024-01-13T15:17:59","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/"},"modified":"2024-05-04T07:50:55","modified_gmt":"2024-05-03T23:50:55","slug":"%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/","title":{"rendered":"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732"},"content":{"rendered":"<p>\u6211\u5f00\u59cb\u5b66\u4e60AWS\uff0c\u5b66\u4e60\u4e86\u5982\u4f55\u901a\u8fc7`git-secrets&#8217;\u5b9e\u73b0\u5b89\u5168\u64cd\u4f5c\u3002\u4e3a\u4e86\u4e0d\u5fd8\u8bb0\uff0c\u6211\u6574\u7406\u4e86\u4e00\u4e0b\u3002<\/p>\n<h2>git-secrets\u662f\u4ec0\u4e48<\/h2>\n<blockquote><p>\u9632\u6b62\u60a8\u5c06\u5bc6\u7801\u548c\u5176\u4ed6\u654f\u611f\u4fe1\u606f\u63d0\u4ea4\u5230git\u5e93\u4e2d\u3002<\/p><\/blockquote>\n<p>\u8fd9\u4e2a\u5de5\u5177\u5c06\u4fdd\u62a4\u60a8\u7684\u5bc6\u7801\u548c\u5176\u4ed6\u654f\u611f\u4fe1\u606f\u4e0d\u4f1a\u4ece\u63d0\u4ea4\u4e2d\u6cc4\u9732\u51fa\u53bb\u3002<br \/>\n\u5728\u63d0\u4ea4\u4ee3\u7801\u65f6\u6216\u4efb\u4f55\u65f6\u523b\uff0c\u60a8\u90fd\u53ef\u4ee5\u68c0\u67e5\u63d0\u4ea4\u5185\u5bb9\u548c\u6d88\u606f\u662f\u5426\u5305\u542b\u673a\u5bc6\u4fe1\u606f\u3002<br \/>\n\u5728\u5f53\u4eca\u60c5\u62a5\u6cc4\u9732\u6210\u4e3a\u95ee\u9898\u7684\u65f6\u4ee3\uff0c\u901a\u8fc7\u8fd9\u6837\u7684\u5de5\u5177\u8fdb\u884c\u7ba1\u7406\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<h2>\u5b89\u88c5<\/h2>\n<pre class=\"post-pre\"><code><span class=\"nv\">$brew<\/span> <span class=\"nb\">install <\/span>git-secrets\r\n<\/code><\/pre>\n<h2>\u547d\u4ee4\u6458\u8981\uff08Synopsis\uff09<\/h2>\n<pre class=\"post-pre\"><code>git secrets <span class=\"nt\">--scan<\/span> <span class=\"o\">[<\/span><span class=\"nt\">-r<\/span>|--recursive] <span class=\"o\">[<\/span><span class=\"nt\">--cached<\/span><span class=\"o\">]<\/span> <span class=\"o\">[<\/span><span class=\"nt\">--no-index<\/span><span class=\"o\">]<\/span> <span class=\"o\">[<\/span><span class=\"nt\">--untracked<\/span><span class=\"o\">]<\/span> <span class=\"o\">[<\/span>&lt;files&gt;...]\r\ngit secrets <span class=\"nt\">--scan-history<\/span>\r\ngit secrets <span class=\"nt\">--install<\/span> <span class=\"o\">[<\/span><span class=\"nt\">-f<\/span>|--force] <span class=\"o\">[<\/span>&lt;target-directory&gt;]\r\ngit secrets <span class=\"nt\">--list<\/span> <span class=\"o\">[<\/span><span class=\"nt\">--global<\/span><span class=\"o\">]<\/span>\r\ngit secrets <span class=\"nt\">--add<\/span> <span class=\"o\">[<\/span><span class=\"nt\">-a<\/span>|--allowed] <span class=\"o\">[<\/span><span class=\"nt\">-l<\/span>|--literal] <span class=\"o\">[<\/span><span class=\"nt\">--global<\/span><span class=\"o\">]<\/span> &lt;pattern&gt;\r\ngit secrets <span class=\"nt\">--add-provider<\/span> <span class=\"o\">[<\/span><span class=\"nt\">--global<\/span><span class=\"o\">]<\/span> &lt;<span class=\"nb\">command<\/span><span class=\"o\">&gt;<\/span> <span class=\"o\">[<\/span>arguments...]\r\ngit secrets <span class=\"nt\">--register-aws<\/span> <span class=\"o\">[<\/span><span class=\"nt\">--global<\/span><span class=\"o\">]<\/span>\r\ngit secrets <span class=\"nt\">--aws-provider<\/span> <span class=\"o\">[<\/span>&lt;credentials-file&gt;]\r\n<\/code><\/pre>\n<h2>AWS\u7684\u521d\u59cb\u8bbe\u7f6e<\/h2>\n<p>\u56e0\u4e3a\u6709\u4e13\u95e8\u7684\u547d\u4ee4\u53ef\u4ee5\u4e3aAWS\u8fdb\u884c\u9002\u5408\u7684\u914d\u7f6e\uff0c\u6240\u4ee5\u8f93\u5165\u8be5\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--register-aws<\/span> <span class=\"nt\">--global<\/span>\r\n<\/code><\/pre>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u201cgit secret &#8211;list\u201d\u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u7684\u68c0\u67e5\u6a21\u5f0f\u662f\u4ec0\u4e48\u6837\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--list<\/span>\r\n\r\nsecrets.providers git secrets <span class=\"nt\">--aws-provider<\/span>\r\nsecrets.patterns <span class=\"o\">(<\/span>A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA<span class=\"o\">)[<\/span>A-Z0-9]<span class=\"o\">{<\/span>16<span class=\"o\">}<\/span>\r\nsecrets.patterns <span class=\"o\">(<\/span><span class=\"s2\">\"|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)(\"<\/span>|<span class=\"s1\">')?\\s*(:|=&gt;|=)\\s*(\"|'<\/span><span class=\"o\">)<\/span>?[A-Za-z0-9\/<span class=\"se\">\\+<\/span><span class=\"o\">=]{<\/span>40<span class=\"o\">}(<\/span><span class=\"s2\">\"|')?\r\nsecrets.patterns (\"<\/span>|<span class=\"s1\">')?(AWS|aws|Aws)?_?(ACCOUNT|account|Account)_?(ID|id|Id)?(\"|'<\/span><span class=\"o\">)<\/span>?<span class=\"se\">\\s<\/span><span class=\"k\">*<\/span><span class=\"o\">(<\/span>:|<span class=\"o\">=&gt;<\/span>|<span class=\"o\">=)<\/span><span class=\"se\">\\s<\/span><span class=\"k\">*<\/span><span class=\"o\">(<\/span><span class=\"s2\">\"|')?[0-9]{4}<\/span><span class=\"se\">\\-<\/span><span class=\"s2\">?[0-9]{4}<\/span><span class=\"se\">\\-<\/span><span class=\"s2\">?[0-9]{4}(\"<\/span>|<span class=\"s1\">')?\r\nsecrets.allowed AKIAIOSFODNN7EXAMPLE\r\nsecrets.allowed wJalrXUtnFEMI\/K7MDENG\/bPxRfiCYEXAMPLEKEY\r\n<\/span><\/code><\/pre>\n<p>\u7ecf\u8fc7 secrets.patterns \u68c0\u9a8c\u7684\u5185\u5bb9\u5c06\u88ab\u62d2\u7edd\uff0c\u800c\u7ecf\u8fc7 secrets.allowed \u6307\u5b9a\u7684\u5185\u5bb9\u5c06\u88ab\u7279\u522b\u5141\u8bb8\u3002<\/p>\n<details>\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u8bbe\u7f6e\u5185\u5bb9\uff1a<br \/>\n&#8211; \u4f3c\u4e4e\u662f AWS Access Key ID (A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}<br \/>\n&#8211; \u4f3c\u4e4e\u662f\u5206\u914d\u7684 AWS Secret Access Key\u3002\u7528\u4efb\u610f\u5f15\u53f7\u62ec\u8d77\u6765\u7684 &#8220;:&#8221; \u6216 &#8220;=&#8221;<br \/>\n&#8211; \u4f3c\u4e4e\u662f\u5206\u914d\u7684 AWS account ID\u3002\u7528\u4efb\u610f\u5f15\u53f7\u62ec\u8d77\u6765\u7684 &#8220;:&#8221; \u6216 &#8220;=&#8221;<br \/>\n&#8211; \u88ab\u6392\u9664\u7684 ~\/.aws\/credentials \u4e2d\u6307\u5b9a\u7684\u5185\u5bb9<br \/>\n&#8211; \u88ab\u5141\u8bb8\u7684\u793a\u4f8b AWS key \u6a21\u5f0f\u7684\u914d\u7f6e (AKIAIOSFODNN7EXAMPLE \u548c )<br \/>\n\u8bf7\u6ce8\u610f\uff0c\u4ee5\u4e0a\u662f\u5141\u8bb8\u7684\u8bbe\u7f6e\u3002<\/details>\n<p>\u4f7f\u7528&#8221;global&#8221;\u5173\u952e\u8bcd\uff0c\u53ef\u4ee5\u4f5c\u4e3a\u7528\u6237\u7684\u5171\u540c\u8bbe\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--install<\/span> ~\/.git-templates\/git-secrets\r\n<\/code><\/pre>\n<p>\u5c06\u7528\u4e8e\u5b58\u50a8\u5e93\u7684git hooks\u5b89\u88c5\u5230~\/.git-templates\/git-secrets\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git config <span class=\"nt\">--global<\/span> init.templatedir <span class=\"s1\">'~\/.git-templates\/git-secrets'<\/span>\r\n<\/code><\/pre>\n<p>\u5728config\u4e2d\u8bbe\u7f6e\u5b89\u88c5\u7684\u6a21\u677f\u3002<\/p>\n<p>\u8fd9\u4e2a\u64cd\u4f5c\u80fd\u591f\u5c06\u5173\u4e8eAWS\u7684\u57fa\u672c\u77e5\u8bc6\u624e\u5b9e\u5730\u638c\u63e1\uff0c\u5e76\u53ef\u4ee5\u6210\u529f\u901a\u8fc7\u5ba1\u6838\u3002?<\/p>\n<h2>\u5176\u4ed6\u547d\u4ee4<\/h2>\n<h3>\u626b\u63cf<\/h3>\n<p>\u5bf9\u4e8e\u60f3\u8981\u68c0\u67e5\u7279\u5b9a\u6587\u4ef6\/\u6587\u4ef6\u5939\u800c\u4e0d\u8fdb\u884c\u63d0\u4ea4\u7684\u60c5\u51b5\uff0c\u8fd9\u662f\u6709\u6548\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--scan<\/span> test.txt \/\/ \u30d5\u30a1\u30a4\u30eb\u306e\u691c\u67fb\r\n<span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--scan<\/span> testDir \/\/ \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u691c\u67fb \r\n<span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--scan<\/span> <span class=\"nt\">-r<\/span> testDir \/\/ \u518d\u5e30\u7684\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u691c\u67fb\r\n<\/code><\/pre>\n<p>\u53ea\u6709\u901a\u8fc7 git ls-files \u5217\u51fa\u7684\u626b\u63cf\u6587\u4ef6\u624d\u662f\u76ee\u6807\u6587\u4ef6\uff0c\u6240\u4ee5 .gitignore \u4e2d\u7684\u6587\u4ef6\u7b49\u90fd\u4e0d\u5728\u76ee\u6807\u8303\u56f4\u5185\u3002\u5f88\u65b9\u4fbf\u3002<br \/>\n\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0c\u52a0\u4e0a &#8211;no-index \u9009\u9879\u540e\uff0c\u5b83\u53ef\u4ee5\u68c0\u67e5\u975e git \u6587\u4ef6\u3002<\/p>\n<h3>\u626b\u63cf\u5386\u53f2<\/h3>\n<p>\u53ea\u9700\u4e00\u500b\u9078\u9805\uff0c\u4e0b\u9762\u662f\u539f\u6587\u7684\u4e2d\u6587\u7ffb\u8b6f:<\/p>\n<p>\u8a72\u5de5\u5177\u53ef\u4ee5\u6aa2\u67e5\u904e\u53bb\u7684\u63d0\u4ea4\u8a18\u9304\uff0c\u5c0d\u65bc\u5728\u9014\u4e2d\u5f15\u5165git-secrets\u7b49\u5de5\u5177\u6642\u975e\u5e38\u6709\u7528\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git secrets <span class=\"nt\">--scan-history<\/span>\r\n<\/code><\/pre>\n<h3>\u6dfb\u52a0<\/h3>\n<p>\u60a8\u53ef\u4ee5\u6dfb\u52a0\u7981\u6b62\u6216\u8005\u5141\u8bb8\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$git<\/span> secrets <span class=\"nt\">--add<\/span> <span class=\"s2\">\"secret<\/span><span class=\"se\">\\s<\/span><span class=\"s2\">*=<\/span><span class=\"se\">\\s<\/span><span class=\"s2\">*\"<\/span>\r\n<\/code><\/pre>\n<h2>\u4f7f\u7528SourceTree\u8fdb\u884c\u64cd\u4f5c<\/h2>\n<p>\u3010\u8ffd\u52a0\u3011\u5982\u679c\u5728SourceTree\u4e0a\u5b89\u88c5\u4e86git-secrets\uff0c\u5e76\u5c1d\u8bd5\u8fdb\u884c\u4efb\u4f55\u64cd\u4f5c\u65f6\uff0c<\/p>\n<pre class=\"post-pre\"><code>git: 'secrets' is not a git command. See 'git --help'.\r\n<\/code><\/pre>\n<p>\u53ea\u9700\u8981\u4e00\u79cd\u9009\u62e9\uff0c\u539f\u53e5\u7684\u4e2d\u6587\u91ca\u4e49\u662f\uff1a<br \/>\n\u51fa\u73b0\u4e86\u8fd9\u4e2a\u9519\u8bef\u3002<br \/>\n\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">git\u5b9f\u884c\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u540c\u3058\u968e\u5c64\u306bgit-secrets\u5b9f\u884c\u30d7\u30e9\u30b0\u30e9\u30e0\u3092\u304a\u304f\uff08\u3082\u3057\u304f\u306f\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u8cbc\u308b\uff09<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">soureTree\u306egit\u5b9f\u884c\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u540c\u3058\u968e\u5c64\u306b\u8cbc\u308b\u3002<\/ul>\n<p>\u53ef\u4ee5\u89e3\u51b3\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">#git\u306e\u5834\u6240<\/span>\r\n<span class=\"nv\">$ <\/span>which git\r\n\/usr\/bin\/git  \r\n\r\n<span class=\"c\">#git-secrets\u306e\u5834\u6240<\/span>\r\n<span class=\"nv\">$ <\/span>which git-secrets\r\n\/usr\/local\/bin\/git-secrets \r\n\r\n<span class=\"k\">in<\/span> <span class=\"c\">#\u5b9f\u884c\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u540c\u3058\u968e\u5c64\u306b\u30b3\u30d4\u30fc <\/span>\r\n<span class=\"nb\">cp<\/span> \/usr\/bin\/git \/usr\/local\/bin\r\n\r\n<\/code><\/pre>\n<p>\u5982\u679c\u5728Mac\u4e0a\u51fa\u73b0\u6743\u9650\u9519\u8bef\u7b49\u60c5\u51b5\uff0c\u53ef\u80fd\u662f\u7cfb\u7edf\u5b8c\u6574\u6027\u4fdd\u62a4\uff08SIP\uff09\u88ab\u542f\u7528\u4e86\u3002<br \/>\n\u3010\u9ad8\u7ea7\u7528\u6237\u3011\u7981\u7528System Integrity Protection (SIP)\u7684\u65b9\u6cd5\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2fe237434c4406c59bf9\/43-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2021-05-27 15.12.45.png\" \/><\/div>\n<h2>\u6587\u732e\u5f15\u7528<\/h2>\n<p>\u4e3a\u4e86\u5728AWS\u4e0a\u8fdb\u884c\u7cfb\u7edf\u8bbe\u8ba1\u548c\u6700\u4f73\u5b9e\u8df5\uff0c\u6211\u6b63\u5728\u5b9e\u8df5Terraform\uff0c\u8fd9\u662f\u7531\u4e09\u7701\u5802\u4e66\u5e97\u901a\u8fc7Impress R&amp;D\u51fa\u7248\u7684\u4e66\u7c4d\u3002\u6211\u5f00\u59cb\u4f7f\u7528git-secrets\u4e86\u3002\u4e3a\u4e86\u4e0d\u8ba9AWS\u8bbf\u95ee\u5bc6\u94a5\u6df7\u5165\u5230Git\u4ed3\u5e93\u4e2d\uff0c\u6211\u5f15\u5165\u4e86git-secrets\u3002\u4e3a\u4e86\u907f\u514d\u4e91\u7aef\u7834\u4ea7\uff0c\u6211\u6b63\u5728\u4f7f\u7528git-secrets\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u5f00\u59cb\u5b66\u4e60AWS\uff0c\u5b66\u4e60\u4e86\u5982\u4f55\u901a\u8fc7`git-secrets&#8217;\u5b9e\u73b0\u5b89\u5168\u64cd\u4f5c\u3002\u4e3a\u4e86\u4e0d\u5fd8\u8bb0\uff0c\u6211\u6574\u7406\u4e86\u4e00\u4e0b\u3002 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37669","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732\" \/>\n<meta property=\"og:description\" content=\"\u6211\u5f00\u59cb\u5b66\u4e60AWS\uff0c\u5b66\u4e60\u4e86\u5982\u4f55\u901a\u8fc7`git-secrets&#8217;\u5b9e\u73b0\u5b89\u5168\u64cd\u4f5c\u3002\u4e3a\u4e86\u4e0d\u5fd8\u8bb0\uff0c\u6211\u6574\u7406\u4e86\u4e00\u4e0b\u3002 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-13T15:17:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-03T23:50:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2fe237434c4406c59bf9\/43-0.png\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/\",\"name\":\"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2024-01-13T15:17:59+00:00\",\"dateModified\":\"2024-05-03T23:50:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732","og_description":"\u6211\u5f00\u59cb\u5b66\u4e60AWS\uff0c\u5b66\u4e60\u4e86\u5982\u4f55\u901a\u8fc7`git-secrets&#8217;\u5b9e\u73b0\u5b89\u5168\u64cd\u4f5c\u3002\u4e3a\u4e86\u4e0d\u5fd8\u8bb0\uff0c\u6211\u6574\u7406\u4e86\u4e00\u4e0b\u3002 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-01-13T15:17:59+00:00","article_modified_time":"2024-05-03T23:50:55+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2fe237434c4406c59bf9\/43-0.png"}],"author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/","name":"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2024-01-13T15:17:59+00:00","dateModified":"2024-05-03T23:50:55+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528git-secrets\u6765\u9632\u6b62\u901a\u8fc7git\u7684\u4fe1\u606f\u6cc4\u9732"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8git-secrets%e6%9d%a5%e9%98%b2%e6%ad%a2%e9%80%9a%e8%bf%87git%e7%9a%84%e4%bf%a1%e6%81%af%e6%b3%84%e9%9c%b2%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37669"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37669\/revisions"}],"predecessor-version":[{"id":97062,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37669\/revisions\/97062"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}