Support for SourceSecurityGroupId under SecurityGroupEgress in AWS::EC2::SecurityGroup
See original GitHub issuecfn-lint version: (cfn-lint --version
)
cfn-lint 0.7.3
Description of issue. For some reason I get:
E3002 Invalid Property Resources/LaServiceEndpointSecurityGroup/Properties/SecurityGroupEgress/0/SourceSecurityGroupId
template.yml:1483:9
for
LaServiceEndpointSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: LaServiceEndpointSecurityGroup
GroupDescription: Security Group for VPC endpoints in the Lambda subnets
SecurityGroupEgress:
- IpProtocol: tcp
FromPort: 443
ToPort: 443
SourceSecurityGroupId:
Fn::GetAtt: [LambdaCanCallLaServiceSecurityGroup, GroupId]
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 443
ToPort: 443
SourceSecurityGroupId:
Fn::GetAtt: [LambdaCanCallLaServiceSecurityGroup, GroupId]
VpcId:
Ref: VPC
Tags:
- Key: Name
Value: LaServiceEndpointSecurityGroup
- Key: Stage
Value: {Ref: Stage}
The odd part is it doesn’t complain about SourceSecurityGroupId under SecurityGroupIngress only SecurityGroupEgress
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:16 (10 by maintainers)
Top Results From Across the Web
AWS::EC2::SecurityGroupIngress - AWS CloudFormation
Creates rules that grant full ICMP, UDP, and TCP access. If you specify SourceSecurityGroupName or SourceSecurityGroupId and that security group is owned by...
Read more >SecurityGroup refers to another security group - Stack Overflow
SourceSecurityGroupName is for EC2 classic only. You are using VPC EC2 (which is recommended). Use SourceSecurityGroupId instead.
Read more >Support for SourceSecurityGroupId under ... - GitHub
Description of issue. For some reason I get: E3002 Invalid Property Resources/LaServiceEndpointSecurityGroup/Properties/SecurityGroupEgress/0/ ...
Read more >Unrestricted Outbound Access | Trend Micro
Check your Amazon EC2 security groups for outbound/egress rules that allow unrestricted access (i.e. 0.0.0.0/0 or ::/0) on any TCP/UDP ports and restrict ......
Read more >Insecure Access Control - GuardRails
Both SecurityGroupIngress and SecurityGroupEgress Security groups with ... the more secure configuration as outlined in the examples below:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, that’s so WEIRD – I ran it myself and it looks like the CloudFormation workflow is treating the SourceSecurityGroupId as a DestinationSecurityGroupId. This kind of makes sense since the underlying API (AuthorizeSecurityGroupEgress) doesn’t differentiate and simply has a parameter called “GroupId”.
I’m going to cut a ticket with the CloudFormation team. Seems silly to have differentiated properties on the CFN side if they’re just going to lump them together on the API side, but I would say in general this is behavior as expected within the linter.
Are you ok with changing your template to use DestinationSecurityGroupId per the docs/spec for now and we’ll treat this a CloudFormation issue?
@cmmeyer can you take this one? Looks like another case of weirdness with the documentation/spec/API.
@Hamitamaru we rely on the CloudFormation spec a lot for this. I cut and pasted the appropriate section below for reference and that property isn’t specified.
Looks like the documentation matches the spec.
So the API may take
SourceSecurityGroupId
. My guess is you should be usingDestinationSecurityGroupId
but something is still allowingSourceSecurityGroupId
which isn’t documented?