Skip to content

Security

Platform → Security is “Who is alerted about sign-ins at odd hours and attacks on API keys, and what is blocked.” It has five tabs: Settings, Alert contacts, Blocked addresses, Reviews and Activity.

security.read sees the page. It’s held by compliance, operations and engineering. security.manage changes settings and contacts, blocks and lifts addresses, and opens and clears reviews. Compliance and operations hold it. Every change asks for a reason (“A few words for the audit log.”) and is written to the audit log.

“A sign-in between these times is reported to your alert contacts. The window may cross midnight.”

Field Default Notes
Quiet hours start / Quiet hours end 22:00 / 06:00 24-hour clock. The same start and end means no quiet hours.
Time zone Africa/Accra
Report staff sign-ins to this console On
Report merchant sign-ins to the portal On
Also tell the merchant On “Emails the merchant’s contact about a quiet-hours sign-in to their account, and when their payouts are held for review or released.”
Report locked sign-ins On “A staff or merchant sign-in locked after too many wrong passwords or codes.”

A sign-in is reported once it’s complete: after the password and any two-factor code, when the session starts.

“Counted per address over one hour. Each step is reported to your alert contacts.” A key counts as invalid when it is malformed, has an id that isn’t ours, has been edited to the wrong type or environment, or has the wrong secret. A missing key doesn’t count. Neither does a revoked or expired key sent with its correct secret.

Field Default Range What happens
Slow down after 2 1–100 From then on, each further invalid key from the address starts a pause of Wait, in seconds (default 30, up to 3600). During the pause, invalid keys from it get 429 rate_limited with Retry-After instead of 401. A working key from the same address is served as normal.
Block after 10 2–1000, more than Slow down after The address is blocked for Block for, in hours (default 24, up to 720). Until then its API requests get 403 address_blocked, even with a working key. The exception is a key pinned to that address, meaning every rule on its allowlist is narrow and matches it. Only the live gateway blocks. The sandbox gateway slows but never blocks, though a block placed by live applies in the sandbox too.
Hold payouts after 5 1–1000 Wrong secrets for one live key, from any address, within an hour. That key’s merchant is put under review. Test keys never open a review.

IPv6 addresses are counted and blocked by their /64, because one IPv6 host can use a whole /64. The block row then holds the /64’s network address, and its reason reads “Its /64 sent N invalid API keys within an hour.” A block staff place on a single IPv6 address matches only that address.

The guard applies to the API (/v1) only, and it acts after the key has been checked. The hosted pay page and payment links are never affected.

The counters live in Redis. Without Redis nothing is counted, but blocks already placed still hold. The settings and the blocks are stored in the database. They are shared by the live and sandbox gateways, which reload them every 10 seconds. A threshold fires on the first invalid key at or past it. If recording a block or review fails, or a threshold is lowered mid-hour, the next invalid key fires it.

“Every security alert goes to this person: by email if you give an address, by SMS if you give a phone number.” Each contact has a Name, an Email, a Phone for SMS (“0241234567 or +233241234567”), or both. Send this contact alerts turns them off without deleting them.

With no active contact, the page warns “Nobody is being alerted”. Events are still recorded under Activity, and the gateway worker logs a warning.

Alerts are sent by the gateway worker’s send-security-alerts job, every minute. Each active contact gets one email and one SMS per event, for:

  • a sign-in during quiet hours (staff or merchant, as switched on);
  • a sign-in locked;
  • an address blocked or unblocked;
  • a review opened or cleared;
  • a self-service sign-up refused by the platform blocklist (Sign-up refused by the blocklist). It names the kind of value that matched (email address, email domain, phone number or network address), never the value, and the email used. Most often it’s a removed merchant coming back.
  • from SpeculaPro: Sanctions match: merchant’s money-out held, SpeculaPro lifted a freeze: clear the hold and SpeculaPro approved an exit: terminate the merchant. Each names the accounts held. In Activity they read Sanctions freeze (SpeculaPro), Freeze lifted (SpeculaPro) and Exit approved (SpeculaPro), with SpeculaPro as who acted;
  • staff releasing a SpeculaPro hold (A SpeculaPro hold was released; in Activity, SpeculaPro hold released);
  • Sign-in lockout is not working (in Activity, Lockout not working): a wrong password or code, for a merchant or staff sign-in, was refused but couldn’t be counted, so that account isn’t being locked after repeated failures. Always sent, whatever Report locked sign-ins says: that switch is about locks that worked, and this is the lockout itself being off. At most once per account per hour, and at most 3 an hour across all accounts, so a run of guesses, even across many accounts, is a few alerts, not one per guess. The logs keep every case. It names the account’s email and the address. The merchant is never told. The cause is in the API’s logs: see “The sign-in lockout is not working” in the operations runbook.

