What happened
In the past two weeks, two separate security incidents involving other miner management software vendors led to miners being pointed at an attacker's wallet without the owner's knowledge.
- Week of November 2: Miners using Hiveon/HiveOS were reportedly reconfigured to send hashrate to an attacker-controlled Ocean pool address.
- November 14 and 15: An on-site agent from Luxor Commander was used to push new pool settings across thousands of miners on private networks. Affected miners were redirected to an attacker's wallet on Ocean pool.
Foreman wasn't involved in either incident. However, several Foreman customers were affected because they also run other tools that can change miner settings (in some cases without them even being aware that the vendor had access to their network).
If your miners are pointed at an address you don't recognize, correct them now and contact your other vendors. The rest of this article shows how to set up Foreman so it catches unauthorized pool changes and reverses them automatically.
How Foreman protects you
Trusted pools plus an invalid pool trigger can catch an unauthorized pool change and put your miners back on your pool, with an alert to your team.
- Someone, or another tool, changes the pool settings on a miner.
- On the next stats update, Foreman compares the miner's pool URL and worker name to your trusted pools. If they don't match, the miner is flagged with an Invalid Pool Configuration issue.
- Your trigger sees the Invalid Pool Configuration issue, pushes your correct pool settings back to the miner, and sends an alert.
This works no matter how the change was made, including changes made outside Foreman by another tool. Without it, most affected operators only noticed hours later when payouts dropped.
Step 1: Set up trusted pools
Trusted pools tell Foreman which pool URL and worker name combinations are allowed on your miners. Any miner that doesn't match gets flagged.
- Go to Settings > Mining Pools. Under Trusted Pool Configurations, click Add Config.
-
Match Type: choose one:
-
Exact: the safest choice. An Insert Variables button appears next to the Worker Expression so you can build worker names from miner details, such as
${miner.mac:clean}. Regex isn't supported on this type. - Regular Expression: use a pattern when your worker names follow a convention. Variables aren't supported on this type.
-
Exact: the safest choice. An Insert Variables button appears next to the Worker Expression so you can build worker names from miner details, such as
- Miner Types: optional. Leave it blank to apply to all miners, or pick specific models if different models mine to different pools.
-
Stratum Expression: the pool host and port, without the
stratum+tcp://prefix. - Worker Expression: the worker name or pattern. Make sure it includes your wallet address or account name, not just the part after the dot.
- Click Add Config again for each pool you use, including fallback pools, then click Save.
An Exact trusted pool for Ocean. The Insert Variables button appears when Match Type is Exact.
Examples
| Setup | Match Type | Stratum Expression | Worker Expression |
|---|---|---|---|
| Ocean, one wallet, MAC-based workers | Exact | mine.ocean.xyz:3334 |
bc1qYOURWALLET.${miner.mac:clean} |
| Ocean, one wallet, any worker suffix | Regular Expression | mine\.ocean\.xyz:3334 |
bc1qYOURWALLET\..* |
| Ocean through a local DATUM Gateway | Exact |
10.0.0.25:23334 (your gateway's IP and port) |
bc1qYOURWALLET.${miner.mac:clean} |
| Account-based pool | Regular Expression | btc\.global\.luxor\.tech:700 |
youraccount\..* |
Available Variables
Available when Match Type is Exact. Click Insert Variables next to the Worker Expression.
| Variable | What it inserts |
|---|---|
${miner.id} |
Foreman miner ID |
${miner.ip.1} to ${miner.ip.4}
|
One octet of the miner's IP (1st to 4th) |
${miner.mac:clean} |
MAC address without colons |
${miner.serial} |
Miner serial number |
Use the same variable in your trusted pool and in the trigger's Change Pools action, so the worker name the trigger writes is one the trusted pool accepts. ${miner.mac:clean} or ${miner.serial} is the safest choice, since IP-based workers change when a miner's IP changes.
Common mistakes
-
Worker pattern that matches anything. A pattern like
.*, or a blank trusted pool entry, accepts every worker, including an attacker's wallet. The worker pattern must lock in your own wallet or account. -
Unescaped dots in regex. Write
mine\.ocean\.xyz, notmine.ocean.xyz. - Pattern covers only part of the worker name. The regex must match the whole worker name. Foreman adds start and end anchors automatically. You can test patterns at regexr.com.
After saving, check your miners list. Any miner already showing Invalid Pool Configuration doesn't match your trusted pools. Fix those, or adjust the pattern, before turning on the trigger in Step 2. Matching miners clear in about 5 minutes.
Step 2: Create the auto-correct trigger
One trigger can both fix the pools and alert your team. Set it up once per group of miners that share the same pool settings.
- Go to Alerts & Triggers and click Add Trigger. Give it a name.
- Miners to Check: choose the miners this applies to, such as a site, sub-client or IP range. Leave the grouping set to Any. If you choose A Count of or A Percent of, Send Alert is the only action available.
- What to Check For: choose Trips a(n) > Invalid Pools Configured. Then set For ___ 1 Minute Interval(s) low, such as 1 to 5. The default is 10, and a lower number means less lost hashrate.
- What to Do: under Perform a, select both Change Pools and Send Alert.
-
Change Pools: fill in the URL, Pool Username and Pool Password for all three pools. All three are required.
- Type your wallet address or account name in full in each Pool Username.
- For the part after the dot, use a variable based on miner hardware, such as
${miner.mac:clean}or${miner.serial}. Click View Variables to see the full list. - Use the same variable in your trusted pool and in the trigger's Change Pools action, so the worker name the trigger writes is one the trusted pool accepts.
${miner.mac:clean}or${miner.serial}is the safest choice, since IP-based workers change when a miner's IP changes. - Don't use Last Miner Account (
${miner.account}) or the Miner Worker variables (${miner.worker},${miner.worker.1}to${miner.worker.3}) here. They take their values from the pool settings last seen on the miner, which after an attack would be the attacker's wallet.
- Send Alert: under Destinations, choose where alerts go: All Emails, Specific Emails, Discord, Google Chat, Slack or Telegram.
- Click Add Trigger to save it.
Miners to Check: leave the grouping on Any.
What to Check For: Invalid Pools Configured, with the interval lowered from 10 to 2.
What to Do: Change Pools and Send Alert together, with your wallet typed in full and a MAC-based worker suffix.
To test it, change the pool on a single miner by hand. After the next stats update and the trigger's interval, you should see the Invalid Pool Configuration issue, the pool change in the audit log, and the alert.
Ocean users mining directly to mine.ocean.xyz
Without a local DATUM Gateway, your miners point at the same address the attackers used, mine.ocean.xyz:3334. The wallet address in your Worker Expression is the only thing that tells your settings apart from an attacker's, so it has to be there.
-
Trusted pool: Stratum Expression
mine.ocean.xyz:3334. For Worker Expression, usebc1qYOURWALLET.${miner.mac:clean}(Exact) orbc1qYOURWALLET\..*(Regular Expression). - Fallbacks: add a config for every other Ocean endpoint or port you use.
-
Trigger: use
mine.ocean.xyz:3334for the URLs and type your wallet in full in each Pool Username, followed by.${miner.mac:clean}. -
Never use a Worker Expression of
.*, or one that covers only the part after the dot. It accepts an attacker's wallet too.
Hosting several Ocean customers? Each customer has a different wallet, so set up a trusted pool and a trigger per customer, scoped to that customer's sub-client. A single trigger can't cover them all, because the variables that pull a wallet from each miner (${miner.account}, ${miner.worker}) would copy an attacker's wallet back.
Ocean users running a local DATUM Gateway
If you mine to Ocean through a DATUM Gateway on your own network, your miners point at the gateway's local address instead of mine.ocean.xyz. That makes this setup much stronger. In both recent incidents, miners were sent straight to Ocean's public pool address with the attacker's wallet. With only your gateway's address trusted, that change fails the check even before the wallet is compared.
- Trusted pool: add a config whose Stratum Expression is your DATUM Gateway's local IP and port.
-
Fallback pools: if you keep
mine.ocean.xyzas Pool 2 or 3, add it as its own trusted pool with a Worker Expression that includes your wallet. -
Trigger: in Change Pools, set URL 1 to your DATUM Gateway and use
mine.ocean.xyzfor URLs 2 and 3.
What to know before relying on it
- It reverses changes, it doesn't block them. Foreman can't stop another tool from writing to your miners. It catches the change and undoes it, so expect a few minutes of lost hashrate per incident.
- Repeated attacks. If the other tool keeps pushing the attacker's settings, the pools will switch back and forth. Remove or disconnect the compromised tool as soon as you can.
- Curtailment pauses the fix. Trigger actions that send commands to miners, including Change Pools, are skipped while a site is in an active demand response dispatch. You'll still be alerted, but pools won't be corrected until the dispatch ends.
- Foreman needs access to the miner. If an attacker changes the miner's login or locks the firmware, Foreman can't push the fix. The Invalid Pool Configuration flag and alert still let you know.
More ways to lock down your fleet
- Require approval for pool changes. This makes bulk pool changes made in Foreman wait for a second person to approve. It protects you if someone gets into your Foreman account or API key.
- Turn on MFA for every Foreman user, and remove users who no longer need access.
- Limit which tools can write to your miners. Every agent on your mining network that can change settings is a way in. Remove the ones you don't use and keep the rest on a segmented network.
- Check the audit log regularly for pool changes you don't recognize.
Need help?
Contact Foreman support and we'll review your trusted pools and trigger setup with you. If you think your miners were affected, include your client ID and roughly when the change happened, and we'll help you find which miners were redirected and for how long.