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

VPC-SC module does not enforce service filtering on ingress policies while using factories #2250

Closed
karpok78 opened this issue May 1, 2024 · 1 comment · Fixed by #2251
Closed
Assignees

Comments

@karpok78
Copy link

karpok78 commented May 1, 2024

There seems to be a typo in the factory.tf file of the vpc-sc module.

Starting line 67 :

   ingress_policies = {
      for k, v in local._data.ingress_policies : k => {
        from = merge({
          access_levels = []
          identity_type = null
          identities    = null
          resources     = []
        }, try(v.from, {}))
        to = {
          operations = [
            for o in try(v.operations, []) : merge({
              method_selectors     = []
              permission_selectors = []
              service_name         = null
            }, o)
          ]
          resources = try(v.to.resources, [])
        }
      }
    }

The operations parameter is looping on v.operations instead of v.to.operations
This results in the service filters not to be applied on the policies.

@ludoo
Copy link
Collaborator

ludoo commented May 1, 2024

Great find, I had fixed it at a customer and forgot to bring back the change here. Will send a PR shortly, thanks for flagging.

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 a pull request may close this issue.

2 participants