-
Notifications
You must be signed in to change notification settings - Fork 136
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
test: Add Linode Cloud Firewall for all test linode instances #616
test: Add Linode Cloud Firewall for all test linode instances #616
Conversation
ipv4_address = get_public_ip("ipv4") | ||
ipv6_address = get_public_ip("ipv6") | ||
|
||
inbound_rule = create_inbound_rule(ipv4_address, ipv6_address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firewall will automatically pick up ipv4 and ipv6 of machine under test and add them in inbound_rule
tests/integration/conftest.py
Outdated
"--rules.outbound_policy", | ||
"ACCEPT", | ||
"--rules.inbound_policy", | ||
"DROP", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default policy is to DROP all inbound traffic
"id", | ||
] | ||
|
||
if is_valid_ipv4(ipv4_address) or is_valid_ipv6(ipv6_address): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default Firewall will be created if valid IP wasn't found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests passed locally. Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, passes locally.
📝 Description
This PR implements Linode Cloud Firewall for integration tests to enhance security.
Default Inbound policy: DROP
Default Outbound policy: ACCEPT
Inbound rule: inbound rule with public ip on port 22
Note: GHA does not support ipv6 so only ipv4 will get added in firewall during GHA execution. However, ipv6 will get added automatically if ipv6 address and route exist
✔️ How to Test
make testint
https://github.com/linode/linode-cli/actions/runs/9217506829
📷 Preview
If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.