binchoo / PaimonGanyu

여행 비서 페이몬! Genshin Impact AWS workflows & KakaoTalk chatbot skills
https://pf.kakao.com/_mtPFb
GNU General Public License v3.0
7 stars 1 forks source link

[SAM] Improve beanstalk security: introduce new security group for skill connectors #16

Closed binchoo closed 2 years ago

binchoo commented 2 years ago

As-is: I have my beanstalk application inside the "default VPC & subnet".

To-be:

binchoo commented 2 years ago

Options:

binchoo commented 2 years ago

Creating a new SG for ikakao proxies

SGIkakaoBotProxy:
  Type: AWS::EC2::SecurityGroup
  Properties:
    GroupDescription: "Security Group allowing inbound traffic from ikakao bot proxies"
    GroupName: SGIkakaoBotProxy
    SecurityGroupIngress:
      - IpProtocol: tcp
        FromPort: 80
        ToPort: 80
        CidrIp: 219.249.231.40/30

PaimonGanyuSkillConfigurationTemplate:
  Type: AWS::ElasticBeanstalk::ConfigurationTemplate
  Properties:
    Description: Configuration for PaimonGanyu KAKAOTALK Skill Server
    ApplicationName: !Ref PaimonGanyuSkillApplication
    SolutionStackName: 64bit Amazon Linux 2 v3.2.16 running Corretto 11
    OptionSettings:
      ...
      - Namespace: aws:autoscaling:launchconfiguration
        OptionName: SecurityGroups
        Value: !Ref SGIkakaoBotProxy
      ...
binchoo commented 2 years ago

Change of Impact

Now the security policy which https://github.com/binchoo/PaimonGanyu/issues/16#issuecomment-1200372227 describes is applied. image