Skip to content

Firewall settings modules #681

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

Conversation

zliang-akamai
Copy link
Member

📝 Description

This is to add firewall_settings and firewall_settings_info module.

✔️ How to Test

You might need to enable default firewall for your account to test it.

Note that once it's enabled for an account, it cannot be turned off, which means you will have to permanently have a default firewall for each of the resources in you account.

curl --request PUT \
     --url https://api.linode.com/v4beta/networking/firewalls/settings \
     --header 'accept: application/json' \
     --header "authorization: Bearer $TOKEN" \   
     --header 'content-type: application/json' \
     --data '
{
    "default_firewall_ids": { 
        "public_interface": YOUR_DEFAULT_FIREWALL_ID,
        "vpc_interface": YOUR_DEFAULT_FIREWALL_ID,
        "linode": YOUR_DEFAULT_FIREWALL_ID,
        "nodebalancer": YOUR_DEFAULT_FIREWALL_ID
    }                 
}

'

Testing the modules:

make test-int TEST_SUITE=firewall_settings

@zliang-akamai zliang-akamai requested a review from a team as a code owner May 23, 2025 06:51
@zliang-akamai zliang-akamai requested review from lgarber-akamai and ezilber-akamai and removed request for a team May 23, 2025 06:51
@zliang-akamai zliang-akamai force-pushed the zhiwei/firewall-settings-module branch from aeb4ca5 to decc5fe Compare May 23, 2025 08:11
@lgarber-akamai lgarber-akamai added the new-feature for new features in the changelog. label May 23, 2025
@lgarber-akamai
Copy link
Contributor

lgarber-akamai commented May 23, 2025

This looks great, nice work!

For the null default_firewall_ids.X issue you mentioned: it looks like the _serialize(...) method is excluding the keys of null fields from FirewallSettingsDefaultFirewallIDs, which is preventing handle_updates(...) from detecting a diff on those keys. Would it make sense to use include_none_values, always_include, or put_class in the class implementation in the Python SDK to address this?

Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

LGTM! Tests passing locally.

@zliang-akamai
Copy link
Member Author

Hi @lgarber-akamai, I enabled include_none_values in FirewallSettingsDefaultFirewallIDs in linode/linode_api4-python#558

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my feedback in the Python SDK!

@zliang-akamai zliang-akamai merged commit 1239b60 into linode:proj/linode-interfaces May 28, 2025
12 checks passed
@zliang-akamai zliang-akamai deleted the zhiwei/firewall-settings-module branch May 28, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants