security - 使用HTTP BASIC AUTH保护Docker容器

标签 security authentication nginx docker

考虑使用带有公开端口的Web应用程序运行Docker容器。在访问URL(HTTP BASIC AUTH)之前如何应用附加安全层?

Docker Engine版本> = 1.9.1

最佳答案

通常,您将使用一个专用的身份验证容器,例如NGiNX。
在“Authenticating proxy with nginx”中对此进行了描述,它不仅添加了基本身份验证,而且还添加了ssl(https)

然后,该Web服务器将反向代理到您的容器。

您使用 jwilder/nginx-proxy 有一个更通用的解决方案(基于反向代理NGiNX)

nginx-proxy sets up a container running nginx and docker-gen.
docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.



请参阅带有“Automated Nginx Reverse Proxy for Docker”的用例。

关于security - 使用HTTP BASIC AUTH保护Docker容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34490451/

相关文章:

node.js - mosca MQTT 代理的安全 key 和证书

spring - 如何在Grails中从Spring Security获取普通密码或解密密码?

django - 从 django + gunicorn + nginx 设置向外部 URL 发出 POST 请求

django - 当生产更新时,我应该重新启动 nginx 和 gunicorn 吗?

nginx - 使用 nginx 和 lua 和 openresty 获取完整的 url

php - 安全类(class) build

php - 沙盒化用户的 PHP 代码

authentication - 使用第一方移动和单页应用程序的 OAuth 2 密码授予

ruby-on-rails - 使用 rspec 测试自定义设计和/或 warden 策略

node.js - iOS & node.js : how to verify passed access token?