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

Support for Juniper Wildcard Zones #292

Open
minitriga opened this issue Nov 23, 2021 · 3 comments
Open

Support for Juniper Wildcard Zones #292

minitriga opened this issue Nov 23, 2021 · 3 comments

Comments

@minitriga
Copy link

I have a requirement to enable wildcard security policies on some SRX devices using Caparica and I'm unable to do this.

header {
  target:: srx from-zone <*> to-zone <*>
}

term deny-to-google {
  source-address:: INTERNAL
  destination-address:: GOOGLE_DNS
  destination-port:: DNS
  protocol:: tcp
  action:: accept
}

This should result in a security policy that is from-zone <*> to-zone <*>

But you are presented with UnsupportedFilterError: SRX filter arguments must specify from-zone and to-zone.

I think this is because the parser is not allowing the <*> through and is erroring out somewhere.

@abhindes
Copy link
Collaborator

abhindes commented Dec 8, 2021

Yup, the parser considers these illegal characters here - https://github.com/google/capirca/blob/master/capirca/lib/policy.py#L1832

Could you elaborate on this requirement so we can decide if this is something Capirca can support safely?

I wasn't aware of SRX supporting wildcard zones, is this something specific to your policies?

@minitriga
Copy link
Author

Its a very niche use case but when defining security policies in groups you can do wild card zones. This allows Junos users to add security policy information to all policies that would match the wildcard groups.

https://kb.juniper.net/InfoCenter/index?page=content&id=KB35745&showDraft=false

@abhindes
Copy link
Collaborator

abhindes commented Jan 6, 2022

We've discussed this internally. We'd prefer to not modify the parser to handle * as a legal character.

A way to handle this could be to use a special reserved token to represent the wildcard zone - "wildcard-zone-token", and when this is provided in the .pol file as the from-zone or to-zone, the Junper SRX generator can convert this "wildcard-zone-token" into the correct configuration (i.e. to <*>). This will limit this change to the SRX generator. We also don't expect zones to be named "wildcard-zone-token", so that should have no issues either.

We will accept a PR for this if you need this feature! Thanks!

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

No branches or pull requests

2 participants