If Also tell the merchant is on, the merchant’s contact is also emailed about a quiet-hours sign-in to their account, and when a review is opened on their account or cleared. A review SpeculaPro opened sends the merchant nothing when it opens or when it’s cleared, and SpeculaPro’s alerts never go to the merchant.

A payout account added goes to the merchant only, and always. The alert contacts are not emailed or texted about it: merchants add accounts as ordinary upkeep, and a page for each one would teach the on-call phone to be ignored. The merchant API queues the email itself, in the same transaction as the account, to every active owner’s sign-in address and the merchant’s contact email, one copy each. Also tell the merchant doesn’t affect it. The email is titled “New payout account added”. It names the type (bank account or mobile money number), the last four digits, who added it, from which address and when (in the time zone above), and says “Nothing is paid to it until it is verified.” It never carries the full number.

The active blocks come first, then the history. A block placed by the gateway shows how many invalid keys it counted.

Block an address from the API takes an IP address, For how long (1 hour, 24 hours, 7 days or 30 days) and a reason. Blocking an address that’s already blocked extends that block, and a block is never shortened. Lifting one asks “Why it may come back”. “Gateways serve it again within ten seconds. Your alert contacts are told.”

A review holds money out for one merchant in one environment. Payouts, refunds, withdrawals and settlements are refused until it’s cleared. Collections continue, and the account is not suspended. Otherwise anyone who learned a key id could switch a merchant off by sending bad secrets.

Reviews open in two ways:

  • Automatically, after Hold payouts after wrong secrets for one live key in an hour. The review records the key and the count.
  • By staff, with Hold a merchant’s money out: a Merchant (terminated ones aren’t offered), an Environment and a reason. The reason is shown to staff, not to the merchant.
  • By SpeculaPro, on a confirmed sanctions match (reason sanctions_freeze) or an approved exit (reason exit_approved), on every account of the legal entity, live only. An account already under an open review takes SpeculaPro’s reason instead, so it also needs two people to clear. The merchant isn’t told. See What SpeculaPro can do here.

A merchant has at most one open review per environment. A second attack while one is open adds nothing. Open reviews are listed first.

Clearing asks “What was found”. “Payouts, refunds, withdrawals and settlements can go out again. Rotate the merchant’s key first if it may have leaked.” A key whose id is known can be attacked again straight away, so rotate it before clearing.

A review SpeculaPro opened takes two people to clear. The dialog asks for Authorised by, a different active operator with security.manage, and its button reads Send for approval. Nothing is released until they approve it in Approvals. The wording changes with the reason:

  • sanctions freeze: “SpeculaPro froze this account over a confirmed sanctions match. Clear it only once compliance agrees the match is resolved. A second operator approves.”
  • exit approved: “SpeculaPro approved exiting this customer. Clear it only if the exit was cancelled; otherwise terminate the merchant. A second operator approves.”

SpeculaPro lifting a freeze clears nothing: it alerts staff, who clear the review here. Clearing one records SpeculaPro hold released (“A SpeculaPro hold was released” to the alert contacts), not an ordinary review clear, so the merchant isn’t emailed.

How the hold works:

  • A database trigger refuses any new payout-direction transaction (payouts and refunds) and any new withdrawal request while a review is open. The merchant gets 403 money_out_on_hold. A path added later is covered without anyone remembering to add it.
  • The settlement payer checks for a review first and holds the batch with “the merchant is under a security review; clear it on the Security page, then release and approve this batch again”. Clearing the review doesn’t release the batch: release and approve it again on Settlements.
  • A payout or refund created before the review opened isn’t stopped.

Everything the page alerts on, newest first, including payout accounts added (Payout account added), which no alert contact is sent: the kind, who (staff or merchant user, by email), the merchant and environment, the address and what happened. Also Several accounts opened from one browser: an account opened from a browser that opened other accounts in the last 30 days. It names the new account, how many others there were, and the codes of up to five of the most recent. It isn’t sent to the alert contacts: one owner opening a second business is ordinary, but several unrelated businesses from one browser are worth a look. The browser is identified by a random id the portal keeps in its storage. Clearing site data resets it, and API sign-ups don’t send one, so treat it as a signal, not proof. It’s the record even when nobody was alerted.