{"id":377195,"date":"2024-05-27T15:00:11","date_gmt":"2024-05-27T15:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=377195"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=377195","title":{"rendered":"<span>\u0412\u043d\u0435\u0434\u0440\u044f\u0435\u043c DevSecOps \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0427\u0430\u0441\u0442\u044c 2. \u041e\u0431\u0437\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, Commit-time Checks<\/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>\u041f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u041e\u043b\u0435\u0433 \u041a\u0430\u0437\u0430\u043a\u043e\u0432 \u0438\u0437 <a href=\"https:\/\/digital-spectr.ru\/\">Spectr<\/a>.\u00a0<\/p>\n<p>\u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439, \u0433\u0434\u0435 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 DevSecOps \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u00a0<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/spectr\/articles\/724914\/\"><u>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 DevSecOps \u0432 \u0446\u0435\u043b\u043e\u043c, \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442, \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u2014 Pre-commit Checks. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0431\u0437\u043e\u0440\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 Commit-time Checks \u0438 \u0435\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043d\u0430 \u0447\u0435\u043c \u043c\u044b \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440. <\/p>\n<h2>Commit-time Checks <\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f4e\/ea7\/a47\/f4eea7a47021ca949d633844bf62f4af.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f4e\/ea7\/a47\/f4eea7a47021ca949d633844bf62f4af.png\"\/><\/figure>\n<p><strong>\u0421\u0443\u0442\u044c \u044d\u0442\u0430\u043f\u0430: <\/strong>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432 GIT-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h3>SAST<\/h3>\n<p>SAST (static application security testing) \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p><a href=\"https:\/\/owasp.org\/www-community\/Source_Code_Analysis_Tools\"><u>\u041f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/u> <\/a>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 SAST. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u0435\u0441\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435.<\/p>\n<h2>\u042d\u0442\u0430\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4c8\/7e5\/97f\/4c87e597f7dc172238457aa4a3cfd7b4.png\" width=\"1120\" height=\"554\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c8\/7e5\/97f\/4c87e597f7dc172238457aa4a3cfd7b4.png\"\/><\/figure>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f, \u043d\u043e \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u0430\u043f\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 (Modeled Code). <\/strong>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 SAST \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041e\u0434\u043d\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442 \u043a\u043e\u0434, \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u0440\u0435\u0442\u044c\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0438\u0445 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 SAST \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u044d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><strong>\u041f\u043e\u0438\u0441\u043a \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432 (List of Defects)<\/strong>. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b SAST \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043a \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443. \u042d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u044b, \u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<h4>\u0412\u0438\u0434\u044b SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<p>\u0421\u0440\u0435\u0434\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 SAST \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u043d\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b  \u043d\u0438\u0436\u0435:\u00a0<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"351\" width=\"351\">\n<p align=\"left\"><strong>\u041f\u043b\u0430\u0442\u043d\u044b\u0435<\/strong> <\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"351\" width=\"351\">\n<p align=\"left\"><a href=\"http:\/\/lgtm.com\/\"><u>LGTM\u00a0<\/u><\/a><\/p>\n<p><a href=\"https:\/\/checkmarx.com\/cxsast-source-code-scanning\/\"><u>Checkmarx SAST<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/docs.contrastsecurity.com\/index.html?lang=en\"><u>Contrast\u00a0<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/scan.coverity.com\"><u>Coverity Scan<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.sonarsource.com\/products\/sonarqube\/\"><u>SonarQube<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/semgrep.dev\/\"><u>Semgrep<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/pvs-studio.ru\/ru\/\"><u>PVS-Studio<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.reshift.nl\/\"><u>Reshift<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.mend.io\/sast\/\"><u>Mend SAST<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.hcl-software.com\/appscan\/products\/appscan-source\"><u>HCL AppScan Source<\/u><\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Open Source<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438:  <br \/><a href=\"https:\/\/bandit.readthedocs.io\/en\/latest\/#\"><u>Bandit <\/u><\/a><u><br \/><\/u><a href=\"https:\/\/brakemanscanner.org\/\"><u>Brakeman<\/u><\/a> <br \/><a href=\"https:\/\/github.com\/FloeDesignTechnologies\/phpcs-security-audit\"><u>Phpcs-security-audit<\/u><\/a> <br \/><a href=\"https:\/\/github.com\/securego\/gosec\"><u>Gosec<\/u><\/a> <br \/><a href=\"https:\/\/security-code-scan.github.io\/\"><u>Security Code Scan<\/u><\/a> <br \/><a href=\"https:\/\/dwheeler.com\/flawfinder\/\"><u>Flawfinder<\/u><\/a> <br \/><a href=\"https:\/\/github.com\/eslint-community\/eslint-plugin-security\"><u>ESLint security plugin<\/u><\/a><\/p>\n<p><strong><br \/>Free Community Edition<\/strong>:\u00a0<br \/><a href=\"https:\/\/docs.contrastsecurity.com\/index.html?lang=en\"><u>Contrast Scan<\/u><\/a> <br \/><a href=\"https:\/\/www.sonarsource.com\/products\/sonarqube\/\"><u>SonarQube<\/u><\/a> <br \/><a href=\"https:\/\/semgrep.dev\/\"><u>Semgrep<\/u><\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>SAST \u0432 GitLab<\/h4>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 GitLab. \u0423 GitLab \u0435\u0441\u0442\u044c SAST \u0432\u043e \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.<\/p>\n<p>\u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u0443 <a href=\"https:\/\/docs.gitlab.com\/ee\/user\/application_security\/sast\/#supported-languages-and-frameworks\"><u>\u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/u><\/a>, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/434\/e2a\/39e\/434e2a39e16128bd3b1eb7baf3fe0638.jpeg\" width=\"1075\" height=\"875\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/434\/e2a\/39e\/434e2a39e16128bd3b1eb7baf3fe0638.jpeg\" data-blurred=\"true\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/436\/db9\/960\/436db9960fe899591ad7e9c54f8ff52c.jpeg\" width=\"1085\" height=\"890\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/436\/db9\/960\/436db9960fe899591ad7e9c54f8ff52c.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>GitLab \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0440\u0430\u0437\u043d\u044b\u0445 Open Source \u0438\u043b\u0438 Free Community Edition. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"yaml\">include:   - template: Security\/SAST.gitlab-ci.yml  sast:   tags:     - docker<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c SAST, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 PHP-\u0444\u0430\u0439\u043b \u0438 Go-\u0444\u0430\u0439\u043b, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 phpcs-security-audit, Semgrep \u0438 Gosec (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 2 \u043d\u0430 Go): <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/064\/309\/ef6\/064309ef6de9f33925f69dba1c7f6744.png\" width=\"390\" height=\"291\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/064\/309\/ef6\/064309ef6de9f33925f69dba1c7f6744.png\"\/><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f phpcs-security-audit:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/f86\/4cc\/c4a\/f864ccc4a322a6fb87f1355253883c17.jpeg\" width=\"967\" height=\"213\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f86\/4cc\/c4a\/f864ccc4a322a6fb87f1355253883c17.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u2014 \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c?\u00a0<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab\/-\/blob\/master\/lib\/gitlab\/ci\/templates\/Jobs\/SAST.gitlab-ci.yml\"><u>\u0448\u0430\u0431\u043b\u043e\u043d \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/u><\/a> (Security\/Secret-SAST.gitlab-ci.yml) \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445:<\/p>\n<pre><code class=\"yaml\">sast:   stage: test   artifacts:     reports:       sast: gl-sast-report.json   rules:     - when: never   variables:     SEARCH_MAX_DEPTH: 4   script:job     - echo \"$CI_JOB_NAME is used for configuration only, and its script should not be executed\"     - exit 1  .sast-analyzer:   extends: sast   allow_failure: true   # `rules` must be overridden explicitly by each child job   # see https:\/\/gitlab.com\/gitlab-org\/gitlab\/-\/issues\/218444   script:     - \/analyzer run<\/code><\/pre>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u0441\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432 Secret Detection \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438: \u0435\u0441\u0442\u044c \u0441\u0430\u043c\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 SAST, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 (\u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0436\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u2014 gl-sast-report.json). \u041d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432\u0441\u0435 \u0436\u0435 \u0435\u0441\u0442\u044c, \u0442. \u043a. GitLab \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u042f\u041f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b SAST, \u0442\u043e \u0435\u0441\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<pre><code class=\"yaml\">semgrep-sast:   extends: .sast-analyzer   image:     name: \"$SAST_ANALYZER_IMAGE\"   variables:     SEARCH_MAX_DEPTH: 20     SAST_ANALYZER_IMAGE_TAG: 4     SAST_ANALYZER_IMAGE: \"$SECURE_ANALYZERS_PREFIX\/semgrep:$SAST_ANALYZER_IMAGE_TAG$SAST_IMAGE_SUFFIX\"   rules:     - if: $SAST_DISABLED == 'true' || $SAST_DISABLED == '1'       when: never     - if: $SAST_EXCLUDED_ANALYZERS =~ \/semgrep\/       when: never     - if: $CI_COMMIT_BRANCH       exists:         - '**\/*.py'         - '**\/*.js'         - '**\/*.jsx'         - '**\/*.ts'         - '**\/*.tsx'         - '**\/*.c'         - '**\/*.go'         - '**\/*.java'         - '**\/*.cs'         - '**\/*.html'         - '**\/*.scala'         - '**\/*.sc'<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f semgrep. \u041d\u0430\u0441 \u0442\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b rules, \u0430 \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435, \u0442\u043e:<\/p>\n<ul>\n<li>\n<p><strong>\u0431\u043b\u043e\u043a exists<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u043e\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442;<\/p>\n<\/li>\n<li>\n<p><strong>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 $SAST_EXCLUDED_ANALYZERS<\/strong> \u043d\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u2014 \u044d\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c <a href=\"https:\/\/github.com\/snoopysecurity\/Vulnerable-Code-Snippets\"><u>\u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0435\u0439<\/u><\/a>.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9c1\/ad5\/62e\/9c1ad562e7af3fbe73cc18b52c7ccb2e.png\" width=\"461\" height=\"348\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c1\/ad5\/62e\/9c1ad562e7af3fbe73cc18b52c7ccb2e.png\"\/><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443, \u043a\u0430\u043a \u0438 \u0432 Secret Detection <a href=\"https:\/\/habr.com\/ru\/publication\/edit\/724914\/\"><u>\u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/u><\/a>. \u0417\u0430\u0434\u0430\u0447\u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043d\u043e \u0432 \u043e\u0442\u0447\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da5\/2b3\/e4c\/da52b3e4cae5514381ff5d98ff92f7fd.png\" width=\"796\" height=\"574\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da5\/2b3\/e4c\/da52b3e4cae5514381ff5d98ff92f7fd.png\"\/><\/figure>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d81\/c1d\/983\/d81c1d983877817e1c1cd1cea44fb0f4.jpeg\" width=\"1089\" height=\"571\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d81\/c1d\/983\/d81c1d983877817e1c1cd1cea44fb0f4.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0443\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/spectr\/articles\/724914\/\"><u>(\u0447\u0442\u043e \u0438 \u0432 \u0447\u0430\u0441\u0442\u0438 1)<\/u><\/a> \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  vulnerability_count=$(cat $FILE_REPORT | jq --raw-output '.vulnerabilities | length') if [ ${vulnerability_count} -gt 0 ];  then   echo \"|     severity     |     name     |     location     |     scanner     |\"   echo \"|------------------|--------------|------------------|-----------------|\"   _jq() {    echo ${row} | base64 --decode | jq -r ${1}   }   for row in $(cat $FILE_REPORT | jq -r '.vulnerabilities[] | @base64'); do     vulnerability_name=$(_jq \".name\")     if [ \"$vulnerability_name\" == \"null\" ]; then vulnerability_name=$(_jq \".message\"); fi     echo '|' $(_jq \".severity\") '|' $vulnerability_name '|' $(_jq \".location.file\")':'$(_jq \".location.start_line\") '|' $(_jq \".scanner.name\") '|'   done fi  exit $vulnerability_count<\/code><\/pre>\n<p>\u0414\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 SAST, \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 (\u043c\u043e\u0436\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\/\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443).<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c .gitlab-ci.yml \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439.<\/p>\n<pre><code class=\"yaml\">stages:   - test  .analyzer_run:   script:     - apk add jq bash coreutils     - \/analyzer run     - bash .gitlab\/scripts\/$NAME_OF_CI_SCRIPT.sh  include:   - local: '\/.gitlab\/templates\/sast.gitlab-ci.yml'<\/code><\/pre>\n<p>\u0422\u0435 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0430\u0434\u0430\u044e\u0442:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b7\/525\/9e0\/5b75259e040f5afcd5f77b381e99c85e.png\" width=\"418\" height=\"357\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b7\/525\/9e0\/5b75259e040f5afcd5f77b381e99c85e.png\"\/><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Bandit (\u0442\u043e\u043b\u044c\u043a\u043e Python):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd6\/4b4\/452\/bd64b445292f421c4460f085ac07676b.png\" width=\"1275\" height=\"324\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bd6\/4b4\/452\/bd64b445292f421c4460f085ac07676b.png\"\/><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Flawfinder (\u0442\u043e\u043b\u044c\u043a\u043e C\/C++):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/819\/260\/7ad\/8192607adb0419d8d78063ed101edf5e.png\" width=\"1283\" height=\"449\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/819\/260\/7ad\/8192607adb0419d8d78063ed101edf5e.png\"\/><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Gosec (\u0442\u043e\u043b\u044c\u043a\u043e Go):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/57a\/c59\/990\/57ac59990f1d1a399e2ec3840d5c4350.png\" width=\"989\" height=\"335\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57a\/c59\/990\/57ac59990f1d1a399e2ec3840d5c4350.png\"\/><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Semgrep (\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u043e\u0432, \u0432 \u0442. \u0447. Python, Go, C\/C++):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/002\/328\/acd\/002328acd898a0722a9700cf34991e35.png\" width=\"1283\" height=\"479\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/002\/328\/acd\/002328acd898a0722a9700cf34991e35.png\"\/><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, SAST \u0432 Gitlab \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<h4>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 SAST \u0432 Gitlab<\/h4>\n<ul>\n<li>\n<p><strong>\u0417\u043e\u043e\u043f\u0430\u0440\u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/strong> \u041f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u042f\u041f \u2014 \u0441\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, phpcs-security-audit \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u043e\u0434 \u0440\u0443\u0442\u043e\u043c, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043b\u0438\u0431\u044b (jq, bash \u0438 \u0442. \u0434.).<\/p>\n<\/li>\n<li>\n<p><strong>\u041b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/strong> \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0410 \u0442\u0443\u0442 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u043a\u0440\u0430\u0442\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u00a0<\/h4>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e Semgrep \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u042f\u041f \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f SAST_EXCLUDED_ANALYZERS, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b.<\/p>\n<pre><code class=\"yaml\">sast:   variables:     SAST_EXCLUDED_ANALYZERS: \"bandit,gosec,flawfinder\" # \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b     FILE_REPORT: gl-sast-report.json     NAME_OF_CI_SCRIPT: \"sast\"   tags:     - docker<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043c\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c Bandit, GoSec \u0438 Flawfinder, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e Semgrep. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0442 \u0436\u0435 Semgrep.\u00a0<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0438 \u0441\u0430\u043c Gitlab \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Bandit, ESLint, GoSec). <\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 DevSecOps \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e<\/h4>\n<p>\u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 GitLab-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0412 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043b\u044e\u0441 \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432 \u0432 CI\/CD \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0439.<\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u043c\u0438\u043d\u0443\u0441\u044b:\u00a0<\/p>\n<ul>\n<li>\n<p>GitLab \u043c\u043e\u0436\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>GitLab \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0441\u0435 \u0442\u043e\u0433\u043e \u0436\u0435 Semgrep.<\/p>\n<p>\u0423 Semgrep \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0432 <a href=\"https:\/\/hub.docker.com\/r\/semgrep\/semgrep\"><u>Docker Hub<\/u><\/a>, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">semgrep:  stage: test  image: semgrep\/semgrep  variables:    FILE_REPORT: gl-sast-report.json    SEMGREP_RULES: >-      p\/security-audit      p\/secrets      p\/python      p\/django      p\/phpcs-security-audit  tags:    - docker  script:    - semgrep ci --gitlab-sast > $FILE_REPORT || true    - apk add jq bash coreutils    - bash .gitlab\/scripts\/sast.sh  artifacts:    reports:      sast: $FILE_REPORT<\/code><\/pre>\n<ul>\n<li>\n<p><strong>SEMGREP_RULES<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0430\u0432\u0438\u043b, \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441: <a href=\"https:\/\/semgrep.dev\/r\"><u>https:\/\/semgrep.dev\/r<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><strong>&#8212;gitlab-sast<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0432 \u0442\u0430\u043a\u043e\u043c \u0436\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043a\u0430\u043a \u0432 GitLab.<\/p>\n<\/li>\n<li>\n<p>|| <strong>true<\/strong> \u2014 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u0430\u043d\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e job \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u043c \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 .gtilab-ci.yml:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">include:   - local: '\/.gitlab\/templates\/sast-semgrep.gitlab-ci.yml'<\/code><\/pre>\n<h3>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 SonarQube<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0442\u043e \u043c\u044b \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0435 \u2014 SonarQube. \u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e GitLab \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u043e \u0443\u043c\u0435\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c.\u00a0<\/p>\n<p>SonarQube \u043d\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c: \u044d\u0442\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 (\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0430 \u043c\u043e\u0436\u043d\u043e \u2014 \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/59f\/da8\/89c\/59fda889c3fbe02d6062b5ced931ba95.png\" width=\"767\" height=\"295\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/59f\/da8\/89c\/59fda889c3fbe02d6062b5ced931ba95.png\"\/><\/figure>\n<p>\u041f\u043e <a href=\"https:\/\/gitlab.com\/spectr-devsecops\/sonarqube\"><u>\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/u><\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c SonarQube \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 GitLab.<\/p>\n<h3>Dependency Scanning<\/h3>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 Commit-time Checks \u2014 Dependency Scanning (\u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445).<\/p>\n<h4>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 Dependency Scanning-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/deb\/a27\/849\/deba278492a0521b60ca9546dd9b579e.png\" width=\"1323\" height=\"613\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/deb\/a27\/849\/deba278492a0521b60ca9546dd9b579e.png\"\/><\/figure>\n<p>\u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 (go.sum, composer.lock, package-lock.json, yarn.lock, Gemfile.lock, requirements.txt \u0438 \u0442. \u0434.). Dependency Scanning-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u044e\u0442 \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b, \u0441\u043c\u043e\u0442\u0440\u044f\u0442, \u043a\u0430\u043a\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u0432\u044b\u043a\u0430\u0447\u0430\u043d\u044b \u0438 \u043a\u0430\u043a\u0438\u0435 \u0431\u044b\u043b\u0438 \u0432\u0435\u0440\u0441\u0438\u0438, \u0434\u0430\u043b\u0435\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0432 \u0431\u0430\u0437\u0435 \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u041f\u041e \u0438, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0442\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442, \u0432\u044b\u0434\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h4>\u0412\u0438\u0434\u044b Dependency Scanning-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<ul>\n<li>\n<p><a href=\"https:\/\/trivy.dev\/\"><u>Trivy<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/owasp.org\/www-community\/Free_for_Open_Source_Application_Security_Tools\"><u>OWASP Dependency Check<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dependencytrack.org\/\"><u>Dependency Track<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<h4>Dependency Scanning \u0432 GitLab<\/h4>\n<p>\u0412 GitLab \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 Dependency Scanning, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 GitLab \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d, \u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0436\u0435 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c.\u00a0<\/p>\n<p>\u0412 GitLab \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 Gemnasium. <a href=\"https:\/\/gitlab.com\/gitlab-org\/security-products\/analyzers\/gemnasium\"><u>Gemnasium<\/u><\/a> \u2014 \u044d\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 GitLab, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412\u0435\u0440\u043d\u0435\u0435, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0432 Ultimate-\u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0437, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445:\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/178\/824\/331\/1788243319c89b9a53295aad89be149d.png\" width=\"932\" height=\"547\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/178\/824\/331\/1788243319c89b9a53295aad89be149d.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5cf\/dc0\/275\/5cfdc0275017fee79cfd87dcd59ace53.png\" width=\"647\" height=\"243\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5cf\/dc0\/275\/5cfdc0275017fee79cfd87dcd59ace53.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/91f\/484\/960\/91f484960806c9518fb4d9cfc9188cf9.png\" width=\"757\" height=\"551\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/91f\/484\/960\/91f484960806c9518fb4d9cfc9188cf9.png\"\/><\/figure>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 GitLab, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0432 image, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0438 \u0432\u0435\u0437\u0434\u0435.<\/p>\n<pre><code class=\"yaml\">dependency_scanning_custom:   stage: test   variables:     FILE_REPORT: gl-dependency-scanning-report.json     NAME_OF_CI_SCRIPT: \"dependency_scanning\"   image: registry.gitlab.com\/gitlab-org\/security-products\/analyzers\/gemnasium:3   tags:     - docker   artifacts:     reports:       dependency_scanning: gl-dependency-scanning-report.json   script:     - !reference [.analyzer_run, script]  <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  vulnerability_count=$(cat $FILE_REPORT | jq --raw-output '.vulnerabilities | length') if [ ${vulnerability_count} -gt 0 ];  then   echo \"|     severity     |     name     |     file     |     package     |\"   echo \"|------------------|--------------|--------------|-----------------|\"   _jq() {    echo ${row} | base64 --decode | jq -r ${1}   }   for row in $(cat $FILE_REPORT | jq -r '.vulnerabilities[] | @base64'); do     echo '|' $(_jq \".severity\") '|' $(_jq \".name\") '|' $(_jq \".location.file\") '|' $(_jq \".location.dependency.package.name\") '|'   done fi  exit $vulnerability_count <\/code><\/pre>\n<p>\u0417\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0430\u043a\u0435\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 composer \u0438 go.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb8\/018\/7a6\/cb80187a6979a50e59a5fc517e883f68.png\" width=\"715\" height=\"506\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb8\/018\/7a6\/cb80187a6979a50e59a5fc517e883f68.png\"\/><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c \u043e\u0442\u0447\u0435\u0442 Dependency Scanning: \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u044b 2 \u043f\u0430\u043a\u0435\u0442\u0430, \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0435\u0442.\u00a0<\/p>\n<p>\u0423 Gemnasium \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <a href=\"https:\/\/advisories.gitlab.com\/\"><u>\u0441\u0430\u0439\u0442<\/u><\/a> \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043f\u043e \u0411\u0414-\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442, \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da6\/5c8\/b9b\/da65c8b9b0ea2433b2113aaedf760f8b.png\" width=\"1347\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da6\/5c8\/b9b\/da65c8b9b0ea2433b2113aaedf760f8b.png\"\/><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438:\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/534\/27f\/bf2\/53427fbf28f68c95efa2ff3fa53363e5.png\" width=\"1088\" height=\"605\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/534\/27f\/bf2\/53427fbf28f68c95efa2ff3fa53363e5.png\"\/><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u2014 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0437\u0430\u0434\u0430\u0447\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/135\/f92\/d09\/135f92d094ede807fba77ecf2f1d4375.png\" width=\"1223\" height=\"449\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/135\/f92\/d09\/135f92d094ede807fba77ecf2f1d4375.png\"\/><\/figure>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e, \u2014 \u043d\u0430\u0439\u0442\u0438 \u043e\u0431\u0440\u0430\u0437 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044f\u0432\u043d\u043e \u043e\u0431\u0440\u0430\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0441\u0435 \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u044d\u0442\u0430\u043f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 DevSecOps \u2014 Commit-time Checks. \u0412\u0441\u0435 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e \u043a\u043e\u0434\u0443 \u043b\u0435\u0436\u0430\u0442 \u0432 \u044d\u0442\u043e\u043c <a href=\"https:\/\/gitlab.com\/spectr-devsecops\/devsecops\"><u>\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/u><\/a>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 Post-build Checks.<\/p>\n<\/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\/817267\/\"> https:\/\/habr.com\/ru\/articles\/817267\/<\/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>\u041f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u041e\u043b\u0435\u0433 \u041a\u0430\u0437\u0430\u043a\u043e\u0432 \u0438\u0437 <a href=\"https:\/\/digital-spectr.ru\/\">Spectr<\/a>.\u00a0<\/p>\n<p>\u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439, \u0433\u0434\u0435 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 DevSecOps \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u00a0<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/spectr\/articles\/724914\/\"><u>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 DevSecOps \u0432 \u0446\u0435\u043b\u043e\u043c, \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442, \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u2014 Pre-commit Checks. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0431\u0437\u043e\u0440\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 Commit-time Checks \u0438 \u0435\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043d\u0430 \u0447\u0435\u043c \u043c\u044b \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440. <\/p>\n<h2>Commit-time Checks <\/h2>\n<figure class=\"full-width\"><\/figure>\n<p><strong>\u0421\u0443\u0442\u044c \u044d\u0442\u0430\u043f\u0430: <\/strong>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432 GIT-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h3>SAST<\/h3>\n<p>SAST (static application security testing) \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p><a href=\"https:\/\/owasp.org\/www-community\/Source_Code_Analysis_Tools\"><u>\u041f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/u> <\/a>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 SAST. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u0435\u0441\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435.<\/p>\n<h2>\u042d\u0442\u0430\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f, \u043d\u043e \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u0430\u043f\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 (Modeled Code). <\/strong>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 SAST \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041e\u0434\u043d\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442 \u043a\u043e\u0434, \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u0440\u0435\u0442\u044c\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0438\u0445 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 SAST \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u044d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><strong>\u041f\u043e\u0438\u0441\u043a \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432 (List of Defects)<\/strong>. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b SAST \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043a \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443. \u042d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u044b, \u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<h4>\u0412\u0438\u0434\u044b SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<p>\u0421\u0440\u0435\u0434\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 SAST \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u043d\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b  \u043d\u0438\u0436\u0435:\u00a0<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"351\" width=\"351\">\n<p align=\"left\"><strong>\u041f\u043b\u0430\u0442\u043d\u044b\u0435<\/strong> <\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"351\" width=\"351\">\n<p align=\"left\"><a href=\"http:\/\/lgtm.com\/\"><u>LGTM\u00a0<\/u><\/a><\/p>\n<p><a href=\"https:\/\/checkmarx.com\/cxsast-source-code-scanning\/\"><u>Checkmarx SAST<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/docs.contrastsecurity.com\/index.html?lang=en\"><u>Contrast\u00a0<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/scan.coverity.com\"><u>Coverity Scan<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.sonarsource.com\/products\/sonarqube\/\"><u>SonarQube<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/semgrep.dev\/\"><u>Semgrep<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/pvs-studio.ru\/ru\/\"><u>PVS-Studio<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.reshift.nl\/\"><u>Reshift<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.mend.io\/sast\/\"><u>Mend SAST<\/u><\/a><u><br \/><\/u><a href=\"https:\/\/www.hcl-software.com\/appscan\/products\/appscan-source\"><u>HCL AppScan Source<\/u><\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Open Source<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438:  <br \/><a href=\"https:\/\/bandit.readthedocs.io\/en\/latest\/#\"><u>Bandit <\/u><\/a><u><br \/><\/u><a href=\"https:\/\/brakemanscanner.org\/\"><u>Brakeman<\/u><\/a> <br \/><a href=\"https:\/\/github.com\/FloeDesignTechnologies\/phpcs-security-audit\"><u>Phpcs-security-audit<\/u><\/a> <br \/><a href=\"https:\/\/github.com\/securego\/gosec\"><u>Gosec<\/u><\/a> <br \/><a href=\"https:\/\/security-code-scan.github.io\/\"><u>Security Code Scan<\/u><\/a> <br \/><a href=\"https:\/\/dwheeler.com\/flawfinder\/\"><u>Flawfinder<\/u><\/a> <br \/><a href=\"https:\/\/github.com\/eslint-community\/eslint-plugin-security\"><u>ESLint security plugin<\/u><\/a><\/p>\n<p><strong><br \/>Free Community Edition<\/strong>:\u00a0<br \/><a href=\"https:\/\/docs.contrastsecurity.com\/index.html?lang=en\"><u>Contrast Scan<\/u><\/a> <br \/><a href=\"https:\/\/www.sonarsource.com\/products\/sonarqube\/\"><u>SonarQube<\/u><\/a> <br \/><a href=\"https:\/\/semgrep.dev\/\"><u>Semgrep<\/u><\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>SAST \u0432 GitLab<\/h4>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 GitLab. \u0423 GitLab \u0435\u0441\u0442\u044c SAST \u0432\u043e \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.<\/p>\n<p>\u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u0443 <a href=\"https:\/\/docs.gitlab.com\/ee\/user\/application_security\/sast\/#supported-languages-and-frameworks\"><u>\u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/u><\/a>, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>GitLab \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0440\u0430\u0437\u043d\u044b\u0445 Open Source \u0438\u043b\u0438 Free Community Edition. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"yaml\">include:   - template: Security\/SAST.gitlab-ci.yml  sast:   tags:     - docker<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c SAST, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 PHP-\u0444\u0430\u0439\u043b \u0438 Go-\u0444\u0430\u0439\u043b, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 phpcs-security-audit, Semgrep \u0438 Gosec (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 2 \u043d\u0430 Go): <\/p>\n<figure class=\"\"><\/figure>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f phpcs-security-audit:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u2014 \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c?\u00a0<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab\/-\/blob\/master\/lib\/gitlab\/ci\/templates\/Jobs\/SAST.gitlab-ci.yml\"><u>\u0448\u0430\u0431\u043b\u043e\u043d \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/u><\/a> (Security\/Secret-SAST.gitlab-ci.yml) \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445:<\/p>\n<pre><code class=\"yaml\">sast:   stage: test   artifacts:     reports:       sast: gl-sast-report.json   rules:     - when: never   variables:     SEARCH_MAX_DEPTH: 4   script:job     - echo \"$CI_JOB_NAME is used for configuration only, and its script should not be executed\"     - exit 1  .sast-analyzer:   extends: sast   allow_failure: true   # `rules` must be overridden explicitly by each child job   # see https:\/\/gitlab.com\/gitlab-org\/gitlab\/-\/issues\/218444   script:     - \/analyzer run<\/code><\/pre>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u0441\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432 Secret Detection \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438: \u0435\u0441\u0442\u044c \u0441\u0430\u043c\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 SAST, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 (\u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0436\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u2014 gl-sast-report.json). \u041d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432\u0441\u0435 \u0436\u0435 \u0435\u0441\u0442\u044c, \u0442. \u043a. GitLab \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u042f\u041f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b SAST, \u0442\u043e \u0435\u0441\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<pre><code class=\"yaml\">semgrep-sast:   extends: .sast-analyzer   image:     name: \"$SAST_ANALYZER_IMAGE\"   variables:     SEARCH_MAX_DEPTH: 20     SAST_ANALYZER_IMAGE_TAG: 4     SAST_ANALYZER_IMAGE: \"$SECURE_ANALYZERS_PREFIX\/semgrep:$SAST_ANALYZER_IMAGE_TAG$SAST_IMAGE_SUFFIX\"   rules:     - if: $SAST_DISABLED == 'true' || $SAST_DISABLED == '1'       when: never     - if: $SAST_EXCLUDED_ANALYZERS =~ \/semgrep\/       when: never     - if: $CI_COMMIT_BRANCH       exists:         - '**\/*.py'         - '**\/*.js'         - '**\/*.jsx'         - '**\/*.ts'         - '**\/*.tsx'         - '**\/*.c'         - '**\/*.go'         - '**\/*.java'         - '**\/*.cs'         - '**\/*.html'         - '**\/*.scala'         - '**\/*.sc'<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f semgrep. \u041d\u0430\u0441 \u0442\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b rules, \u0430 \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435, \u0442\u043e:<\/p>\n<ul>\n<li>\n<p><strong>\u0431\u043b\u043e\u043a exists<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u043e\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442;<\/p>\n<\/li>\n<li>\n<p><strong>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 $SAST_EXCLUDED_ANALYZERS<\/strong> \u043d\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u2014 \u044d\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c <a href=\"https:\/\/github.com\/snoopysecurity\/Vulnerable-Code-Snippets\"><u>\u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0435\u0439<\/u><\/a>.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443, \u043a\u0430\u043a \u0438 \u0432 Secret Detection <a href=\"https:\/\/habr.com\/ru\/publication\/edit\/724914\/\"><u>\u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/u><\/a>. \u0417\u0430\u0434\u0430\u0447\u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043d\u043e \u0432 \u043e\u0442\u0447\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0443\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/spectr\/articles\/724914\/\"><u>(\u0447\u0442\u043e \u0438 \u0432 \u0447\u0430\u0441\u0442\u0438 1)<\/u><\/a> \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  vulnerability_count=$(cat $FILE_REPORT | jq --raw-output '.vulnerabilities | length') if [ ${vulnerability_count} -gt 0 ];  then   echo \"|     severity     |     name     |     location     |     scanner     |\"   echo \"|------------------|--------------|------------------|-----------------|\"   _jq() {    echo ${row} | base64 --decode | jq -r ${1}   }   for row in $(cat $FILE_REPORT | jq -r '.vulnerabilities[] | @base64'); do     vulnerability_name=$(_jq \".name\")     if [ \"$vulnerability_name\" == \"null\" ]; then vulnerability_name=$(_jq \".message\"); fi     echo '|' $(_jq \".severity\") '|' $vulnerability_name '|' $(_jq \".location.file\")':'$(_jq \".location.start_line\") '|' $(_jq \".scanner.name\") '|'   done fi  exit $vulnerability_count<\/code><\/pre>\n<p>\u0414\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 SAST, \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 (\u043c\u043e\u0436\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\/\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443).<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c .gitlab-ci.yml \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439.<\/p>\n<pre><code class=\"yaml\">stages:   - test  .analyzer_run:   script:     - apk add jq bash coreutils     - \/analyzer run     - bash .gitlab\/scripts\/$NAME_OF_CI_SCRIPT.sh  include:   - local: '\/.gitlab\/templates\/sast.gitlab-ci.yml'<\/code><\/pre>\n<p>\u0422\u0435 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0430\u0434\u0430\u044e\u0442:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Bandit (\u0442\u043e\u043b\u044c\u043a\u043e Python):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Flawfinder (\u0442\u043e\u043b\u044c\u043a\u043e C\/C++):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Gosec (\u0442\u043e\u043b\u044c\u043a\u043e Go):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 Semgrep (\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u043e\u0432, \u0432 \u0442. \u0447. Python, Go, C\/C++):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, SAST \u0432 Gitlab \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<h4>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 SAST \u0432 Gitlab<\/h4>\n<ul>\n<li>\n<p><strong>\u0417\u043e\u043e\u043f\u0430\u0440\u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/strong> \u041f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u042f\u041f \u2014 \u0441\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, phpcs-security-audit \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u043e\u0434 \u0440\u0443\u0442\u043e\u043c, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043b\u0438\u0431\u044b (jq, bash \u0438 \u0442. \u0434.).<\/p>\n<\/li>\n<li>\n<p><strong>\u041b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/strong> \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c SAST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0410 \u0442\u0443\u0442 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u043a\u0440\u0430\u0442\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u00a0<\/h4>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e Semgrep \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u042f\u041f \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f SAST_EXCLUDED_ANALYZERS, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b.<\/p>\n<pre><code class=\"yaml\">sast:   variables:     SAST_EXCLUDED_ANALYZERS: \"bandit,gosec,flawfinder\" # \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b     FILE_REPORT: gl-sast-report.json     NAME_OF_CI_SCRIPT: \"sast\"   tags:     - docker<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043c\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c Bandit, GoSec \u0438 Flawfinder, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e Semgrep. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0442 \u0436\u0435 Semgrep.\u00a0<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0438 \u0441\u0430\u043c Gitlab \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Bandit, ESLint, GoSec). <\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 DevSecOps \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e<\/h4>\n<p>\u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 GitLab-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0412 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043b\u044e\u0441 \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432 \u0432 CI\/CD \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0439.<\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u043c\u0438\u043d\u0443\u0441\u044b:\u00a0<\/p>\n<ul>\n<li>\n<p>GitLab \u043c\u043e\u0436\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>GitLab \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0441\u0435 \u0442\u043e\u0433\u043e \u0436\u0435 Semgrep.<\/p>\n<p>\u0423 Semgrep \u0435\u0441\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0432 <a href=\"https:\/\/hub.docker.com\/r\/semgrep\/semgrep\"><u>Docker Hub<\/u><\/a>, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">semgrep:  stage: test  image: semgrep\/semgrep  variables:    FILE_REPORT: gl-sast-report.json    SEMGREP_RULES: >-      p\/security-audit      p\/secrets      p\/python      p\/django      p\/phpcs-security-audit  tags:    - docker  script:    - semgrep ci --gitlab-sast > $FILE_REPORT || true    - apk add jq bash coreutils    - bash .gitlab\/scripts\/sast.sh  artifacts:    reports:      sast: $FILE_REPORT<\/code><\/pre>\n<ul>\n<li>\n<p><strong>SEMGREP_RULES<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0430\u0432\u0438\u043b, \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441: <a href=\"https:\/\/semgrep.dev\/r\"><u>https:\/\/semgrep.dev\/r<\/u><\/a>\u00a0<\/p>\n<\/li>\n<li>\n<p><strong>&#8212;gitlab-sast<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0432 \u0442\u0430\u043a\u043e\u043c \u0436\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043a\u0430\u043a \u0432 GitLab.<\/p>\n<\/li>\n<li>\n<p>|| <strong>true<\/strong> \u2014 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u0430\u043d\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e job \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u043c \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 .gtilab-ci.yml:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">include:   - local: '\/.gitlab\/templates\/sast-semgrep.gitlab-ci.yml'<\/code><\/pre>\n<h3>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 SonarQube<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u043d\u0430\u0448\u0435\u0439<\/p>\n<\/div>\n<\/div>\n<\/div>\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-377195","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377195","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=377195"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377195\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=377195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=377195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=377195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}