Skip to main content

Overview

The WCF Agent is a Docker container that runs in your network. On each cycle it:
  1. Reads its configuration from the OneFirewall console.
  2. Downloads the list of IPv4 addresses to block.
  3. Writes the list to a file, and runs a command that sends it to your device.
  4. Reports the result to the console.
The agent starts all connections to OneFirewall. It needs no inbound access from the internet. You change its settings in the console, and it applies them on the next cycle without a restart. This page is for the engineers who deploy and run the agent. It covers the wcf-agent:v4 image. For host sizing and Docker setup, see WCF Installation. You need an agent only if your device cannot download a feed itself. If it can, as FortiGate, Palo Alto, and pfSense can, connect it directly to OneFirewall.

How It Works

The container starts with init.sh. This script starts the HTTP feed server, then repeats this cycle: A run is stopped if it takes more than one hour. The wait starts when the run ends, so the time between reports is the run time plus sync_time.

What the List Contains

  • Addresses: IPv4 only. OneFirewall selects the addresses at or above score_threshold, and applies your organization’s manual blocks, unblocks, and blocking rules.
  • Order: your manual blocks come first, then the highest scores. If maximum_rules cuts the list, the lowest scores are removed first.
  • Networks: the agent replaces each network with its individual addresses. For /30 and larger networks, it leaves out the network and broadcast addresses. For example, 198.51.100.0/29 becomes the six addresses from .1 to .6. Each address counts towards maximum_rules.
  • Invalid entries: the agent skips lines that are not IPv4 addresses or networks.
The agent sends the full list on every cycle, not only the changes. Each page it downloads uses OneFirewall Coins, so a shorter sync_time uses more Coins.

Install the Agent

Requirements

  • A Linux host with Docker and Docker Compose.
  • A OneFirewall token from a user with the Member or Member Admin role. Read Only users cannot download the list or report results. Member Mobile users receive device passwords masked, so the agent cannot sign in to devices.
  • These network connections:
This agent does not receive syslog. To send logs to OneFirewall, see Logs & Network Events.

Steps

  1. In the console, open the page to install a connector. Select your device, score threshold, and sync time.
  2. Download the generated docker-compose.yml to an empty folder on the host. The file contains your token, so restrict access to it:
  3. In the command section, change bash -x init.sh to bash init.sh. The -x option writes the token to the container log.
  4. Start the agent:
  5. In the console, open Connector Status (also called Agent Status), select the connector, and fill in the device settings. See Integrations.
  6. After the next cycle, check that the agent works.
If you cannot access the image, contact [email protected].

Files

The HTTP feed is not stored on the host. If you recreate the container, the feed is not available until the first successful cycle.

Configuration

Connection Settings

The agent reads these settings from config.json:
With the generated Compose file, change these values in its environment section, because config.json is overwritten when the container starts. Then run docker compose up -d to apply the change.

Console Settings

All other settings come from the connector in the console. If you add them to config.json, the agent ignores them.
Do not remove integrations from ips. To turn one off, set active to false.The agent stops with an error if any of these keys is missing: pflist, modsec, cloudflare, cisco, haproxy, csv, sophos, iptables, httpd, checkpoint, checkpoint_securexl, aws.
The JSON examples below show only the integration you need to change. Edit that part of the console configuration, and keep the rest.

Integrations

Activate one integration per agent. Active integrations run at the same time and share one list file, which some scripts delete. The console also keeps only the last result from each agent. To update several devices, use a separate agent, connector, and folder for each one. If they share a host, also give each agent a different host port.
In this version, fortigate, checkpoint, cisco, cloudflare, aws, haproxy, modsec, and pflist do not send any rules, even when active is true. The log says they are enabled, but the agent does not update the device or report a result. The ids settings have no effect either.For FortiGate, use the FortiGate guide. For Check Point, use checkpoint_securexl or Check Point feeds. Other devices can use the httpd feed if they can download a text list.

HTTP Feed (httpd)

Set your firewall to download this address:
Use the exact path. Other unknown paths return the list too, but with a 404 status, which many firewalls treat as an error. The feed has no password and does not use HTTPS. Make it available only on your management network. For example, publish the port on one internal address of the host:
Also limit which devices can connect. Docker can bypass host firewall tools such as ufw, so test the restriction from another machine.

Check Point SecureXL (checkpoint_securexl)

The user needs permission to run the SecureXL commands. Every script except install-securexl-list-ip-add-remove.sh also needs write access to /home/ofa/ on the gateway. Choose the script for your gateway. All the scripts are in artifacts/checkpoint/: install-securexl-list-ip-add-remove.sh does not turn on SecureXL deny lists, so turn them on first. It compares each list with db/previous_blacklist.txt, and updates that file before it contacts the gateway. If an update fails, the script does not retry those changes. It can also report success after a failure, so check the log. To check the rules on the gateway, use the commands for your version in Check Point SecureXL.

Sophos (sophos)

Set address to the Sophos host and API port, without https://. Do not use spaces or shell special characters in user or password. On Sophos, allow API access from the agent host. The script creates IP host groups named OneFirewallBlackListAutomatic0, OneFirewallBlackListAutomatic1, and so on. Each group has up to 998 addresses. Add the groups to your firewall rules as described in the Sophos guide.
  • Limit: the script sends up to 26 groups, or 25,948 addresses, and ignores the rest. Set maximum_rules to 25000.
  • Old groups: if the list gets shorter, groups that are no longer needed keep their old addresses. Clear them, or remove them from your rules.
  • Status: OK does not confirm that Sophos accepted the update. Check the groups in Sophos, and the API responses in the container:

File Copy with SCP (csp)

In the configuration, the key for this integration is csp.
feeds is the path of the file on the destination host. A relative path starts in the user’s home folder. The password cannot contain a single quote or spaces. Lists with fewer than 95,000 lines are copied as one file. Longer lists are split into files of 94,000 lines: onefirewall.txt, onefirewall-2.txt, and so on. For the split to work, the path must have exactly one dot, before the extension. If the list is empty, the script copies nothing and reports OK. If the list gets shorter, old numbered files stay on the destination host. Delete them, or they will still be used.

Your Own Command (csv and iptables)

These integrations run command and add blacklist_onefirewall.txt to the end. The console does not create the command key for them, so add it yourself. The agent does not use acl, reload_command, csv_logs, or csv_reload_command. This example copies the list to onefirewall/db/local/list.txt on the host:
You can use your own script if it is available inside the container. Commands start in /opt/onefirewall/WCF-Agent-latest. Return 0 for success and another number for failure. If the list is empty, leave the device unchanged and return an error. iptables does not change firewall rules by itself. The image has no ipset tool or iptables script, and the container cannot change the host’s firewall by default.

Check That the Agent Works

1. Check the log. A successful run includes these lines (here for httpd):
Length is the number of lines downloaded, before networks are expanded. Punto B in the log is the number of addresses sent to the integration. 2. Check Connector Status. The result and the time of the last report are separate: 3. Check the device. Make sure the rules are there and the number of addresses is what you expect. For the HTTP feed:
OK means that the command succeeded, not that the list is complete. Monitor the number of addresses on the device, and set an alert for zero or a sudden drop.

If a Download Fails

In the last two cases, the log shows Invalid status code, but Connector Status can still show OK. Set an alert for that message, and keep enough Coins in your balance. If init.sh gets no valid response when it reads sync_time, it starts the next cycle without waiting. During an outage, this can cause many requests and log lines.

Operations

Disk Space

The SecureXL scripts, except install-securexl-noblades.sh, and the SCP script save a copy of the list in onefirewall/db/ each time they run. They do not delete old copies. SCP also saves the parts of split lists. Monitor disk space, and delete old copies regularly. This command deletes copies older than seven days:
Run it from the folder that contains docker-compose.yml. Do not delete previous_blacklist.txt: install-securexl-list-ip-add-remove.sh needs it to find addresses to remove.

Security

  • Protect logs: the agent writes the full command to the log, including any device password. Limit who can read Docker logs, and do not share logs before you remove passwords and tokens.
  • Protect credentials: limit access to docker-compose.yml and onefirewall/config/.
  • Limit who can edit connectors: the agent runs the command set in the console. Anyone who can change it can run commands inside the container.
  • Use a separate account: create a device account only for the agent, with the fewest permissions it needs. Allow it to sign in only from the agent host.
  • Isolate the agent: use a dedicated host on a management network. Allow only the connections listed in Requirements.

Troubleshooting

Exit Codes

Codes depend on the script. For your own scripts, use your own codes.