{"id":306484,"date":"2020-07-06T09:00:26","date_gmt":"2020-07-06T09:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306484"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-07-06T09:00:26","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306484","title":{"rendered":"\u0411\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043b\u0438\u0432\u043a\u0443 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439, \u0430\u0440\u0445\u0438\u0432\u043e\u0432, \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Gitlab CE"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/509732\/\">\n<p>Git hooks \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0439 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u043f\u0440\u043e <a href=\"https:\/\/pre-commit.com\/\" rel=\"nofollow\">pre-commit<\/a> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c. \u041d\u043e \u0432\u0435\u0434\u044c \u043d\u0435 \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u0432\u0441\u0435\u043c Gitlab. <\/p>\n<p>  <\/p>\n<p>\u041a\u0442\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043b\u0441\u044f \u0432 pre-commit \u0438 pre-receive \u0445\u0443\u043a\u0430\u0445, \u0432 <a href=\"https:\/\/blog.gitguardian.com\/git-hooks-automated-secrets-detection\/\" rel=\"nofollow\">\u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/a> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0432 \u0430\u0431\u0437\u0430\u0446\u0435 &quot;What are git hooks?&quot;.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 Gitlab Enterprise Edition, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0445\u0443\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043f\u043e\u0441\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 WEB \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 Gitlab Community (Core) Edition?<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b 5 pre-receive \u0445\u0443\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Gitlab Community (Core) Edition:<\/p>\n<p>  <\/p>\n<ul>\n<li>block_confidentials.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 AWS \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/li>\n<li>block_file_extensions.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u043e\u0432 (Regex \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<li>check-large-files.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 (\u0420\u0430\u0437\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<li>reject-not-allowlist-email.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0441 email \u043d\u0435 \u0438\u0437 allow \u0441\u043f\u0438\u0441\u043a\u0430 (\u0421\u043f\u0438\u0441\u043e\u043a email \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<li>require-issue.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0431\u0435\u0437 issue \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 (\u0421\u043f\u0438\u0441\u043e\u043a issue \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0445\u0443\u043a\u0438 \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <a href=\"https:\/\/github.com\/github\/platform-samples\" rel=\"nofollow\">platform-samples<\/a> \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong>pre-receive-hooks<\/strong> (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a GitHub Enterprise).<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0445\u0443\u043a\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/patsevanton\/git-server-pre-receive-hooks\" rel=\"nofollow\">Github<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"ustanovka-na-gitlab\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 Gitlab<\/h3>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/opt\/gitlab\/embedded\/service\/gitlab-shell\/hooks\/pre-receive.d\/<\/code><\/li>\n<li>\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0445\u0443\u043a\u0438<\/li>\n<li>\u041d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043b\u044f \u0445\u0443\u043a\u043e\u0432 (chmod +x \u0444\u0430\u0439\u043b-\u0445\u0443\u043a\u0430)<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"blokirovanie-otpravki-privatnyh-klyuchey-i-aws-tokenov\">\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 AWS \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 block_confidentials.sh \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a regex_list, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># Define list of REGEX to be searched and blocked regex_list=(   # block any private key file   '(\\-){5}BEGIN\\s?(RSA|OPENSSH|DSA|EC|PGP)?\\s?PRIVATE KEY\\s?(BLOCK)?(\\-){5}.*'   # block AWS API Keys   'AKIA[0-9A-Z]{16}'   # block AWS Secret Access Key (TODO: adjust to not find validd Git SHA1s; false positives)   # '([^A-Za-z0-9\/+=])?([A-Za-z0-9\/+=]{40})([^A-Za-z0-9\/+=])?'   # block confidential content   'CONFIDENTIAL' )<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u043f\u0440\u0438 <code>git push<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jq\/fw\/kx\/jqfwkxqsg4ugu94oads9zjvm3tk.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"blokirovanie-otpravki-arhivov\">\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 block_file_extensions.sh \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c case <code>*.zip|*.gz|*.tgz<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 zip \u0430\u0440\u0445\u0438\u0432, \u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u043f\u0440\u0438 <code>git push<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2s\/iy\/z3\/2siyz35_wtazzauh8asoj5zicji.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"blokirovanie-otpravki-bolshih-faylov\">\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 check-large-files.sh \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>maxsize<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u0430\u0445, \u0432\u044b\u0448\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0430\u0439\u043b \u0431\u043e\u043b\u044c\u0448\u0435 1 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u0430, \u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u043f\u0440\u0438 <code>git push<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1n\/c3\/sj\/1nc3sjqy3yfgzjfidsuboksqju4.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"blokirovanie-kommitov-s-email-ne-iz-allow-spiska\">\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0441 email \u043d\u0435 \u0438\u0437 allow \u0441\u043f\u0438\u0441\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 reject-not-allowlist-email.sh \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a email-\u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u043a\u043e\u043c\u043c\u0438\u0442\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">declare -a DOMAIN_ARRAY=(&quot;group1.com&quot; &quot;group2.com&quot;)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0447\u0442\u0443 \u0432 git \u043d\u0430 \u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442 \u0432 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">git config user.email user1@group3.com<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043b\u044e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b, \u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u043f\u0440\u0438 <code>git push<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lw\/8w\/jj\/lw8wjjazuc9qonuw_g4yo4oshq8.png\"><\/p>\n<p>  <\/p>\n<h3 id=\"blokirovanie-kommitov-bez-issue-v-nazvanii\">\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0431\u0435\u0437 issue \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0445\u0443\u043a \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0438\u0437 \u0431\u043b\u043e\u0433\u0430 <a href=\"https:\/\/www.majilesh.com\/author\/majilesh\/\" rel=\"nofollow\">Majilesh<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 require-issue.sh \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a commit_format, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u043a\u043e\u043c\u043c\u0438\u0442\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">commit_format=&quot;(JIRA|PROJECTKEY|MULE|ECOM|SAP|XLR-[1-9]+Merge)&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043b\u044e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b, \u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442, \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0441\u043b\u043e\u0432 \u0438\u0437 commit_format \u0438 \u043f\u0440\u0438 <code>git push<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/z2\/fk\/c1\/z2fkc1hgh6359ujbld7r6ph_exy.png\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0447\u0442\u043e \u043c\u043e\u0439 \u043f\u043e\u0441\u0442 \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043d\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0445\u0443\u043a\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>Telegram-\u0447\u0430\u0442 \u043f\u043e <a href=\"https:\/\/t.me\/ru_gitlab\" rel=\"nofollow\">Gitlab<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/509732\/\"> https:\/\/habr.com\/ru\/post\/509732\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/509732\/\">\n<p>Git hooks \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0439 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u043f\u0440\u043e <a href=\"https:\/\/pre-commit.com\/\" rel=\"nofollow\">pre-commit<\/a> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c. \u041d\u043e \u0432\u0435\u0434\u044c \u043d\u0435 \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u0432\u0441\u0435\u043c Gitlab. <\/p>\n<p>  <\/p>\n<p>\u041a\u0442\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043b\u0441\u044f \u0432 pre-commit \u0438 pre-receive \u0445\u0443\u043a\u0430\u0445, \u0432 <a href=\"https:\/\/blog.gitguardian.com\/git-hooks-automated-secrets-detection\/\" rel=\"nofollow\">\u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/a> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0432 \u0430\u0431\u0437\u0430\u0446\u0435 &quot;What are git hooks?&quot;.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 Gitlab Enterprise Edition, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0445\u0443\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043f\u043e\u0441\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 WEB \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 Gitlab Community (Core) Edition?<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b 5 pre-receive \u0445\u0443\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Gitlab Community (Core) Edition:<\/p>\n<p>  <\/p>\n<ul>\n<li>block_confidentials.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 AWS \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/li>\n<li>block_file_extensions.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u043e\u0432 (Regex \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<li>check-large-files.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 (\u0420\u0430\u0437\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<li>reject-not-allowlist-email.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0441 email \u043d\u0435 \u0438\u0437 allow \u0441\u043f\u0438\u0441\u043a\u0430 (\u0421\u043f\u0438\u0441\u043e\u043a email \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<li>require-issue.sh \u2014 \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0431\u0435\u0437 issue \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 (\u0421\u043f\u0438\u0441\u043e\u043a issue \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f)<\/li>\n<\/ul>\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-306484","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306484","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=306484"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306484\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}