-
Notifications
You must be signed in to change notification settings - Fork 350
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
firewall: T4694: Adding rt ipsec exists/missing match to firewall configs #3616
firewall: T4694: Adding rt ipsec exists/missing match to firewall configs #3616
Conversation
👍 |
Please excuse the badly formatted commit message, this isn't intended as a final PR. |
cf2cd64
to
05a35e6
Compare
Updated to include config migration scripts & rebase |
05a35e6
to
a779004
Compare
👍 |
a779004
to
28da5d9
Compare
This one is the important one to fix the original ticketed issues, but it contains a few design decisions I'm not too sure about. My PR notes and linked forum post contain more information. |
Added smoketests in #3800 for both IPsec & GRE match changes - they're all in the same file, so there's merge conflicts in combined testing. |
…figs * Change ipsec match-ipsec/none to match-ipsec-in and match-none-in for fw rules * Add ipsec match-ipsec-out and match-none-out * Change all the points where the match-ipsec.xml.i include was used before, making sure the new includes (match-ipsec-in/out.xml.i) are used appropriately. There were a handful of spots where match-ipsec.xml.i had snuck back in for output hooked chains already (the common-rule-* includes) * Add the -out generators to rendered templates * Heavy modification to firewall config validators: * I needed to check for ipsec-in matches no matter how deeply nested under an output-hook chain(via jump-target) - this always generates an error. * Ended up retrofitting the jump-targets validator from root chains and for named custom chains. It checks for recursive loops and improper IPsec matches. * Added "test_ipsec_metadata_match" and "test_cyclic_jump_validation" smoketests
28da5d9
to
4a37ee6
Compare
👍 |
CI integration ❌ failed! Details
|
Split smoketests back into their respective PRs. |
I've pushed a fix to the branch this PR was tracking, do you want a new PR? |
This patch on vyos#3616 will only attempt to fix ipsec matches in rules if the firewall config tree passed to migrate_chain() has rules attached.
This patch on vyos#3616 will only attempt to fix ipsec matches in rules if the firewall config tree passed to migrate_chain() has rules attached.
This patch on vyos#3616 will only attempt to fix ipsec matches in rules if the firewall config tree passed to migrate_chain() has rules attached.
Change Summary
Current firewall syntax only permits inbound matching of IPsec, using "meta ipsec", which indicates a packet was decrypted from IPsec encap.
This extends firewall capability to also be able to match outbound traffic using "rt ipsec", which indicates a packet will be encrypted into an IPsec encap.
"meta ipsec" is not valid (nft will refuse to load config) inside output hooks so additional care has been taken to ensure it doesn't end up in output or any inappropriate jump targets from an output chain.
In doing these checks, I've also added an infinite jump-target loop check to the validation pass.
Types of changes
Related Task(s)
Related PR(s)
Component(s) name
Proposed changes
I've covered some concerns I have about my implementation in the forum: https://forum.vyos.io/t/outbound-ipsec-filtering-by-firewall-would-like-some-dev-opinions/14710.
How to test
Smoketest result
Note, the groups failure below is also encountered in a clean rolling image:
Checklist: