TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Understanding Docker Security and Best Practices

40 点作者 adamveld12大约 10 年前

4 条评论

zaroth大约 10 年前
A large part of the document boils down to &#x27;run with defaults&#x27;, &#x27;setup auditing&#x27;, and &#x27;check file permissions&#x27;, &#x27;drop unneeded capabilities&#x27;, &#x27;define sane limits&#x27;, &#x27;centralize and rotate logs&#x27;, and &#x27;make backups&#x27;. These are all really great baseline steps. There were also I think a few Docker-specific points worth highlighting;<p>- Run with -icc=false. This should have been the default but isn&#x27;t for legacy reasons I think. By default there is no firewall between containers. icc=false turns the inter-container firewall on. This is a pretty basic one, but easy for new docker users to miss.<p>- Host port mapping (e.g. -p 80) by default binds to 0.0.0.0:80 on the host container. This could inadvertently expose your internal services to unexpected interfaces. Specify the host IP you want to bind to explicitly (e.g. -p 127.0.0.1:49123:8080)<p>- Run inside containers as non-root. Most Dockerfiles you come across will run as root inside the container. In your base image, &#x27;RUN useradd&#x27; and in your Dockerfiles add a &#x27;USER&#x27; directive, and start the container with -u &lt;user&gt;.<p>- Set root file system as read-only inside the container. It enforces the best practice that the container should be immutable anyway.<p>- Instead of --restart:always, try --restart=on-failure:5 to avoid a possible DoS or excessive flapping. Not sure if I 100% agree with this, but it&#x27;s an interesting suggestion.
评论 #9501950 未加载
评论 #9504750 未加载
评论 #9503604 未加载
bkeroack大约 10 年前
This document says essentially nothing of significance--it is a marketing piece. There are no details of exactly how resilient a containerized process is to attack, how to prevent &quot;escaping&quot;, etc. The general consensus (if I&#x27;m not mistaken) is that containers are for deployment&#x2F;operational convenience and should not be relied upon for security, but you would have no idea if you only read this so-called whitepaper.
zobzu大约 10 年前
Them registration links :(
评论 #9500788 未加载
评论 #9502131 未加载
评论 #9501179 未加载
评论 #9501023 未加载
评论 #9500987 未加载
ams6110大约 10 年前
Why do I need to take any action to securely deply Docker containers? Why aren&#x27;t they secure by default. What I should need to study is how to run them insecurely, should I have that need. Secure should be the default mode.
评论 #9501743 未加载
评论 #9500908 未加载
评论 #9500906 未加载