{"id":470444,"date":"2025-08-12T15:00:25","date_gmt":"2025-08-12T15:00:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=470444"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=470444","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u043f\u043e\u0439\u043c\u0430\u043b \u0441\u0435\u0442\u0435\u0432\u0438\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 SSH \u0438 \u0447\u0435\u043c \u044d\u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0415\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e: \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u0442\u043e\u2011\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u00a0\u0443\u0449\u0435\u0440\u0431 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412\u00a0\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e. \u0421\u0435\u0442\u0435\u0432\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u00ab\u0441 \u043b\u0451\u0442\u0443\u00bb, \u0438 \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e. \u041f\u043e\u043a\u0430 \u0440\u0435\u0447\u044c \u043d\u0435\u00a0\u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u00a0\u043f\u0430\u0440\u043e\u043b\u0438. \u041e\u0434\u0438\u043d \u0438\u0437\u00a0\u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441\u0442\u0430\u043b \u0434\u043b\u044f\u00a0\u043d\u0430\u0441 \u0443\u0440\u043e\u043a\u043e\u043c \u041d\u0430\u00a0\u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434\u00a0\u2014 \u043c\u0435\u043b\u043e\u0447\u044c, \u043d\u043e\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0433\u043b\u0438\u00a0\u0431\u044b\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0435\u0435.<\/p>\n<p><strong>\u041a\u0430\u043a\u00a0\u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c<\/strong><\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c. \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0435 <code>(ps aux)<\/code> \u0438 \u0432\u0434\u0440\u0443\u0433 \u0432\u0438\u0436\u0443:<\/p>\n<pre><code>bash sshpass -p 'Qwerty123' ssh admin@10.0.5.21<\/code><\/pre>\n<p>\u041f\u0430\u0440\u043e\u043b\u044c. \u0412\u00a0\u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435. \u0412\u00a0\u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. <\/p>\n<p>\u041f\u043e\u0434\u043e\u0448\u0451\u043b \u043a\u00a0\u043a\u043e\u043b\u043b\u0435\u0433\u0435:<\/p>\n<blockquote>\n<p><em>\u2014 \u042d\u0442\u043e \u0447\u0442\u043e\u00a0\u0437\u0430\u00a0\u043c\u0430\u0433\u0438\u044f? <\/em><\/p>\n<p><em>\u2014 \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u00a0\u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437. <\/em><\/p>\n<p><em>\u2014 \u0422\u044b \u0432\u00a0\u043a\u0443\u0440\u0441\u0435, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0435? <\/em><\/p>\n<p><em>\u2014 \u041d\u0443 \u043c\u044b\u00a0\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0442\u0438 <\/em><\/p>\n<p><em>\u2014  \u0414\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e <\/em><code><em>ps<\/em><\/code><em> \u0438\u043b\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0438.<\/em><\/p>\n<\/blockquote>\n<p>\u0427\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0443 \u0447\u0430\u0441\u043e\u0432 \u0443\u00a0\u043d\u0430\u0441 \u0443\u0436\u0435\u00a0\u0431\u044b\u043b \u0432\u043d\u0435\u043f\u043b\u0430\u043d\u043e\u0432\u044b\u0439 \u0430\u0443\u0434\u0438\u0442.<\/p>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430:<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0432\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445\u00a0\u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d. <\/p>\n<ul>\n<li>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0438\u0434\u043d\u044b \u0432 <code>ps<\/code>, <code>\/proc\/[PID]\/cmdline<\/code>, Task Manager. <\/p>\n<\/li>\n<li>\n<p>\u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432\u00a0\u043b\u043e\u0433\u0438 CI\/CD. <\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0438 \u0430\u0443\u0434\u0438\u0442 \u0442\u043e\u0436\u0435 \u0438\u0445 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044f\u0442. <\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (<code>sshpass<\/code>, <code>plink<\/code>, <code>WinSCP CLI<\/code>, <code>rsync<\/code>, <code>mysql<\/code>, <code>curl<\/code>, <code>mRemoteNG<\/code>) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0442\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c\u00a0\u2014 \u0438 \u044d\u0442\u043e \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0434\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u00ab\u043a\u043e\u0441\u0442\u044b\u043b\u044f\u00bb.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u043d\u043e, \u0434\u0430\u0436\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044f \u0441\u0430\u043c SSH.<\/p>\n<p><strong>\u041a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438<\/strong><\/p>\n<p><strong>Windows (PowerShell)<\/strong><\/p>\n<pre><code>powershell $insecureProcs = Get-CimInstance Win32_Process | Where-Object {     $_.CommandLine -match '\\-p\\s' -or $_.CommandLine -match '\\-pw\\s' -or $_.CommandLine -match '--password=' -or $_.CommandLine -match '\/password=' } | Select-Object ProcessId, Name, CommandLine $insecureProcs | Format-Table -AutoSize<\/code><\/pre>\n<p><strong>Linux (bash)<\/strong><\/p>\n<pre><code>bash ps -eo pid,user,command --no-header | while read PID USER CMD; do   if [[ \"$CMD\" =~ -p ]] || [[ \"$CMD\" =~ -pw ]] || [[ \"$CMD\" =~ --password= ]] || [[ \"$CMD\" =~ \/password= ]]; then     echo \"PID=$PID USER=$USER CMD=$CMD\"   fi done<\/code><\/pre>\n<p><strong>\u041a\u0430\u043a \u043c\u044b \u00ab\u0437\u0430\u0441\u0432\u0435\u0442\u0438\u043b\u0438\u00bb \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u043f\u0440\u043e\u0434\u0435<\/strong><\/p>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043a\u0440\u0443\u0442\u0438\u043b\u0441\u044f \u043d\u043e\u0447\u043d\u043e\u0439 \u0431\u044d\u043a\u0430\u043f \u0447\u0435\u0440\u0435\u0437 <code>cron<\/code> \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>bash sshpass -p 'MySecret123' ssh backup@10.1.1.25<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438. \u041f\u0430\u0440\u043e\u043b\u044c \u0432\u0441\u043f\u043b\u044b\u043b \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.\u00a0 <\/p>\n<p>\u0412 \u0434\u043e\u0432\u0435\u0441\u043e\u043a Jenkins \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u044d\u0442\u0443 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u043b\u043e\u0433\u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0441\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0440\u043e\u0447\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0443\u0441\u0438\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c.<\/p>\n<p><strong>\u041c\u0438\u043d\u0438-\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0430\u0440\u043e\u043b\u044f\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0413\u0434\u0435 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">sshpass\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">-p\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">ps, \/proc<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">plink \/ pscp<\/p>\n<\/td>\n<td>\n<p align=\"left\">-pw\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">Task Manager<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">WinSCP CLI\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\/password=\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">cmdline\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">rsync\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;password-file\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">curl \/ wget\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">http:\/\/user:pass@<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">mysql\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;password=\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">smbclient<\/p>\n<\/td>\n<td>\n<p align=\"left\">user%pass\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">ps\u00a0\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Jenkins\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">sh &#171;sshpass&#8230;&#187;<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0438\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u0427\u0442\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/strong><\/p>\n<p>Linux\u00a0\u2014 cron\u2011\u0441\u043a\u0430\u043d\u0435\u0440\u044b, Ansible, shell\u2011\u0441\u043a\u0440\u0438\u043f\u0442\u044b. <\/p>\n<p>Windows\u00a0\u2014 PowerShell + \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. <\/p>\n<p>CI\/CD\u00a0\u2014\u00a0\u043b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0441\u043a\u0430\u043d\u0435\u0440\u044b (Checkov, KICS, Semgrep). <\/p>\n<p>IDE\u00a0\u2014 pre\u2011commit \u0445\u0443\u043a\u0438, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u00a0\u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0432\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f\u00a0Semgrep:<\/strong><\/p>\n<pre><code>yaml pattern: sshpass -p $PASS ... message: '\u041f\u0430\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e.' severity: ERROR<\/code><\/pre>\n<p><strong>\u041a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ssh-agent<\/code> \u0438 \u043a\u043b\u044e\u0447\u0438 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 Vault, AWS Secrets Manager, Ansible Vault.\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u044f\u0442\u0430\u0442\u044c \u0443\u0447\u0451\u0442\u043a\u0438 \u0432 <code>.pgpass<\/code>, <code>.my.cnf<\/code>, <code>.netrc<\/code> (\u043f\u0440\u0430\u0432\u0430 600).\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f: \u043d\u0438\u043a\u0442\u043e \u043a\u0440\u043e\u043c\u0435 root \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0443\u0436\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b.\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (<code>sshpass<\/code> \u0438 \u043f\u0440.).\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong><\/p>\n<p>\u041e\u0434\u043d\u0430 \u043d\u0435\u0432\u0438\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0433\u043b\u0430 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0443\u0442\u0435\u0447\u043a\u043e\u0439. \u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u0438 \u0437\u0430\u043a\u0440\u044b\u043b\u0438 \u0434\u044b\u0440\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0430\u00a0\u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043d\u0430\u00a0\u043a\u043b\u044e\u0447\u0438. <\/p>\n<p><strong>\u0421\u043e\u0432\u0435\u0442: <\/strong>\u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0432\u043e\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u0438 \u0432\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0435\u0441\u0442\u044c\u00a0\u2014 \u0443\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u0422\u0430\u043a\u0438\u0435 \u043c\u0435\u043b\u043e\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u043e\u0438\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0434\u043e\u0440\u043e\u0436\u0435, \u0447\u0435\u043c \u043f\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442 \u043d\u0430\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. <\/p>\n<p>P.\u00a0S.\u00a0\u0411\u044b\u043b\u00a0\u043b\u0438 \u0443\u00a0\u0432\u0430\u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043e\u043f\u044b\u0442? \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435, \u043a\u0430\u043a\u00a0\u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0434\u044b\u0440\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u0430\u043a\u0442\u0438\u043a.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/936272\/\"> https:\/\/habr.com\/ru\/articles\/936272\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0415\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e: \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u0442\u043e\u2011\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u00a0\u0443\u0449\u0435\u0440\u0431 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412\u00a0\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e. \u0421\u0435\u0442\u0435\u0432\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u00ab\u0441 \u043b\u0451\u0442\u0443\u00bb, \u0438 \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e. \u041f\u043e\u043a\u0430 \u0440\u0435\u0447\u044c \u043d\u0435\u00a0\u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u00a0\u043f\u0430\u0440\u043e\u043b\u0438. \u041e\u0434\u0438\u043d \u0438\u0437\u00a0\u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441\u0442\u0430\u043b \u0434\u043b\u044f\u00a0\u043d\u0430\u0441 \u0443\u0440\u043e\u043a\u043e\u043c \u041d\u0430\u00a0\u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434\u00a0\u2014 \u043c\u0435\u043b\u043e\u0447\u044c, \u043d\u043e\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0433\u043b\u0438\u00a0\u0431\u044b\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0435\u0435.<\/p>\n<p><strong>\u041a\u0430\u043a\u00a0\u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c<\/strong><\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c. \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0435 <code>(ps aux)<\/code> \u0438 \u0432\u0434\u0440\u0443\u0433 \u0432\u0438\u0436\u0443:<\/p>\n<pre><code>bash sshpass -p 'Qwerty123' ssh admin@10.0.5.21<\/code><\/pre>\n<p>\u041f\u0430\u0440\u043e\u043b\u044c. \u0412\u00a0\u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435. \u0412\u00a0\u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. <\/p>\n<p>\u041f\u043e\u0434\u043e\u0448\u0451\u043b \u043a\u00a0\u043a\u043e\u043b\u043b\u0435\u0433\u0435:<\/p>\n<blockquote>\n<p><em>\u2014 \u042d\u0442\u043e \u0447\u0442\u043e\u00a0\u0437\u0430\u00a0\u043c\u0430\u0433\u0438\u044f? <\/em><\/p>\n<p><em>\u2014 \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u00a0\u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437. <\/em><\/p>\n<p><em>\u2014 \u0422\u044b \u0432\u00a0\u043a\u0443\u0440\u0441\u0435, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0435? <\/em><\/p>\n<p><em>\u2014 \u041d\u0443 \u043c\u044b\u00a0\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0442\u0438 <\/em><\/p>\n<p><em>\u2014  \u0414\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e <\/em><code><em>ps<\/em><\/code><em> \u0438\u043b\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0438.<\/em><\/p>\n<\/blockquote>\n<p>\u0427\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0443 \u0447\u0430\u0441\u043e\u0432 \u0443\u00a0\u043d\u0430\u0441 \u0443\u0436\u0435\u00a0\u0431\u044b\u043b \u0432\u043d\u0435\u043f\u043b\u0430\u043d\u043e\u0432\u044b\u0439 \u0430\u0443\u0434\u0438\u0442.<\/p>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430:<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0432\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445\u00a0\u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d. <\/p>\n<ul>\n<li>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u0438\u0434\u043d\u044b \u0432 <code>ps<\/code>, <code>\/proc\/[PID]\/cmdline<\/code>, Task Manager. <\/p>\n<\/li>\n<li>\n<p>\u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432\u00a0\u043b\u043e\u0433\u0438 CI\/CD. <\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0438 \u0430\u0443\u0434\u0438\u0442 \u0442\u043e\u0436\u0435 \u0438\u0445 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044f\u0442. <\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (<code>sshpass<\/code>, <code>plink<\/code>, <code>WinSCP CLI<\/code>, <code>rsync<\/code>, <code>mysql<\/code>, <code>curl<\/code>, <code>mRemoteNG<\/code>) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0442\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c\u00a0\u2014 \u0438 \u044d\u0442\u043e \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0434\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u00ab\u043a\u043e\u0441\u0442\u044b\u043b\u044f\u00bb.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u043d\u043e, \u0434\u0430\u0436\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044f \u0441\u0430\u043c SSH.<\/p>\n<p><strong>\u041a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438<\/strong><\/p>\n<p><strong>Windows (PowerShell)<\/strong><\/p>\n<pre><code>powershell $insecureProcs = Get-CimInstance Win32_Process | Where-Object {     $_.CommandLine -match '\\-p\\s' -or $_.CommandLine -match '\\-pw\\s' -or $_.CommandLine -match '--password=' -or $_.CommandLine -match '\/password=' } | Select-Object ProcessId, Name, CommandLine $insecureProcs | Format-Table -AutoSize<\/code><\/pre>\n<p><strong>Linux (bash)<\/strong><\/p>\n<pre><code>bash ps -eo pid,user,command --no-header | while read PID USER CMD; do   if [[ \"$CMD\" =~ -p ]] || [[ \"$CMD\" =~ -pw ]] || [[ \"$CMD\" =~ --password= ]] || [[ \"$CMD\" =~ \/password= ]]; then     echo \"PID=$PID USER=$USER CMD=$CMD\"   fi done<\/code><\/pre>\n<p><strong>\u041a\u0430\u043a \u043c\u044b \u00ab\u0437\u0430\u0441\u0432\u0435\u0442\u0438\u043b\u0438\u00bb \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u043f\u0440\u043e\u0434\u0435<\/strong><\/p>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043a\u0440\u0443\u0442\u0438\u043b\u0441\u044f \u043d\u043e\u0447\u043d\u043e\u0439 \u0431\u044d\u043a\u0430\u043f \u0447\u0435\u0440\u0435\u0437 <code>cron<\/code> \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>bash sshpass -p 'MySecret123' ssh backup@10.1.1.25<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438. \u041f\u0430\u0440\u043e\u043b\u044c \u0432\u0441\u043f\u043b\u044b\u043b \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.\u00a0 <\/p>\n<p>\u0412 \u0434\u043e\u0432\u0435\u0441\u043e\u043a Jenkins \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u044d\u0442\u0443 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u043b\u043e\u0433\u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0441\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0440\u043e\u0447\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0443\u0441\u0438\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c.<\/p>\n<p><strong>\u041c\u0438\u043d\u0438-\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0430\u0440\u043e\u043b\u044f\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0413\u0434\u0435 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">sshpass\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">-p\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">ps, \/proc<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">plink \/ pscp<\/p>\n<\/td>\n<td>\n<p align=\"left\">-pw\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">Task Manager<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">WinSCP CLI\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\/password=\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">cmdline\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">rsync\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;password-file\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">curl \/ wget\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">http:\/\/user:pass@<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">mysql\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;password=\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">smbclient<\/p>\n<\/td>\n<td>\n<p align=\"left\">user%pass\u00a0\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">ps\u00a0\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Jenkins\u00a0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">sh &#171;sshpass&#8230;&#187;<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043b\u043e\u0433\u0438\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u0427\u0442\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/strong><\/p>\n<p>Linux\u00a0\u2014 cron\u2011\u0441\u043a\u0430\u043d\u0435\u0440\u044b, Ansible, shell\u2011\u0441\u043a\u0440\u0438\u043f\u0442\u044b. <\/p>\n<p>Windows\u00a0\u2014 PowerShell + \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. <\/p>\n<p>CI\/CD\u00a0\u2014\u00a0\u043b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0441\u043a\u0430\u043d\u0435\u0440\u044b (Checkov, KICS, Semgrep). <\/p>\n<p>IDE\u00a0\u2014 pre\u2011commit \u0445\u0443\u043a\u0438, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u00a0\u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0432\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f\u00a0Semgrep:<\/strong><\/p>\n<pre><code>yaml pattern: sshpass -p $PASS ... message: '\u041f\u0430\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e.' severity: ERROR<\/code><\/pre>\n<p><strong>\u041a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ssh-agent<\/code> \u0438 \u043a\u043b\u044e\u0447\u0438 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 Vault, AWS Secrets Manager, Ansible Vault.\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u044f\u0442\u0430\u0442\u044c \u0443\u0447\u0451\u0442\u043a\u0438 \u0432 <code>.pgpass<\/code>, <code>.my.cnf<\/code>, <code>.netrc<\/code> (\u043f\u0440\u0430\u0432\u0430 600).\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f: \u043d\u0438\u043a\u0442\u043e \u043a\u0440\u043e\u043c\u0435 root \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0443\u0436\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b.\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (<code>sshpass<\/code> \u0438 \u043f\u0440.).\u00a0 <\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong><\/p>\n<p>\u041e\u0434\u043d\u0430 \u043d\u0435\u0432\u0438\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0433\u043b\u0430 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0443\u0442\u0435\u0447\u043a\u043e\u0439. \u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u0438 \u0437\u0430\u043a\u0440\u044b\u043b\u0438 \u0434\u044b\u0440\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0430\u00a0\u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043d\u0430\u00a0\u043a\u043b\u044e\u0447\u0438. <\/p>\n<p><strong>\u0421\u043e\u0432\u0435\u0442: <\/strong>\u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0432\u043e\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u0438 \u0432\u00a0\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0435\u0441\u0442\u044c\u00a0\u2014 \u0443\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u0422\u0430\u043a\u0438\u0435 \u043c\u0435\u043b\u043e\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u043e\u0438\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0434\u043e\u0440\u043e\u0436\u0435, \u0447\u0435\u043c \u043f\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442 \u043d\u0430\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. <\/p>\n<p>P.\u00a0S.\u00a0\u0411\u044b\u043b\u00a0\u043b\u0438 \u0443\u00a0\u0432\u0430\u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043e\u043f\u044b\u0442? \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435, \u043a\u0430\u043a\u00a0\u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0434\u044b\u0440\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u0430\u043a\u0442\u0438\u043a.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/936272\/\"> https:\/\/habr.com\/ru\/articles\/936272\/<\/a><br \/><\/br><\/br><\/p>\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-470444","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470444","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=470444"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/470444\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}