{"id":317240,"date":"2021-01-31T21:00:19","date_gmt":"2021-01-31T21:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317240"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317240","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u0432 git \u0438 ansible"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fe\/0a9\/727\/2fe0a972708990e57bc0c30b8125ce2a.jpg\" width=\"1280\" height=\"600\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u043d\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u043c git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438? \u041d\u0435\u0442 \u043b\u0438 \u0441\u0440\u0435\u0434\u0438 \u0441\u043e\u0442\u0435\u043d \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u043e\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0443\u0434\u0430 \u043f\u043e \u043e\u0448\u0438\u0431\u043a\u0435?<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 ansible \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u043f\u0430\u0434\u0435\u0442 \u0438 \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442 \u043f\u0430\u0440\u043e\u043b\u0438 \u0432 \u043b\u043e\u0433\u0435?<\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<h2>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/h2>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041e\u043b\u0435\u0433, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u0434\u043b\u044f \u0420\u0424 \u0431\u0430\u043d\u043a\u0435, \u0432 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0438 &#171;IT \u0434\u043b\u044f IT&#187;.<\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043a \u043d\u0430\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0437\u044c\u044f&nbsp;\u0438\u0437 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f (OPS)&nbsp;\u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u043f\u043e\u043c\u043e\u0447\u044c \u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0438\u0435\u043c\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0435\u043f\u043b\u043e\u044f (ansible) \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430&nbsp;\u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0430\u0445.&nbsp;<\/p>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 git \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e), \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434, \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0435\u043f\u043b\u043e\u044f, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0442\u0434, \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a OPS \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439.<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f&nbsp;\u0432 master&nbsp;\u0432\u0435\u0442\u043a\u0435 \u0438 \u043f\u0440\u0438 \u0432\u043b\u0438\u0432\u0430\u043d\u0438\u0438 \u0432 \u043d\u0435\u0435 \u043d\u0443\u0436\u0435\u043d \u0430\u043f\u0440\u0443\u0432 \u043e\u0442 OPS.&nbsp;<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043c \u0436\u0435 \u0432 git&nbsp;\u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0438&nbsp;\u043f\u0430\u0440\u043e\u043b\u0438 \u043e\u0442 \u0441\u0440\u0435\u0434 (\u0445\u043e\u0442\u044c \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435) \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043d\u0438\u0445 OPS\u044b. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0435 Jenkins \u0438\u043b\u0438 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u0432 git &#8212; \u044d\u0442\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0430\u044f \u0443\u0442\u0435\u0447\u043a\u0430 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442 (\u0441 \u043f\u0430\u044f\u043b\u044c\u043d\u0438\u043a\u043e\u043c) \u0438\u043c\u0435\u043d\u043d\u043e \u043a OPS.<\/p>\n<p><em>\u041f\u0430\u0440\u043e\u043b\u0438 \u0432 git? \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e?<\/em><\/p>\n<blockquote>\n<p>\u0414\u0430, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b secret management, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a&nbsp;<a href=\"https:\/\/www.hashicorp.com\/products\/vault\/secrets-management\" rel=\"noopener noreferrer nofollow\">HashiCorp Vault<\/a>,&nbsp;<a href=\"https:\/\/www.conjur.org\/\" rel=\"noopener noreferrer nofollow\">CyberArk Conjur<\/a>&nbsp;\u0438\u0442\u0434.<\/p>\n<p>\u041d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0442\u0443\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438 \u0434\u043e\u043b\u0433\u0438\u0439, \u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<\/blockquote>\n<p>\u0427\u0438\u0441\u043b\u043e \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u0434\u0435\u043f\u043b\u043e\u0435\u0432 \u0440\u0430\u0441\u0442\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438 \u0440\u0435\u0431\u044f\u0442\u0430 \u0443\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e pull request \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a \u043d\u0438\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e.<\/p>\n<p>\u0417\u043d\u0430\u0447\u0438\u0442, \u0431\u0443\u0434\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c!<\/p>\n<h4>\u0427\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c?<\/h4>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0432\u044b\u044f\u0432\u0438\u043b\u0438 3 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0438 \u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e:<\/p>\n<p><strong>\u041f\u0430\u0440\u043e\u043b\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435&nbsp;<\/strong><\/p>\n<pre><code>---     dev_ssh_username1: \"admin\"     dev_ssh_password1: \"admin123\"<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u044f\u0441\u043d\u043e &#8212; \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dc2\/fd4\/0f8\/dc2fd40f8205d50312b80e70a95b9e6f.png\" width=\"296\" height=\"352\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 shell \u0438\u043b\u0438 command \u0442\u0430\u0441\u043a\u0438 ansible<\/strong><\/p>\n<pre><code>- name: Deploy   hosts: all   tasks:     - name: Update       shell: \"update.sh --user={{ update_user }} --password={{ update_password }}\"<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 playbook \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0441 -v \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043d\u0430\u0448\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<pre><code>$ ansible-playbook deploy.yml -i env\/DEV\/hosts -v TASK [Update] ****************************************************************** changed: [192.168.1.2] =&gt; {\"changed\": true, \"cmd\": \"\/home\/dev\/update.sh --user=secret_user --password=secret_password\", \"delta\": \"0:00:05.056532\", \"end\": \"2020-11-06 09:53:09.397355\", \"rc\": 0, \"start\": \"2020-11-06 09:53:04.340823\", \"stderr\": \"\", \"stderr_lines\": [], \"stdout\": \"Update SUCCESS\", \"stdout_lines\": [\"Update SUCCESS\"]}<\/code><\/pre>\n<p>\u0418\u043b\u0438, \u0435\u0441\u043b\u0438 playbook \u0443\u043f\u0430\u0434\u0435\u0442 \u0442\u043e \u0432 \u043b\u043e\u0433\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u043c\u0438 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c -v)<\/p>\n<pre><code>$ ansible-playbook deploy.yml -i env\/DEV\/hosts TASK [Update] ****************************************************************** fatal: [192.168.1.2]: FAILED! =&gt; {\"changed\": true, \"cmd\": \"\/home\/dev\/update.sh --user=secret_user --password=secret_password\", \"delta\": \"0:00:00.018710\", \"end\": \"2020-11-06 10:14:30.642419\", \"msg\": \"non-zero return code\", \"rc\": 127, \"start\": \"2020-11-06 10:14:30.623709\", \"stderr\": \"\/bin\/sh: \/home\/dev\/update.sh: \u041d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\", \"stderr_lines\": [\"\/bin\/sh: \/home\/dev\/update.sh: \u041d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\"], \"stdout\": \"\", \"stdout_lines\": []}<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c environment, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>- name: Deploy   hosts: all   tasks:     - name: Update       shell: \"\/home\/dev\/update.sh $AUTH_DATA\"       environment:         AUTH_DATA: \"--user={{ update_user }} --password={{ update_password }}\"<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 \u0432\u044b\u0432\u043e\u0434 \u043d\u0430\u0448\u0438 credentials \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442. \u0415\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 no_log.<\/p>\n<\/p>\n<p><strong>\u041d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 withCredentials<\/strong><\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Jenkins, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 credentials \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f&nbsp;<a href=\"https:\/\/www.jenkins.io\/doc\/pipeline\/steps\/credentials-binding\/\" rel=\"noopener noreferrer nofollow\">withCredentials<\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 pipeline \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c credential, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043a\u0430\u043a\u043e\u0439 \u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. Jenkins \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u043e\u0433\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code>node {   stage('Jenkins Credentials | Decrypt Secret File') {     withCredentials([file(credentialsId: 'credentials-id', variable: 'secretFile')]) {       sh 'cat $secretFile'     }   } }<\/code><\/pre>\n<p>\u0422\u043e \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043b\u043e\u0433\u0435 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u0422\u0430\u043a \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e&nbsp;secretFile \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0438 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0432 \u043b\u043e\u0433 \u0432\u043d\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438&nbsp;withCredentials.<\/p>\n<p><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0442\u043c\u0435\u0447\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043e\u0442\u0434\u0430\u044e \u0441\u0435\u0431\u0435 \u043e\u0442\u0447\u0435\u0442 \u0447\u0442\u043e \u043e\u0442 \u0437\u043b\u043e\u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u044d\u0442\u043e \u043d\u0435 \u0441\u043f\u0430\u0441\u0435\u0442 (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 \u0431\u0430\u043d\u043a\u0430 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b).<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cef\/f5d\/e20\/ceff5de20d1950d8e3b873a3821e6cc0.jpg\" width=\"500\" height=\"278\"><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u0449\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u0438<\/h2>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f \u0442\u043e \u043f\u043b\u0435\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0423 \u043d\u0430\u0441 \u0432 \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0435\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e&nbsp;<a href=\"https:\/\/www.sonarqube.org\/\" rel=\"noopener noreferrer nofollow\">SonarQube<\/a>&nbsp;\u043d\u043e \u0438&nbsp;<a href=\"https:\/\/www.checkmarx.com\/\" rel=\"noopener noreferrer nofollow\">Checkmarx<\/a>. \u0423\u0436 \u043e\u043d\u0438 \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043c\u0435\u0442\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0418 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0432\u043e\u0442 \u043e\u043d\u043e &#8212; \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f SonarQube&nbsp;<a href=\"https:\/\/rules.sonarsource.com\/java\/RSPEC-2068\" rel=\"noopener noreferrer nofollow\">Hard-coded credentials are security-sensitive<\/a><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e4\/62b\/2a9\/3e462b2a9cd3df316e526989446a0408.png\" width=\"760\" height=\"357\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u043f\u0440\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u043e\u043d\u043e  \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d. \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e&nbsp;<a href=\"https:\/\/github.com\/SonarSource\/sonar-java\/blob\/dfdf526f4b3446e181e6a869be9410400ce0499e\/java-checks\/src\/main\/java\/org\/sonar\/java\/checks\/HardCodedCredentialsCheck.java\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>C Checkmarx \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u0430 &#8212; \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e. \u0418 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0430\u043c \u0442\u043e\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 (\u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 Application Security \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442:<\/p>\n<pre><code class=\"java\">import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController;   @RestController public class DemoController {     @RequestMapping(\"\/show_me_creds\")     public @ResponseBody String show_me_creds() {         String thisIsMyLittleSecret = \"qwerty12345\";         return thisIsMyLittleSecret;     } }<\/code><\/pre>\n<p>\u0418\u0437\u0443\u0447\u0438\u0432 \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 opensource \u0443\u0442\u0438\u043b\u0438\u0442. \u0417\u0430\u043f\u0440\u043e\u0441 \u0432 google &#171;find secrets in git&#187; \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/awslabs\/git-secrets\/blob\/master\/README.rst\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/awslabs\/git-secrets\/blob\/master\/README.rst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/dxa4481\/truffleHog\/blob\/dev\/README.md\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/dxa4481\/truffleHog\/blob\/dev\/README.md<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/Yelp\/detect-secrets\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/Yelp\/detect-secrets<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/zricethezav\/gitleaks\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/zricethezav\/gitleaks<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u0438\u0445 \u0432\u0441\u0435 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 Gitleaks, \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 regexp, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0423\u043c\u0435\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043f\u043e\u0440\u0442\u044b \u0432 json;<\/p>\n<\/li>\n<li>\n<p>\u041b\u0435\u0433\u043a\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043f\u0438\u043b\u043e\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 &#8212; \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0435\u0436\u0438\u0442 toml \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:&nbsp;<\/p>\n<pre><code>[[rules]]   description = \"generic secret regex\"   regex = '''secret(.{0,20})([0-9a-zA-Z-._{}$\\\/\\+=]{20,120})'''   tags = [\"secret\", \"example\"]<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0443\u044e \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:&nbsp;<\/p>\n<pre><code>[[rules]]   description = \"entropy and regex example\"   regex = '''secret(.{0,20})([0-9a-zA-Z-._{}$\\\/\\+=]{20,120})'''   [[rules.Entropies]]     Min = \"4.5\"     Max = \"4.7\"<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442: &#171;\u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e, \u0438 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u044b&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Entropy_(information_theory)\" rel=\"noopener noreferrer nofollow\">\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438&nbsp;<\/a>\u043e\u0442 4,5 \u0434\u043e 4,7, \u0442\u043e \u044d\u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c&#187;<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0432\u0441\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e&nbsp;<a href=\"https:\/\/github.com\/zricethezav\/gitleaks\/wiki\/Configuration\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code>\u279c  ~  gitleaks --repo=gitleaks --repo=https:\/\/github.com\/gitleakstest\/gronit.git --verbose --pretty INFO[2020-04-28T13:00:34-04:00] cloning... https:\/\/github.com\/gitleakstest\/gronit.git Enumerating objects: 135, done. Total 135 (delta 0), reused 0 (delta 0), pack-reused 135 {         \"line\": \"const AWS_KEY = \\\"AKIALALEMEL33243OLIAE\\\"\",         \"offender\": \"AKIALALEMEL33243OLIA\",         \"commit\": \"eaeffdc65b4c73ccb67e75d96bd8743be2c85973\",         \"repo\": \"gronit.git\",         \"rule\": \"AWS Manager ID\",         \"commitMessage\": \"remove fake key\",         \"author\": \"Zachary Rice\",         \"email\": \"zricethezav@users.noreply.github.com\",         \"file\": \"main.go\",         \"date\": \"2018-02-04T19:43:28-06:00\",         \"tags\": \"key, AWS\" } ... ... WARN[2020-04-28T13:00:35-04:00] 6 leaks detected. 33 commits audited in 77 milliseconds 738 microseconds<\/code><\/pre>\n<p>\u0418\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u044b\u0448\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e gitleaks \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c &#8212; \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0435\u043f\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u043d\u0435 \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 &#8212; \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043d\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 whitelist \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>[[rules]]   description = \"entropy and regex example\"   regex = '''secret(.{0,20})['|\"]([0-9a-zA-Z-._{}$\\\/\\+=]{20,120})['|\"]'''   [[rules.Entropies]]     Min = \"4.5\"     Max = \"4.7\"   [[rules.whitelist]]     regex = '''secret.some_value_that_match_regexp_but_not_really_a_secret'''     description = \"ignore that string\"<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 &#8212; \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 pull request \u0447\u0435\u0440\u0435\u0437 webhook \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Jenkins, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e gitleaks \u0438 \u0435\u0441\u043b\u0438 \u0442\u043e\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0443\u0442\u0435\u0447\u043a\u0438 &#8212; \u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 NEED WORK.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0442\u044e\u043d\u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f, \u0442\u0430\u043a \u0436\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 gitleaks \u043f\u0430\u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u0432\u0435\u0442\u0438\u043b\u0438\u0441\u044c \u0432 \u043b\u043e\u0433\u0430\u0445 (\u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0440\u044f\u0441\u044c \u0441 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u0435\u0439 \u043c\u044b \u043d\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u0438).&nbsp;<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/19f\/43b\/346\/19f43b34624613fe3ea128e05808084d.jpg\" width=\"316\" height=\"160\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c ansible<\/h2>\n<p>\u0414\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435, \u0438\u0442\u0430\u043a, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 playbook, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u043b\u043e\u0433\u0430\u0445 Jenkins \u043d\u0430\u0448\u0438 \u043a\u0440\u0435\u0434\u044b.<\/p>\n<pre><code>- name: Deploy   hosts: all   tasks:     - name: Update       shell: \"update.sh --user={{ update_user }} --password={{ update_password }}\"<\/code><\/pre>\n<p>\u0421 ansible \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u0435\u0433\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OPA (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e&nbsp;<a href=\"https:\/\/habr.com\/ru\/company\/oleg-bunin\/blog\/328262\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e&nbsp;<\/a>\u043e\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430 \u0422\u043e\u043a\u0430\u0440\u0435\u0432\u0430&nbsp;&nbsp;\u043f\u043e \u0442\u0435\u043c\u0435), \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u0438\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 python.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e \u0447\u0442\u043e \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438 \u043f\u0440\u043e&nbsp;<a href=\"https:\/\/ansible-lint.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">Ansible Lint<\/a>.<\/p>\n<p>\u042d\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u043d\u0442\u0435\u0440 \u0434\u043b\u044f Ansible, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187; \u043a\u0443\u0447\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a, \u043d\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043d\u0435 \u044d\u0442\u043e.<\/p>\n<p>\u041d\u0430\u043c \u0431\u044b\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0432\u043e\u0442 \u044d\u0442\u0438 2 \u0444\u0438\u0447\u0438:<\/p>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0438\u0441\u043a playbook. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0432 \u043f\u0430\u043f\u043a\u0435 \u0438 \u043e\u043d \u0441\u0430\u043c \u043d\u0430\u0439\u0434\u0435\u0442 \u0438\u0445.&nbsp;<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 python \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 id, short description, description \u0438 tags (\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Ansible Lint \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b) \u0438 \u043c\u0435\u0442\u043e\u0434\u044b match \u0438\u043b\u0438 matchtask, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432&nbsp;<a href=\"https:\/\/ansible-lint.readthedocs.io\/en\/latest\/rules.html#creating-custom-rules\" rel=\"noopener noreferrer nofollow\">\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c matchtask, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 task, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.&nbsp;<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0430\u0441\u043a\u0430, \u043d\u043e \u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 (\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e&nbsp;<a href=\"https:\/\/github.com\/ansible\/ansible-lint\/blob\/master\/lib\/ansiblelint\/rules\/CommandsInsteadOfModulesRule.py\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>):<\/p>\n<pre><code class=\"python\">class CommandsInsteadOfModulesRule(AnsibleLintRule):     id = '303'     shortdesc = 'Using command rather than module'     description = (         'Executing a command when there is an Ansible module '         'is generally a bad idea'     )     severity = 'HIGH'     tags = ['command-shell', 'resources', 'ANSIBLE0006']       _commands = ['command', 'shell']     _modules = {         'apt-get': 'apt-get', #\u0441\u043e\u043a\u0440\u0430\u0449\u0430\u044e \u0441\u043f\u0438\u0441\u043e\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044e         'yum': 'yum',     }       def matchtask(self, file, task):         if task['action']['__ansible_module__'] not in self._commands:             return           first_cmd_arg = get_first_cmd_arg(task)         if not first_cmd_arg:             return           executable = os.path.basename(first_cmd_arg)         if executable in self._modules and \\                 boolean(task['action'].get('warn', True)):             message = '{0} used in place of {1} module'             return message.format(executable, self._modules[executable])<\/code><\/pre>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f &#8212; \u0435\u0441\u043b\u0438 task \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f command \u0438\u043b\u0438 shell \u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430&nbsp;_modules &#8212; \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<p>\u041d\u0430\u0448\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u044b \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c &#8212; \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (password\/pass\/login \u0438\u0442\u0434) \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0442\u0430\u0441\u043a\u043e\u0432 command \u0438 shell \u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a.&nbsp;<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u043c\u044b \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 no_log, \u043f\u0440\u0438 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c. \u0415\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0443\u0431\u0435\u0440\u0435\u0442 no_log &#8212; \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043e\u043f\u044f\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044d\u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Gitleaks \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f Ansible Lint, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u043d\u0430\u0448\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. \u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438, \u0442.\u043a. \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u0430 (\u0445\u043e\u0442\u044f \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0432\u0441\u0435\u043c).<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c withCredentials<\/h2>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0432 Jenkinsfile \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0432 \u043b\u043e\u0433 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0442\u0435\u0447\u043a\u043e\u0439 (\u0445\u043e\u0442\u044f \u0438 \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443).<\/p>\n<pre><code>node {   stage('Jenkins Credentials | Decrypt Secret File') {     withCredentials([file(credentialsId: 'credentials-id', variable: 'secretFile')]) {       sh 'cat $secretFile'     }   } }<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u0441 \u0436\u0434\u0430\u043b \u043f\u0440\u043e\u0432\u0430\u043b.<\/p>\n<p>Jenkinsfile \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 groovy, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0430&nbsp;<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%B1%D1%81%D1%82%D1%80%D0%B0%D0%BA%D1%82%D0%BD%D0%BE%D0%B5_%D1%81%D0%B8%D0%BD%D1%82%D0%B0%D0%BA%D1%81%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B5_%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE\" rel=\"noopener noreferrer nofollow\">Abstract Syntax Tree<\/a>&nbsp;\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.&nbsp; \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438&nbsp;<a href=\"http:\/\/docs.groovy-lang.org\/next\/html\/gapi\/org\/codehaus\/groovy\/ast\/builder\/AstBuilder.html\" rel=\"noopener noreferrer nofollow\">AstBuilder<\/a>&nbsp;\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e, \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c&nbsp;withCredentials, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 withCredentials. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0434 \u0432\u044b\u0448\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0436\u0438\u0437\u043d\u0438 \u0432\u0441\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435,&nbsp;\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u044f \u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c&nbsp;secretFile \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c stage, \u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c&nbsp;secretFile \u0432 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438\u0442\u043f \u0438\u0442\u0434.&nbsp;<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u043b\u0441\u044f \u043a 1000 \u0441\u0442\u0440\u043e\u043a \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0435\u0433\u043e \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0440\u0430 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c, \u043f\u043b\u044e\u0441 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0447\u0442\u043e \u0432\u043f\u043e\u0440\u0443 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0434 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u044d\u0442\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0435\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435&nbsp;<u>\u043c\u044b \u043e\u0442\u043b\u043e\u0436\u0438\u043b\u0438<\/u>.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 pipeline \u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c&nbsp;<a href=\"https:\/\/github.com\/jenkinsci\/pipeline-model-definition-plugin\" rel=\"noopener noreferrer nofollow\">Pipeline model definition plugin<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u043d\u0443\u0442\u044c pipeline \u0432 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 json \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0435\u0433\u043e. \u041d\u0430\u043c \u044d\u0442\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u043b\u043e &#8212; \u0443 \u043d\u0430\u0441 \u0432\u043e\u0432\u0441\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0439.<\/p>\n<h2>\u0427\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435?<\/h2>\n<p>\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043f\u0438\u043b\u043e\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043f\u0430\u043b\u043e 1000 pull request. \u041f\u043e\u0440\u044f\u0434\u043a\u0430 3% \u0431\u044b\u043b\u0438 \u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f gitleaks, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0431\u044b\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b ansible.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0439, \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 OPS \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u044b \u0438 \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u044d\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u0442\u0430\u043a \u0436\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/nightfall.ai\/resources\/introducing-radar-api-detect-credentials-secrets-in-code-via-machine-learning\/\" rel=\"noopener noreferrer nofollow\">https:\/\/nightfall.ai\/resources\/introducing-radar-api-detect-credentials-secrets-in-code-via-machine-learning\/<\/a>&nbsp;&#8212; \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445. \u041a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b?<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.shellcheck.net\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.shellcheck.net\/<\/a>&nbsp;&#8212; \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u043a\u0443\u0447\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 shell \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/PyCQA\/bandit\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/PyCQA\/bandit<\/a>&nbsp;&#8212; \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 security linter \u0434\u043b\u044f python.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/twitter.com\/leak_scavenger\" rel=\"noopener noreferrer nofollow\">https:\/\/twitter.com\/leak_scavenger<\/a>&nbsp;&#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0431\u043e\u0442 \u0432 \u0442\u0432\u0438\u0442\u0442\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043a\u0430\u043d\u0438\u0442 github, pastebin, ghostbin \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432, \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u043a, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438\u0442\u0434. \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/540190\/\"> https:\/\/habr.com\/ru\/post\/540190\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u043d\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u043c git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438? \u041d\u0435\u0442 \u043b\u0438 \u0441\u0440\u0435\u0434\u0438 \u0441\u043e\u0442\u0435\u043d \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u043e\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0443\u0434\u0430 \u043f\u043e \u043e\u0448\u0438\u0431\u043a\u0435?<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 ansible \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u043f\u0430\u0434\u0435\u0442 \u0438 \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442 \u043f\u0430\u0440\u043e\u043b\u0438 \u0432 \u043b\u043e\u0433\u0435?<\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<h2>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/h2>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041e\u043b\u0435\u0433, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u0434\u043b\u044f \u0420\u0424 \u0431\u0430\u043d\u043a\u0435, \u0432 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0438 &#171;IT \u0434\u043b\u044f IT&#187;.<\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043a \u043d\u0430\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0437\u044c\u044f&nbsp;\u0438\u0437 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f (OPS)&nbsp;\u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u043f\u043e\u043c\u043e\u0447\u044c \u0438\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0438\u0435\u043c\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0435\u043f\u043b\u043e\u044f (ansible) \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430&nbsp;\u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0430\u0445.&nbsp;<\/p>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 git \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e), \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434, \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u0435\u043f\u043b\u043e\u044f, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0442\u0434, \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a OPS \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439.<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f&nbsp;\u0432 master&nbsp;\u0432\u0435\u0442\u043a\u0435 \u0438 \u043f\u0440\u0438 \u0432\u043b\u0438\u0432\u0430\u043d\u0438\u0438 \u0432 \u043d\u0435\u0435 \u043d\u0443\u0436\u0435\u043d \u0430\u043f\u0440\u0443\u0432 \u043e\u0442 OPS.&nbsp;<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043c \u0436\u0435 \u0432 git&nbsp;\u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0438&nbsp;\u043f\u0430\u0440\u043e\u043b\u0438 \u043e\u0442 \u0441\u0440\u0435\u0434 (\u0445\u043e\u0442\u044c \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435) \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043d\u0438\u0445 OPS\u044b. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0435 Jenkins \u0438\u043b\u0438 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u0432 git &#8212; \u044d\u0442\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0430\u044f \u0443\u0442\u0435\u0447\u043a\u0430 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442 (\u0441 \u043f\u0430\u044f\u043b\u044c\u043d\u0438\u043a\u043e\u043c) \u0438\u043c\u0435\u043d\u043d\u043e \u043a OPS.<\/p>\n<p><em>\u041f\u0430\u0440\u043e\u043b\u0438 \u0432 git? \u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e?<\/em><\/p>\n<blockquote>\n<p>\u0414\u0430, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b secret management, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a&nbsp;<a href=\"https:\/\/www.hashicorp.com\/products\/vault\/secrets-management\" rel=\"noopener noreferrer nofollow\">HashiCorp Vault<\/a>,&nbsp;<a href=\"https:\/\/www.conjur.org\/\" rel=\"noopener noreferrer nofollow\">CyberArk Conjur<\/a>&nbsp;\u0438\u0442\u0434.<\/p>\n<p>\u041d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0442\u0443\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438 \u0434\u043e\u043b\u0433\u0438\u0439, \u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<\/blockquote>\n<p>\u0427\u0438\u0441\u043b\u043e \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u0434\u0435\u043f\u043b\u043e\u0435\u0432 \u0440\u0430\u0441\u0442\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438 \u0440\u0435\u0431\u044f\u0442\u0430 \u0443\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e pull request \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a \u043d\u0438\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e.<\/p>\n<p>\u0417\u043d\u0430\u0447\u0438\u0442, \u0431\u0443\u0434\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c!<\/p>\n<h4>\u0427\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c?<\/h4>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0432\u044b\u044f\u0432\u0438\u043b\u0438 3 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0438 \u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e:<\/p>\n<p><strong>\u041f\u0430\u0440\u043e\u043b\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435&nbsp;<\/strong><\/p>\n<pre><code>---     dev_ssh_username1: \"admin\"     dev_ssh_password1: \"admin123\"<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u044f\u0441\u043d\u043e &#8212; \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0438 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 shell \u0438\u043b\u0438 command \u0442\u0430\u0441\u043a\u0438 ansible<\/strong><\/p>\n<pre><code>- name: Deploy   hosts: all   tasks:     - name: Update       shell: \"update.sh --user={{ update_user }} --password={{ update_password }}\"<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 playbook \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0441 -v \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043d\u0430\u0448\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<pre><code>$ ansible-playbook deploy.yml -i env\/DEV\/hosts -v TASK [Update] ****************************************************************** changed: [192.168.1.2] =&gt; {\"changed\": true, \"cmd\": \"\/home\/dev\/update.sh --user=secret_user --password=secret_password\", \"delta\": \"0:00:05.056532\", \"end\": \"2020-11-06 09:53:09.397355\", \"rc\": 0, \"start\": \"2020-11-06 09:53:04.340823\", \"stderr\": \"\", \"stderr_lines\": [], \"stdout\": \"Update SUCCESS\", \"stdout_lines\": [\"Update SUCCESS\"]}<\/code><\/pre>\n<p>\u0418\u043b\u0438, \u0435\u0441\u043b\u0438 playbook \u0443\u043f\u0430\u0434\u0435\u0442 \u0442\u043e \u0432 \u043b\u043e\u0433\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u043c\u0438 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c -v)<\/p>\n<pre><code>$ ansible-playbook deploy.yml -i env\/DEV\/hosts TASK [Update] ****************************************************************** fatal: [192.168.1.2]: FAILED! =&gt; {\"changed\": true, \"cmd\": \"\/home\/dev\/update.sh --user=secret_user --password=secret_password\", \"delta\": \"0:00:00.018710\", \"end\": \"2020-11-06 10:14:30.642419\", \"msg\": \"non-zero return code\", \"rc\": 127, \"start\": \"2020-11-06 10:14:30.623709\", \"stderr\": \"\/bin\/sh: \/home\/dev\/update.sh: \u041d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\", \"stderr_lines\": [\"\/bin\/sh: \/home\/dev\/update.sh: \u041d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\"], \"stdout\": \"\", \"stdout_lines\": []}<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c environment, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>- name: Deploy   hosts: all   tasks:     - name: Update       shell: \"\/home\/dev\/update.sh $AUTH_DATA\"       environment:         AUTH_DATA: \"--user={{ update_user }} --password={{ update_password }}\"<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 \u0432\u044b\u0432\u043e\u0434 \u043d\u0430\u0448\u0438 credentials \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442. \u0415\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 no_log.<\/p>\n<\/p>\n<p><strong>\u041d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 withCredentials<\/strong><\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Jenkins, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 credentials \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f&nbsp;<a href=\"https:\/\/www.jenkins.io\/doc\/pipeline\/steps\/credentials-binding\/\" rel=\"noopener noreferrer nofollow\">withCredentials<\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 pipeline \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c credential, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043a\u0430\u043a\u043e\u0439 \u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. Jenkins \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u043e\u0433\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code>node {   stage('Jenkins Credentials | Decrypt Secret File') {     withCredentials([file(credentialsId: 'credentials-id', variable: 'secretFile')]) {       sh 'cat $secretFile'     }   } }<\/code><\/pre>\n<p>\u0422\u043e \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043b\u043e\u0433\u0435 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u0422\u0430\u043a \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e&nbsp;secretFile \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0438 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0432 \u043b\u043e\u0433 \u0432\u043d\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438&nbsp;withCredentials.<\/p>\n<p><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0442\u043c\u0435\u0447\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043e\u0442\u0434\u0430\u044e \u0441\u0435\u0431\u0435 \u043e\u0442\u0447\u0435\u0442 \u0447\u0442\u043e \u043e\u0442 \u0437\u043b\u043e\u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u044d\u0442\u043e \u043d\u0435 \u0441\u043f\u0430\u0441\u0435\u0442 (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 \u0431\u0430\u043d\u043a\u0430 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b).<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<h2>\u0418\u0449\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u0438<\/h2>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u044d\u0442\u043e \u043a\u0430\u043a\u0430\u044f \u0442\u043e \u043f\u043b\u0435\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0423 \u043d\u0430\u0441 \u0432 \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0435\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e&nbsp;<a href=\"https:\/\/www.sonarqube.org\/\" rel=\"noopener noreferrer nofollow\">SonarQube<\/a>&nbsp;\u043d\u043e \u0438&nbsp;<a href=\"https:\/\/www.checkmarx.com\/\" rel=\"noopener noreferrer nofollow\">Checkmarx<\/a>. \u0423\u0436 \u043e\u043d\u0438 \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043c\u0435\u0442\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0418 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0432\u043e\u0442 \u043e\u043d\u043e &#8212; \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f SonarQube&nbsp;<a href=\"https:\/\/rules.sonarsource.com\/java\/RSPEC-2068\" rel=\"noopener noreferrer nofollow\">Hard-coded credentials are security-sensitive<\/a><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u043f\u0440\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u043e\u043d\u043e  \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d. \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e&nbsp;<a href=\"https:\/\/github.com\/SonarSource\/sonar-java\/blob\/dfdf526f4b3446e181e6a869be9410400ce0499e\/java-checks\/src\/main\/java\/org\/sonar\/java\/checks\/HardCodedCredentialsCheck.java\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>C Checkmarx \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u0430 &#8212; \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e. \u0418 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0430\u043c \u0442\u043e\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 (\u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 Application Security \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442:<\/p>\n<pre><code class=\"java\">import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController;   @RestController public class DemoController {     @RequestMapping(\"\/show_me_creds\")     public @ResponseBody String show_me_creds() {         String thisIsMyLittleSecret = \"qwerty12345\";         return thisIsMyLittleSecret;     } }<\/code><\/pre>\n<p>\u0418\u0437\u0443\u0447\u0438\u0432 \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 opensource \u0443\u0442\u0438\u043b\u0438\u0442. \u0417\u0430\u043f\u0440\u043e\u0441 \u0432 google &#171;find secrets in git&#187; \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/awslabs\/git-secrets\/blob\/master\/README.rst\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/awslabs\/git-secrets\/blob\/master\/README.rst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/dxa4481\/truffleHog\/blob\/dev\/README.md\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/dxa4481\/truffleHog\/blob\/dev\/README.md<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/Yelp\/detect-secrets\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/Yelp\/detect-secrets<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/zricethezav\/gitleaks\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/zricethezav\/gitleaks<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u0438\u0445 \u0432\u0441\u0435 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 Gitleaks, \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 regexp, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0423\u043c\u0435\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u043f\u043e\u0440\u0442\u044b \u0432 json;<\/p>\n<\/li>\n<li>\n<p>\u041b\u0435\u0433\u043a\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043f\u0438\u043b\u043e\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 &#8212; \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0435\u0436\u0438\u0442 toml \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:&nbsp;<\/p>\n<pre><code>[[rules]]   description = \"generic secret regex\"   regex = '''secret(.{0,20})([0-9a-zA-Z-._{}$\\\/\\+=]{20,120})'''   tags = [\"secret\", \"example\"]<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0443\u044e \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:&nbsp;<\/p>\n<pre><code>[[rules]]   description = \"entropy and regex example\"   regex = '''secret(.{0,20})([0-9a-zA-Z-._{}$\\\/\\+=]{20,120})'''   [[rules.Entropies]]     Min = \"4.5\"     Max = \"4.7\"<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442: &#171;\u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e, \u0438 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u044b&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Entropy_(information_theory)\" rel=\"noopener noreferrer nofollow\">\u044d\u043d\u0442\u0440\u043e\u043f\u0438\u0438&nbsp;<\/a>\u043e\u0442 4,5 \u0434\u043e 4,7, \u0442\u043e \u044d\u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c&#187;<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0432\u0441\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e&nbsp;<a href=\"https:\/\/github.com\/zricethezav\/gitleaks\/wiki\/Configuration\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code>\u279c  ~  gitleaks --repo=gitleaks --repo=https:\/\/github.com\/gitleakstest\/gronit.git --verbose --pretty INFO[2020-04-28T13:00:34-04:00] cloning... https:\/\/github.com\/gitleakstest\/gronit.git Enumerating objects: 135, done. Total 135 (delta 0), reused 0 (delta 0), pack-reused 135 {         \"line\": \"const AWS_KEY = \\\"AKIALALEMEL33243OLIAE\\\"\",         \"offender\": \"AKIALALEMEL33243OLIA\",         \"commit\": \"eaeffdc65b4c73ccb67e75d96bd8743be2c85973\",         \"repo\": \"gronit.git\",         \"rule\": \"AWS Manager ID\",         \"commitMessage\": \"remove fake key\",         \"author\": \"Zachary Rice\",         \"email\": \"zricethezav@users.noreply.github.com\",         \"file\": \"main.go\",         \"date\": \"2018-02-04T19:43:28-06:00\",         \"tags\": \"key, AWS\" } ... ... WARN[2020-04-28T13:00:35-04:00] 6 leaks detected. 33 commits audited in 77 milliseconds 738 microseconds<\/code><\/pre>\n<p>\u0418\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u044b\u0448\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e gitleaks \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c &#8212; \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u0435\u043f\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u043d\u0435 \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 &#8212; \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043d\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 whitelist \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>[[rules]]   description = \"entropy and regex example\"   regex = '''secret(.{0,20})['|\"]([0-9a-zA-Z-._{}$\\\/\\+=]{20,120})['|\"]'''   [[rules.Entropies]]     Min = \"4.5\"     Max = \"4.7\"   [[rules.whitelist]]     regex = '''secret.some_value_that_match_regexp_but_not_really_a_secret'''     description = \"ignore that string\"<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 &#8212; \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 pull request \u0447\u0435\u0440\u0435\u0437 webhook \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Jenkins, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e gitleaks \u0438 \u0435\u0441\u043b\u0438 \u0442\u043e\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0443\u0442\u0435\u0447\u043a\u0438 &#8212; \u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 NEED WORK.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0442\u044e\u043d\u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f, \u0442\u0430\u043a \u0436\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 gitleaks \u043f\u0430\u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u0432\u0435\u0442\u0438\u043b\u0438\u0441\u044c \u0432 \u043b\u043e\u0433\u0430\u0445 (\u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0440\u044f\u0441\u044c \u0441 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u0435\u0439 \u043c\u044b \u043d\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u0438).&nbsp;<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c ansible<\/h2>\n<p>\u0414\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435, \u0438\u0442\u0430\u043a, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 playbook, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u043b\u043e\u0433\u0430\u0445 Jenkins \u043d\u0430\u0448\u0438 \u043a\u0440\u0435\u0434\u044b.<\/p>\n<pre><code>- name: Deploy   hosts: all   tasks:     - name: Update       shell: \"update.sh --user={{ update_user }} --password={{ update_password }}\"<\/code><\/pre>\n<p>\u0421 ansible \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u0435\u0433\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OPA (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e&nbsp;<a href=\"https:\/\/habr.com\/ru\/company\/oleg-bunin\/blog\/328262\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e&nbsp;<\/a>\u043e\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430 \u0422\u043e\u043a\u0430\u0440\u0435\u0432\u0430&nbsp;&nbsp;\u043f\u043e \u0442\u0435\u043c\u0435), \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u0438\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 python.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e \u0447\u0442\u043e \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438 \u043f\u0440\u043e&nbsp;<a href=\"https:\/\/ansible-lint.readthedocs.io\/en\/latest\/\" rel=\"noopener noreferrer nofollow\">Ansible Lint<\/a>.<\/p>\n<p>\u042d\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u043d\u0442\u0435\u0440 \u0434\u043b\u044f Ansible, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187; \u043a\u0443\u0447\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a, \u043d\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043d\u0435 \u044d\u0442\u043e.<\/p>\n<p>\u041d\u0430\u043c \u0431\u044b\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0432\u043e\u0442 \u044d\u0442\u0438 2 \u0444\u0438\u0447\u0438:<\/p>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0438\u0441\u043a playbook. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0432 \u043f\u0430\u043f\u043a\u0435 \u0438 \u043e\u043d \u0441\u0430\u043c \u043d\u0430\u0439\u0434\u0435\u0442 \u0438\u0445.&nbsp;<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 python \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c<\/p>\n<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-317240","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=317240"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317240\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}