Description

This check ensures that the default inbound policy of every Linode Cloud Firewall is set to DROP. The default policy decides what happens to inbound traffic that does not match any rule. With DROP, only traffic that is explicitly allowed by a rule is permitted. Each firewall is evaluated separately.

Rationale

With an inbound policy of ACCEPT, every port and service on the attached Linodes is reachable from the internet unless a rule blocks it. Any service that is accidentally exposed, such as a database, an admin panel or a test server, can be found and attacked. A default-deny (DROP) inbound policy ensures only the services that are meant to be public are reachable. Akamai states that a default inbound policy of Accept is generally not recommended.

Impact

  • After the change, all inbound traffic that is not allowed by a rule is blocked

  • If no allow rule exists for SSH (port 22) or for the application ports (for example 80 and 443), you can lose access to the Linode or the service can go down. Add these rules before switching to DROP

  • The change applies at once to all Linodes and NodeBalancers attached to the firewall

Default Value

When a new Cloud Firewall is created in Cloud Manager, the Default Inbound Policy is Drop. It can be changed to Accept at creation or later.

Pre-Requisites

  • A Cloud Manager user with read/write access to the firewall

  • A list of the inbound traffic the Linodes need (protocols, ports and source IP addresses), so allow rules can be added before switching to DROP

  • For the CLI test plan: a Personal Access Token created by an unrestricted user with Firewalls: Read Only scope

Remediation

Test Plan

Console:

  1. Sign in to Cloud Manager at https://cloud.linode.com.

  2. In the sidebar, under Networking, click Firewalls and select the firewall.

  3. On the Rules page, check the Inbound Policy dropdown. If it shows Accept, the firewall fails.

  4. Repeat for each firewall.

CLI:

Set the token:

export LINODE_TOKEN="<your-personal-access-token>"

List every firewall with its default inbound policy:

curl -s -H "Authorization: Bearer $LINODE_TOKEN" "https://api.linode.com/v4/networking/firewalls?page_size=500" | jq '.data[] | {id, label, inbound_policy: .rules.inbound_policy}'

A firewall passes if inbound_policy is "DROP" and fails if it is "ACCEPT".

Implementation Steps

Console:

  1. Sign in to Cloud Manager at https://cloud.linode.com.

  2. In the sidebar, under Networking, click Firewalls and select the firewall that failed the check.

  3. On the Rules page, review the inbound rules. For each type of traffic the Linodes need, click Add An Inbound Rule, fill in Label, Protocol, Ports, Sources and set Action to Accept, then click Add Rule.

  4. Set the Inbound Policy dropdown to Drop.

  5. Click Save Changes.

  6. Test that the applications on the attached Linodes still work.

  7. Repeat for each firewall that failed the check.

Backout Plan

  1. Sign in to Cloud Manager at https://cloud.linode.com.

  2. In the sidebar, under Networking, click Firewalls and select the firewall.

  3. On the Rules page, set the Inbound Policy dropdown back to Accept.

  4. Click Save Changes.

Reference