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

Create resource junos_global_policy with support for global policies #138

Closed
adrian884 opened this issue Mar 4, 2021 · 1 comment · Fixed by #148
Closed

Create resource junos_global_policy with support for global policies #138

adrian884 opened this issue Mar 4, 2021 · 1 comment · Fixed by #148
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@adrian884
Copy link

Hi, this is amazing work, thank you! I think it would greatly benefit from having support for global policies (i.e multiple src/dest zone), like the config set below:

set global policy Global-Allow-some-traffic match source-address Earth
set global policy Global-Allow-some-traffic match destination-address Clouds
set global policy Global-Allow-some-traffic match destination-address Moon
set global policy Global-Allow-some-traffic match application any
set global policy Global-Allow-some-traffic match from-zone Trust
set global policy Global-Allow-some-traffic match to-zone Zone1
set global policy Global-Allow-some-traffic match to-zone Zone2
set global policy Global-Allow-some-traffic then permit
set global policy Global-Allow-some-traffic then log session-init
set global policy Global-Allow-some-traffic then log session-close

I don't have any Go skills, but looking at the existing resource_security_policy.go file, looks like it could easily be adapted for the above. The policies would need to be identified by their names (not from/to-zone) and the set command build would start with "set global policy " instead of "set security policy from-zone ... to-zone ..."

Making the terraform definition something like this:

resource junos_global_policy "demo_policy" {
  policy {
    name                      = "allow_global_traffic"
    match_source_zone      = ["Trust"]
    match_destination_zone      = ["Zone1", "Zone2"]
    match_source_address      = ["Earth"]
    match_destination_address = ["Clouds", "Moon"]
    match_application         = ["any"]
  }
}

This would most likely need global addresses and sets, such as #137

@jeremmfr
Copy link
Owner

jeremmfr commented Mar 4, 2021

It's a good proposal.
Global policies are still in security block so the name should be junos_security_global_policy
I will take care of adding the resource

@jeremmfr jeremmfr added the enhancement New feature or request label Mar 4, 2021
@jeremmfr jeremmfr self-assigned this Mar 4, 2021
jeremmfr added a commit that referenced this issue Mar 18, 2021
fix #138: add junos_security_global_policy resource
@jeremmfr jeremmfr added this to the v1.14.0 milestone Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants