Skip to content

Commit

Permalink
Merge pull request #162 from base2Services/develop
Browse files Browse the repository at this point in the history
develop
  • Loading branch information
Guslington authored Sep 28, 2021
2 parents 43f7881 + 8febd3c commit aa5b7d0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/ciinabox-ecs:${{ github.event.release.tag_name }}
tags: ghcr.io/${{ github.repository_owner.lowercase }}/ciinabox-ecs:${{ github.event.release.tag_name }}
build-args: CIINABOX_ECS_VERSION=${{ github.event.release.tag_name }}
2 changes: 1 addition & 1 deletion ciinabox-ecs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require 'date'

Gem::Specification.new do |s|
s.name = 'ciinabox-ecs'
s.version = '0.4.0'
s.version = '0.4.1'
s.version = "#{s.version}.alpha.#{Time.now.getutc.to_i}" if ENV['TRAVIS'] and ENV['TRAVIS_BRANCH'] != 'master'
s.date = Date.today.to_s
s.summary = 'Manage ciinabox on Aws Ecs'
Expand Down
12 changes: 9 additions & 3 deletions templates/vpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
end

rules = []

opsAccess = opsAccess || []

opsAccess.each do |ip|
rules << { IpProtocol: 'tcp', FromPort: '22', ToPort: '22', CidrIp: ip }
rules << { IpProtocol: 'tcp', FromPort: '80', ToPort: '80', CidrIp: ip }
Expand All @@ -178,10 +181,13 @@
Type 'AWS::EC2::SecurityGroup'
Property('VpcId', Ref('VPC'))
Property('GroupDescription', 'Ops External Access')
Property('SecurityGroupIngress', rules)
Property('SecurityGroupIngress', rules) if rules.any?
}

rules = []

devAccess = devAccess || []

devAccess.each do |ip|
rules << { IpProtocol: 'tcp', FromPort: '22', ToPort: '22', CidrIp: ip }
rules << { IpProtocol: 'tcp', FromPort: '80', ToPort: '80', CidrIp: ip }
Expand All @@ -202,7 +208,7 @@
Type 'AWS::EC2::SecurityGroup'
Property('VpcId', Ref('VPC'))
Property('GroupDescription', 'Dev Team Access')
Property('SecurityGroupIngress', rules)
Property('SecurityGroupIngress', rules) if rules.any?
}


Expand Down Expand Up @@ -300,4 +306,4 @@
Value(Ref('SecurityGroupDev'))
}

}
}
14 changes: 13 additions & 1 deletion templates/vpn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,30 @@
security_groups << Ref('VpnSecurityGroupOps')

rules = []

devAccess = devAccess || []

devAccess.each do |ip|
rules << { IpProtocol: 'tcp', FromPort: '443', ToPort: '443', CidrIp: ip }
rules << { IpProtocol: 'tcp', FromPort: '9443', ToPort: '9443', CidrIp: ip }
rules << { IpProtocol: 'tcp', FromPort: '943', ToPort: '943', CidrIp: ip }
rules << { IpProtocol: 'udp', FromPort: '1194', ToPort: '1194', CidrIp: ip }
end

devIpPrefixLists = devIpPrefixLists || []

devIpPrefixLists.each do |list|
rules << { IpProtocol: 'tcp', FromPort: '443', ToPort: '443', SourcePrefixListId: list }
rules << { IpProtocol: 'tcp', FromPort: '9443', ToPort: '9443', SourcePrefixListId: list }
rules << { IpProtocol: 'tcp', FromPort: '943', ToPort: '943', SourcePrefixListId: list }
rules << { IpProtocol: 'udp', FromPort: '1194', ToPort: '1194', SourcePrefixListId: list }
end

Resource("VpnSecurityGroupDev") {
Type 'AWS::EC2::SecurityGroup'
Property('VpcId', Ref('VPC'))
Property('GroupDescription', 'Dev Team Access')
Property('SecurityGroupIngress', rules)
Property('SecurityGroupIngress', rules) if rules.any?
}

security_groups << Ref('VpnSecurityGroupDev')
Expand Down

0 comments on commit aa5b7d0

Please sign in to comment.