Digital Ocean Firewall

Open Docker

Risk Level: High

Description: 

This plugin determines if the TCP port 2375 or 2376 for Docker is open to the public. Unlike HTTP and HTTPS, which can be available to public access, TCP port 2375 and 2376 must be restricted to known IP addresses. These ports are used by the Docker server to establish connections. To minimise false positives, this plugin reports only those firewalls with public IP associated with any of its network.

About the Service :

DigitalOcean Firewall:

DigitalOcean Cloud Firewalls are an organization-based, stateful firewall administration for Droplets given at no extra expense. Cloud firewalls block all traffic that isn't explicitly allowed by a standard. Firewalls place an obstruction between your servers and different machines in the organization to safeguard them from outer assaults. Firewalls can behave based, which are designed on a for every waiter premise utilizing administrations like IPTables or UFW. Others, such as DigitalOcean Cloud Firewalls, are network-based and stop traffic at the organization layer before it arrives at the server.

Impact : 

Firewalls for the droplets are used to control the incoming and outgoing traffic. There are rules defined under firewalls that can allow specific IP addresses to access the droplets with the protocol and the Ports specified. Exposed Docker ports can pose a serious security threat. If the docker container with exposed port gets published, it will result in exposing the complete source code of the container to the public.

Steps to Reproduce :

  1. Login to the digital ocean console.
  2. Select Networking under the MANAGE section.
  3. Switch to the Firewalls tab.
  4. Select a firewall from the given lists.
  5. Check under Inbound Rules and/or Outbound Rules, if the Type is set to All TCP/custom, Protocol as TCP and Port Range includes either All ports or port 2375 0r 2376, visit the Steps for Remediation section.  
  6. Repeat the process for other firewalls with open Docker as well.

Steps for Remediation :

  1. Login to the digital ocean console.
  2. Select Networking under the MANAGE section.
  3. Switch to the Firewalls tab.
  4. Select a firewall from the given lists.
  5. Check under Inbound Rules and/or Outbound Rules, if the Type is set to All TCP /custom, Protocol as TCP and Port Range includes either All ports or port 2375 or 2376, we will have to change the source and destination for the port to enhance security.  
  6. Select the rule in which port 53 is open to all source or destination by clicking on More, click on Edit Rule.
     
  7. Under Sources remove All IPv4 and All IPv6 options, add the eligible source (in Inbound Rules) / destination (in Outbound Rules) IP address and click on Save
  8. Repeat the process for other open docker ports in firewalls as well.