We are trying to get traffic from the internet to hit our ALB, get decrypted and then sent through the Palo Alto Cloud NGFW and finally reach our containers. See image below:
For some reason we are not able to get this to work when we allow traffic from the security group of the ALB into the security group of the ECS containers. So this is not working:
ContainerSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "Security group for containers"
SecurityGroupIngress:
- SourceSecurityGroupId: !Ref ALBSecurityGroup
Description: "From load balancer"
FromPort: 80
IpProtocol: tcp
ToPort: 80
VpcId: !ImportValue app-vpc
While this is working:
ContainerSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "Security group for containers"
SecurityGroupIngress:
- CidrIp: "<IP_ADDRESSES_OF_ALB>"
Description: "From load balancer"
FromPort: 80
IpProtocol: tcp
ToPort: 80
VpcId: !ImportValue app-vpc
Not been able to find any clear documentation on this, does anyone know if this can be solved somehow, if I am missing something? It would rather not hardcode IP addresses in the security group as we are setting up this using CloudFormation.