Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow network whitelisting on the service level #3581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beastawakens
Copy link
Collaborator

I think this syntax is correct but I'd recommend some manual testing of this, just to be sure!

@beastawakens beastawakens force-pushed the service-whitelist-support branch from 22c8aeb to 4aed578 Compare September 15, 2022 21:56
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Base: 36.19% // Head: 36.22% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (ae88e4f) compared to base (e087555).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3581      +/-   ##
==========================================
+ Coverage   36.19%   36.22%   +0.02%     
==========================================
  Files         168      168              
  Lines       18413    18418       +5     
==========================================
+ Hits         6665     6672       +7     
+ Misses      10616    10613       -3     
- Partials     1132     1133       +1     
Impacted Files Coverage Δ
pkg/manifest/service.go 41.02% <ø> (ø)
provider/aws/template.go 0.00% <0.00%> (ø)
pkg/logstorage/logstorage.go 87.91% <0.00%> (+7.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Twsouza Twsouza force-pushed the service-whitelist-support branch from 4aed578 to ae88e4f Compare September 26, 2022 18:59
@@ -238,7 +238,7 @@
{{ end }}
"Properties": {
"Actions": [ { "Type": "forward", "TargetGroupArn": { "Ref": "BalancerTargetGroup{{ if .Internal }}Internal{{ end }}" } } ],
"Conditions": [ { "Field": "host-header", "Values": [ { "Fn::Join": [ ".", [ "{{$.App}}-{{.Name}}", { "Fn::ImportValue": { "Fn::Sub": "${Rack}:{{ router .Name $.Manifest }}Host" } } ] ] } ] } ],
"Conditions": [ { "Field": "host-header", "Values": [ { "Fn::Join": [ ".", [ "{{$.App}}-{{.Name}}", { "Fn::ImportValue": { "Fn::Sub": "${Rack}:{{ router .Name $.Manifest }}Host" } } ] ] } ] }, { "Field": "source-ip", "SourceIpConfig": { "Values": [ {{ range safeWhitelist .Whitelist }} "{{ . }}", {{ end }} ] } } ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beastawakens the e2e tests got an error here:

Promoting RHQCJJDYHME... ERROR: json syntax error: line 248 pos 241: invalid character ']' looking for beginning of value:             "Conditions": [ { "Field": "host-header", "Values": [ { "Fn::Join": [ ".", [ "ci2-web", { "Fn::ImportValue": { "Fn::Sub": "${Rack}:RouterHost" } } ] ] } ] }, { "Field": "source-ip", "SourceIpConfig": { "Values": [  "0.0.0.0/0",  ] } } ],

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uuurgh, I know the syntax is a nested mess but that's CloudFormation for you. I'm not seeing an extra closing bracket though 🤔 there's 5 opening, and 5 closing by my reckoning? Can you spot it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any extra closing. I think I've found the problem when you create the app with an empty whitelist it will create "SourceIpConfig": { "Values": [ "0.0.0.0/0", ] } } ], you can see that will create an invalid comma in the values list.

@heronrs
Copy link
Contributor

heronrs commented Sep 29, 2022

@beastawakens if you could also create some tests to assert this new functionality we would greatly appretiate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants