Skip to content

Tighten Ec2SSMConnect security group configuration #206

@droguljic

Description

@droguljic

Currently Ec2SSMConnect uses one security group for the Ec2 instance and VPC endpoints with inbound/outbound config:

ingress: [
  {
    protocol: 'tcp',
    fromPort: 22,
    toPort: 22,
    cidrBlocks: [vpcOutput.vpc.cidrBlock],
  },
  {
    protocol: 'tcp',
    fromPort: 443,
    toPort: 443,
    cidrBlocks: [vpcOutput.vpc.cidrBlock],
  },
],
egress: [
  { protocol: '-1', fromPort: 0, toPort: 0, cidrBlocks: ['0.0.0.0/0'] },
],

This should be split into two security groups:

  1. Ec2 instance security group with inbound/outbound config:
ingress: [],
egress: [
  { protocol: 'tcp', fromPort: 443, toPort: 443, cidrBlocks: ['0.0.0.0/0'] },
]
  1. VPC endpoints security group with inbound/outbound config:
ingress: [
  {
    protocol: 'tcp',
    fromPort: 443,
    toPort: 443,
    cidrBlocks: [vpcOutput.vpc.cidrBlock],
  },
],
egress: [
  { protocol: '-1', fromPort: 0, toPort: 0, cidrBlocks: ['0.0.0.0/0'] },
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions