Limit IPs that can access an Elastic Beanstalk ALB listern or process

0

Our Elastic Beanstalk application has a three listeners 80 and 443 which forward to the default process that runs our web app, and another port that runs a monitoring app on a different port. I'd like to restrict which IPs can access the port of the monitoring app.

What's the best way to do this? Elastic Beanstalk makes the security group assigned to the ALB and it sets the allowed sources for the port of the monitoring app to 0.0.0.0/0. I can manually go in there and change it but I don't want to do that b/c then it will get blown away when I update our EB config laster.

I'm hoping for a solution that works well with EB and doesn't get blown away when the environment gets rebuilt.

Here's a bit of the relevant config for context

  AWSEBV2LoadBalancer.aws:elbv2:loadbalancer:
    AccessLogsS3Bucket: null
    AccessLogsS3Enabled: 'false'
    AccessLogsS3Prefix: null
    IdleTimeout: null
    SecurityGroups: sg-xxxx

AWSEBV2LoadBalancerListener5555.aws:elbv2:listener:xxxx:
    DefaultProcess: someprocess
    ListenerEnabled: 'true'
    Protocol: HTTPS
    Rules: null
    SSLCertificateArns: xxxx
    SSLPolicy: null

someprocess.aws:elasticbeanstalk:environment:process:someprocess:
    DeregistrationDelay: '20'
    HealthCheckInterval: '15'
    HealthCheckPath: /
    HealthCheckTimeout: '5'
    HealthyThresholdCount: '3'
    MatcherHTTPCode: '200'
    Port: 'xxxx'
    Protocol: HTTP
    StickinessEnabled: 'false'
    StickinessLBCookieDuration: '86400'
    StickinessType: lb_cookie
    UnhealthyThresholdCount: '5'
Ryan
질문됨 2달 전139회 조회
1개 답변
0

To restrict IP access to a specific port on your Elastic Beanstalk's ALB:

  1. Navigate to the Amazon EC2 console, select your Load Balancer, and go to the Security tab to edit its security groups.
  2. Add a new rule to allow access only from your desired IPs to the specific port your monitoring app uses.

Remember, security groups function as a virtual firewall, controlling inbound and outbound traffic to your ALB. By setting specific inbound rules, you can limit access to your application on a per-port basis.

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-update-security-groups.html

profile picture
전문가
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