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

test: Add Linode Cloud Firewall for all test linode instances #616

Conversation

ykim-akamai
Copy link
Contributor

@ykim-akamai ykim-akamai commented May 24, 2024

📝 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.

@ykim-akamai ykim-akamai requested a review from a team as a code owner May 24, 2024 00:41
@ykim-akamai ykim-akamai requested review from jriddle-linode and zliang-akamai and removed request for a team May 24, 2024 00:41
ipv4_address = get_public_ip("ipv4")
ipv6_address = get_public_ip("ipv6")

inbound_rule = create_inbound_rule(ipv4_address, ipv6_address)
Copy link
Contributor Author

@ykim-akamai ykim-akamai May 24, 2024

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

"--rules.outbound_policy",
"ACCEPT",
"--rules.inbound_policy",
"DROP",
Copy link
Contributor Author

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

@ykim-akamai ykim-akamai added the testing for updates to the testing suite in the changelog. label May 24, 2024
@ykim-akamai ykim-akamai marked this pull request as draft May 24, 2024 01:16
@ykim-akamai ykim-akamai marked this pull request as ready for review May 24, 2024 02:00
"id",
]

if is_valid_ipv4(ipv4_address) or is_valid_ipv6(ipv6_address):
Copy link
Contributor Author

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

Copy link
Member

@zliang-akamai zliang-akamai left a 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!

Copy link
Collaborator

@jriddle-linode jriddle-linode left a comment

Choose a reason for hiding this comment

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

LGTM, passes locally.

@ykim-akamai ykim-akamai merged commit 8ea0a3d into linode:dev May 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing for updates to the testing suite in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants