{"id":306284,"date":"2020-07-02T09:00:43","date_gmt":"2020-07-02T09:00:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306284"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306284","title":{"rendered":"\u041f\u043e\u0447\u0435\u043c\u0443 \u0432 Docker \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Strace"},"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\/company\/itsumma\/blog\/508990\/\">\u041a\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u00ab<a href=\"https:\/\/wizardzines.com\/zines\/containers\/\">How Containers Work<\/a>\u00bb, \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 Docker \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>strace<\/code>. \u0412\u043e\u0442 \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 <code>strace<\/code> \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435:<\/p>\n<pre><code class=\"bash\">$ docker run  -it ubuntu:18.04 \/bin\/bash $ # ... install strace ... root@e27f594da870:\/# strace ls strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted<\/code><\/pre>\n<p>  <code>strace<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>ptrace<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0437 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f <code>ptrace<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u041d\u043e \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0438 \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u044f \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">docker run --cap-add=SYS_PTRACE  -it ubuntu:18.04 \/bin\/bash<\/code><\/pre>\n<p>  \u041d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u0435 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 <code>strace<\/code> \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 <code>--cap-add=SYS_PTRACE<\/code> \u0432\u0441\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442?<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0413\u0438\u043f\u043e\u0442\u0435\u0437\u0430 1: \u0423 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043d\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 <code>CAP_SYS_PTRACE<\/code> <\/h3>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>--cap-add=SYS_PTRACE<\/code>, \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 Docker \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043d\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 <code>CAP_SYS_PTRACE<\/code>, \u043d\u043e \u043f\u043e \u0434\u0432\u0443\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0442\u0443\u0442 \u043a\u043e\u0435-\u0447\u0442\u043e \u043d\u0435 \u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<p>  <b>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 1:<\/b> \u0412 \u0432\u0438\u0434\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u044f, \u0431\u0443\u0434\u0443\u0447\u0438 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u043c\u043e\u0433\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>strace<\/code> \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0443 \u043c\u043e\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 <code>CAP_SYS_PTRACE<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430:<\/p>\n<pre><code class=\"bash\">$ getpcaps $$ Capabilities for `11589': =<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 2:<\/b> \u0432 <code>man capabilities<\/code> \u043e \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 <code>CAP_SYS_PTRACE<\/code> \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">CAP_SYS_PTRACE        * Trace arbitrary processes using ptrace(2);<\/code><\/pre>\n<p>  \u0412\u0441\u044f \u0441\u0443\u0442\u044c <code>CAP_SYS_PTRACE<\/code> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043c\u044b, \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 root, \u043c\u043e\u0433\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 <b>\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c<\/b> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043b\u044f <code>ptrace<\/code> \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f \u043d\u0435 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u043f\u0440\u043e\u0432\u0435\u043b\u0430 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443: \u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0430 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 <code>docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 \/bin\/bash<\/code>, \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043c\u0435\u043d\u0438\u043b\u0430 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044e <code>CAP_SYS_PTRACE<\/code> \u2014 \u0438 <code>strace<\/code> \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438. \u041f\u043e\u0447\u0435\u043c\u0443?!<\/p>\n<h3>\u0413\u0438\u043f\u043e\u0442\u0435\u0437\u0430 2: \u0414\u0435\u043b\u043e \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d?<\/h3>\n<p>  \u041c\u043e\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f (\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0445\u0443\u0436\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f) \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u0437\u0432\u0443\u0447\u0430\u043b\u0430 \u0432 \u0434\u0443\u0445\u0435 \u00ab\u0445\u043c\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u0438 <code>strace<\/code> \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u2026 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e?\u00bb \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0432\u044f\u0437\u043d\u044b\u0445 \u0432\u044b\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u0439, \u043d\u043e \u044f \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438 \u0441 \u044d\u0442\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d? \u0422\u0430\u043a \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435:<\/p>\n<pre><code class=\"bash\">root@e27f594da870:\/# ls \/proc\/$$\/ns\/user -l ... \/proc\/1\/ns\/user -&gt; 'user:[4026531837]'<\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435:<\/p>\n<pre><code class=\"bash\">bork@kiwi:~$ ls \/proc\/$$\/ns\/user -l ... \/proc\/12177\/ns\/user -&gt; 'user:[4026531837]'<\/code><\/pre>\n<p>  root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0447\u0442\u043e \u0438 root \u043d\u0430 \u0445\u043e\u0441\u0442\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0438\u0445 \u043e\u0431\u0449\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d (4026531837), \u0442\u0430\u043a \u0447\u0442\u043e \u0441 \u044d\u0442\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043c\u0435\u0448\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0435 <code>strace<\/code> \u043f\u0440\u0438\u0447\u0438\u043d. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0442\u0430\u043a \u0441\u0435\u0431\u0435, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u044f \u0435\u0449\u0435 \u043d\u0435 \u043e\u0441\u043e\u0437\u043d\u0430\u0432\u0430\u043b\u0430, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0438 \u044d\u0442\u043e\u0442 \u043f\u043e\u0445\u043e\u0434 \u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c.<\/p>\n<h3>\u0413\u0438\u043f\u043e\u0442\u0435\u0437\u0430 3: \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>ptrace<\/code> \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c <code>seccomp-bpf<\/code><\/h3>\n<p>  \u042f \u0443\u0436\u0435 \u0437\u043d\u0430\u043b\u0430, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432 Docker \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e <code>seccomp-bpf<\/code>, \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0435\u0441\u0442\u044c \u0438 <code>ptrace<\/code>! (\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u044d\u0442\u043e \u043b\u0438\u0441\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438 <code>ptrace<\/code> \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u0432 \u043d\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f.)<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>strace<\/code>, \u0432\u0435\u0434\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>ptrace<\/code> \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u0443 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>strace<\/code> \u0432 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 seccomp:<\/p>\n<pre><code class=\"bash\">$ docker run --security-opt seccomp=unconfined -it ubuntu:18.04  \/bin\/bash $ strace ls execve(&quot;\/bin\/ls&quot;, [&quot;ls&quot;], 0x7ffc69a65580 \/* 8 vars *\/) = 0 ... it works fine ...<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u0441\u0435\u043a\u0440\u0435\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0442! \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e\u2026<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 <code>--cap-add=SYS_PTRACE<\/code> \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443?<\/h3>\n<p>  \u041c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043b\u0438 \u043f\u043e\u0447\u0435\u043c\u0443 <code>--cap-add=SYS_PTRACE<\/code> \u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 <code>docker run<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>--cap-add<\/code>:<\/p>\n<pre><code class=\"bash\">--cap-add=[]    Add Linux capabilities<\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c seccomp! \u0412 \u0447\u0435\u043c \u0436\u0435 \u0434\u0435\u043b\u043e?<\/p>\n<h3>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Docker.<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442, \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438.<br \/>  \u0412 Go \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u0435\u043d\u0434\u043e\u0440\u0438\u043d\u0433\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Go \u0432\u044b \u0447\u0435\u0440\u0435\u0437 <code>grep<\/code> \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e \u0438 \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0441 \u043a\u043e\u0434. \u0422\u0430\u043a \u0447\u0442\u043e \u044f \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0430 <code>github.com\/moby\/moby<\/code> \u0438 \u043f\u0440\u043e\u0448\u0435\u0440\u0441\u0442\u0438\u043b\u0430 \u0435\u0433\u043e \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u0438\u0434\u0430 <code>rg CAP_SYS_PTRACE<\/code>.<\/p>\n<p>  \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0442 \u0447\u0442\u043e: \u0432 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 seccomp \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"https:\/\/github.com\/containerd\/containerd\/blob\/4be98fa28b62e8a012491d655a4d6818ef87b080\/contrib\/seccomp\/seccomp_default.go#L527-L537\">contrib\/seccomp\/seccomp_default.go<\/a> \u043f\u043e\u043b\u043d\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u043e seccomp \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0435\u0439.<\/p>\n<pre><code class=\"go\">\t\tcase &quot;CAP_SYS_PTRACE&quot;: \t\t\ts.Syscalls = append(s.Syscalls, specs.LinuxSyscall{ \t\t\t\tNames: []string{ \t\t\t\t\t&quot;kcmp&quot;, \t\t\t\t\t&quot;process_vm_readv&quot;, \t\t\t\t\t&quot;process_vm_writev&quot;, \t\t\t\t\t&quot;ptrace&quot;, \t\t\t\t}, \t\t\t\tAction: specs.ActAllow, \t\t\t\tArgs:   []specs.LinuxSeccompArg{}, \t\t\t})<\/code><\/pre>\n<p>  \u0422\u0430\u043c \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 moby \u0438 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/moby\/moby\/blob\/cc0dfb6e7b22ad120c60a9ce770ea15415767cf9\/profiles\/seccomp\/seccomp.go#L126-L132\">profiles\/seccomp\/seccomp.go<\/a>, \u0438 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/moby\/moby\/blob\/master\/profiles\/seccomp\/default.json#L723-L739\">seccomp \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e<\/a> \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u0447\u0442\u043e, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043d\u0430\u0448 \u043e\u0442\u0432\u0435\u0442!<\/p>\n<h3>\u0412 Docker <code>--cap-add<\/code> \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u0435, \u0447\u0435\u043c \u0441\u043a\u0430\u0437\u0430\u043d\u043e<\/h3>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u0445\u043e\u0436\u0435, <code>--cap-add<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a <code>--cap-add-and-also-whitelist-some-extra-system-calls-if-required<\/code>. \u0418 \u044d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0430\u0432\u0434\u0443: \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f \u0432 \u0434\u0443\u0445\u0435 <code>CAP_SYS_PTRACE<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>process_vm_readv<\/code>, \u043d\u043e \u044d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c seccomp, \u0432\u0430\u043c \u044d\u0442\u043e \u043c\u0430\u043b\u043e \u0447\u0435\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>process_vm_readv<\/code> \u0438 <code>ptrace<\/code> \u0447\u0435\u0440\u0435\u0437 <code>CAP_SYS_PTRACE<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0430\u0437\u0443\u043c\u043d\u043e.<\/p>\n<h3>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, <code>strace<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Docker<\/h3>\n<p>  \u0414\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u044f\u0434\u0440\u0430 4.8 \u0438 \u0432\u044b\u0448\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <a href=\"https:\/\/github.com\/moby\/moby\/commit\/1124543ca8071074a537a15db251af46a5189907\">\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/a> \u0432 Docker 19.03 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <code>ptrace<\/code>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 Docker \u0432\u0441\u0435 \u0435\u0449\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 18.09.7, \u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043c\u0438\u0442, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<\/p>\n<h3>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435!<\/h3>\n<p>  \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0438 \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0439 \u00ab\u043d\u0430\u0447\u0438\u043d\u043a\u0438\u00bb \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u044d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442, \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u043c\u043e\u0439 \u0436\u0443\u0440\u043d\u0430\u043b \u00ab<a href=\"https:\/\/wizardzines.com\/zines\/containers\">How Containers Work<\/a>\u00bb, \u043d\u0430 \u0435\u0433\u043e 24 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044f\u0434\u0440\u0430 Linux \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0422\u0430\u043c \u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/wizardzines.com\/comics\/capabilities\/\">\u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438<\/a> \u0438 <a href=\"https:\/\/wizardzines.com\/comics\/seccomp-bpf\/\">seccomp-bpf<\/a>.<\/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\/company\/itsumma\/blog\/508990\/\"> https:\/\/habr.com\/ru\/company\/itsumma\/blog\/508990\/<\/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\/company\/itsumma\/blog\/508990\/\">\u041a\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u00ab<a href=\"https:\/\/wizardzines.com\/zines\/containers\/\">How Containers Work<\/a>\u00bb, \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 Docker \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>strace<\/code>. \u0412\u043e\u0442 \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 <code>strace<\/code> \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435:<\/p>\n<pre><code class=\"bash\">$ docker run  -it ubuntu:18.04 \/bin\/bash $ # ... install strace ... root@e27f594da870:\/# strace ls strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted<\/code><\/pre>\n<p>  <code>strace<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>ptrace<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0437 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f <code>ptrace<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u041d\u043e \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0438 \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u044f \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">docker run --cap-add=SYS_PTRACE  -it ubuntu:18.04 \/bin\/bash<\/code><\/pre>\n<p>  \u041d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u0435 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 <code>strace<\/code> \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 <code>--cap-add=SYS_PTRACE<\/code> \u0432\u0441\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306284","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306284","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=306284"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306284\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}