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

Add dynamic rules to Fabric firewall submodule #79

Merged
merged 8 commits into from
Oct 11, 2019

Conversation

ludoo
Copy link
Contributor

@ludoo ludoo commented Oct 10, 2019

Aleks, this is a first shot at adding dynamic rule definitions to the firewall submodule, to make it a bit more flexible.

What I tried to implement here:

  • enforcing structure for the rule definitions variable
  • combine ingress and egress into a single variable/resource so that the module has few duplications
  • correctly handle the incompatibility of tags/service accounts based source and targets

I did some minimal testing and it seems to work. This is an example variable for an ingress rule using both source and target tags, and a source range:

dynamic_rules = {
  dummy = {
    description          = "Dummy rule."
    direction            = "INGRESS"
    action               = "allow"
    ranges               = ["192.168.0.0"]
    sources              = ["spam-tag"]
    targets              = ["foo-tag", "egg-tag"]
    use_service_accounts = false
    rules = [
      {
        protocol = "tcp"
        ports    = []
      }
    ]
    extra_attributes = {}
  }
}

Can you give it a try and let me know your thoughts?

@ludoo ludoo requested review from averbuks and a team October 10, 2019 06:06
@ludoo ludoo changed the title WIP: add dynamic rules to fabric firewall submodule Add dynamic rules to Fabric firewall submodule Oct 11, 2019
@ludoo
Copy link
Contributor Author

ludoo commented Oct 11, 2019

This has now been tested more thoroughly, outputs have been added, and the README file updated.

@ludoo
Copy link
Contributor Author

ludoo commented Oct 11, 2019

@morgante we need this for Fabric and it seems a minimal (and non-disruptive) enough implementation to go in after review, I would of course be interested in your comments.

@ludoo ludoo requested a review from morgante October 11, 2019 05:55
Copy link
Member

@averbuks averbuks left a comment

Choose a reason for hiding this comment

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

Awesome

@morgante morgante merged commit 4d3ca19 into master Oct 11, 2019
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