简体   繁体   English

aws ecs 服务安全

[英]aws ecs service security

I'm new to aws ecs service and would like to know about the security inside ecs service.我是 aws ecs 服务的新手,想了解 ecs 服务内部的安全性。

I'm creating an ecs task which includes two docker container (A and B).我正在创建一个 ecs 任务,其中包括两个 docker 容器(A 和 B)。 A spring-boot application is running on container B and works as a gateway to the backend services. spring-boot 应用程序在容器 B 上运行,用作后端服务的网关。 No login/security is necessary to access this app from container A .. so I can invoke like http://localhost:8080/middleware/ ... and then one of the servlet generates a saml token and invoke backend services by adding this token as authorization header.从容器 A 访问此应用程序不需要登录/安全性 .. 所以我可以像http://localhost:8080/middleware/一样调用......然后一个 servlet 生成一个 saml 令牌并通过添加它来调用后端服务令牌作为授权标头。 All looks good and works fine.一切看起来都很好,工作正常。 However, a couple developers indicated this design has a flaw.但是,一些开发人员表示这种设计存在缺陷。 "Even if ecs service running in SecurityGroup and only an entry point port is open, it is possible for hacker to install malwares onto ec2 instance on which two containers are running, and this malware can invoke the spring-boot app running in container B which is a security breach" “即使 ecs 服务在 SecurityGroup 中运行并且只打开了一个入口点端口,黑客也有可能将恶意软件安装到运行两个容器的 ec2 实例上,并且该恶意软件可以调用在容器 B 中运行的 spring-boot 应用程序是安全漏洞”

I'm not sure if what I heard from my co-workers is true?我不确定我从同事那里听到的是否属实? The security in aws is not strong enough to communicate using localhost without security between containers?? aws 中的安全性不够强,无法在容器之间没有安全性的情况下使用 localhost 进行通信?? If anyone tells me about this, it would be very appreciated!!如果有人告诉我这件事,将不胜感激!!

Security and Compliance is a shared responsibility between AWS and the customer .安全性和合规性是AWS 和客户之间共同责任

In general, AWS is responsible for the security of the overall infrastructure of the cloud, and the customer is responsible for the security of the application, instances and of their data.一般来说,AWS 负责整个云基础设施的安全,而客户负责应用程序、实例及其数据的安全。

For a service like ECS, it is categorized as Infrastructure as a Service (IaaS) and, as such, requires the customer to perform all of the necessary security configuration and related management tasks.对于像 ECS 这样的服务,它被归类为基础设施即服务 (IaaS),因此要求客户执行所有必要的安全配置和相关管理任务。

As the customer you would normally secure an EC2 type ECS load by hardening the instance, use proper security groups, implement VPC security features eg NACLS and private subnets, use least privilege IAM users/roles, while also applying Docker security best practices to secure the containers and images.作为客户,您通常会通过强化实例来保护 EC2 类型的 ECS 负载,使用适当的安全组,实施 VPC 安全功能,例如 NACLS 和私有子网,使用最低权限的 IAM 用户/角色,同时还应用 Docker 安全最佳实践来保护容器和图像。

Note: Docker itself is a complicated system, and there is no one trick you can use to maintain Docker container security.注意:Docker 本身是一个复杂的系统,没有一个技巧可以用来维护 Docker 容器的安全。 Rather you have to think broadly about ways to secure your Docker containers, and harden your container environment at multiple levels, including the instance itself.相反,您必须广泛考虑保护 Docker 容器的方法,并在多个级别强化您的容器环境,包括实例本身。 Doing this is the only way to ensure that you can have all the benefits of Docker, without leaving yourself at risk of major security issues.这样做是确保您可以享受 Docker 的所有好处的唯一方法,而不会让自己面临重大安全问题的风险。

Some answers to your specific questions and comments:对您的具体问题和评论的一些回答:

it is possible for hacker to install malwares onto ec2 instance on which two containers are running, and this malware黑客有可能将恶意软件安装到运行两个容器的 ec2 实例上,并且该恶意软件

If hackers have penetrated your instance and have installed malware, then you have a major security flaw at the instance level, not at the container level.如果黑客渗透了您的实例并安装了恶意软件,那么您在实例级别而不是容器级别存在重大安全漏洞。 Harden and secure your instances to insure your perimeter is protected.强化和保护您的实例,以确保您的周边受到保护。 This is the customer's responsibility.这是客户的责任。

The security in aws is not strong enough to communicate using localhost without security between containers? aws 中的安全性不够强,无法在容器之间没有安全性的情况下使用 localhost 进行通信?

AWS infrastructure is secure and compliant and maintains certified compliance with security standards like PCI and HIPPA. AWS 基础设施安全且合规,并保持符合 PCI 和 HIPPA 等安全标准的认证合规性。 You don't need to worry about security at the infrastructure level for this reason, that is AWS responsibility.由于这个原因,您无需担心基础设施级别的安全性,这是 AWS 的责任。

No login/security is necessary to access this app from container A .. so I can invoke like http://localhost:8080/middleware从容器 A 访问这个应用程序不需要登录/安全性..所以我可以像http://localhost:8080/middleware这样调用

This is certainly not ideal security, and again it is customer responsibility to secure such application endpoints.这当然不是理想的安全性,而且保护此类应用程序端点的安全也是客户的责任。 You should consider implementing basic authentication here - this can be implemented by virtually any web or app server.您应该考虑在此处实施基本身份验证 - 这几乎可以由任何 Web 或应用程序服务器实施。 You could also implement IP whitelisting so API calls can only be accepted from the container A network subnet.您还可以实施 IP 白名单,以便只能从容器 A 网络子网接受 API 调用。

For more information on ECS security see Security in Amazon Elastic Container Service有关 ECS 安全性的更多信息,请参阅Amazon Elastic Container Service 中的安全性

For more information on AWS infrastructure security see Amazon Web Services: Overview of Security Processes有关 AWS 基础设施安全性的更多信息,请参阅Amazon Web Services:安全流程概述

Yes, your colleagues observation is correct.是的,你同事的观察是正确的。

There is very good possibility of such hacks.这种黑客攻击的可能性很大。 But, AWS does provide many different ways in which you can secure your own servers and containers.但是,AWS 确实提供了许多不同的方式来保护您自己的服务器和容器。

  1. Using nested security groups in Public Subnet在公共子网中使用嵌套安全组

In this scenario, AWS allows port access to particular security group rather than an IP address / CIDR range.在这种情况下,AWS 允许端口访问特定安全组而不是 IP 地址/CIDR 范围。 So only resources having particular security group nested can access those ports while no one from outside can access them.因此,只有嵌套了特定安全组的资源才能访问这些端口,而外部人员无法访问它们。

  1. Using Virtual Private Cloud使用虚拟私有云

In this scenario host your all the instances and ecs containers in private subnet and allow only the access to particular port via NAT gateway for public access, in such scenario your instance won't be directly vulnerable to attacks.在这种情况下,在私有子网中托管您的所有实例和 ecs 容器,并仅允许通过 NAT 网关访问特定端口以进行公共访问,在这种情况下,您的实例不会直接受到攻击。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM