Blacklists and exclusions
Access rules decide who may validate before anything else is checked:
- A blacklist rule refuses matching license checks with
BLACKLISTED: a leaked key used from one machine, a range of addresses that resells keys, a country you don't sell to, or a customer who charged back. - An exclusion rule lets matching checks through without limits: your own machine or office address while you develop and test, so you never use up a customer's machine slots or trigger overuse alerts.
Rules apply within seconds of saving them and work on every plan, also after a downgrade.
What a rule matches
| Type | Value | Blacklist | Exclusion |
|---|---|---|---|
| IP | One address (203.0.113.7, 2001:db8::1) or a CIDR range (203.0.113.0/24, 2001:db8::/32) | ✓ | ✓ |
| Machine (HWID) | The machine id your app sends as fingerprint, hwid or host, exactly | ✓ | ✓ |
| Country | Two-letter ISO code (RU, BR), from Cloudflare's location of the request | ✓ (Lite and Standard) | |
| Customer | One of your customers: every license they own | ✓ |
Each rule applies to your whole organization, to one product or to one license. A rule can carry a note and an expiry date, after which it stops matching. Every rule shows how many checks it has matched and when it last did.
In what order
- The key must exist: an unknown key is
NOT_FOUNDwhatever your rules say. - Access rules: of the rules that match, the one with the most specific scope decides (license, then product, then organization). In the same scope an exclusion beats a blacklist, so you can exclude your own machine from an organization-wide country block.
- A blacklisted check answers
BLACKLISTED. It takes no machine slot. - An excluded check skips blacklists and the machine limit, takes no slot, raises no overuse alert and is left out of analytics and the license's activity feed. The license must still be active and unexpired, unless the exclusion is set to let suspended and expired licenses through (a revoked license stays revoked).
- Otherwise the usual checks: status, expiry, machine limit.
What your app sees
BLACKLISTED is a rejection like REVOKED: { "valid": false, "code": "BLACKLISTED" } on /api/v1/validate and HTTP 400 on /api/v2/license/validate, so the official SDKs, V1 ones included, already treat it as "no". The message doesn't say which rule matched.
Adding rules
In the dashboard, Access rules (in the sidebar under Customers) lists your rules on two tabs, Blacklist and Exclusions, with what each matches, where it applies (license keys are shown masked), its note and expiry, and how many checks it has matched and when it last did. Add rule picks the kind, what it matches and where it applies; the pencil edits a rule's note, expiry and, for exclusions, Let suspended and expired licenses through. What a rule matches can't change: delete it and add a new one.
Shortcuts elsewhere in the dashboard:
- Block this machine: on a license, next to each machine under Activations and each check under Recent validations. Block it for that license only, or for every license you sell.
- Blacklist on a customer: every license they hold, now or later, answers
BLACKLISTED. This is different from Block customer, which suspends their licenses (they answerSUSPENDED) and can be undone with Unblock; a blacklist suspends nothing and is undone by deleting the rule. - Exclude my current IP on the Access rules page: shows the address SunLicense sees for your browser and excludes it for your whole organization. Link to it directly with
/access-rules?exclude-ip=1.
CSV import and export
Import adds up to 1,000 rules from a CSV file whose first line names the columns:
kind,type,value,scope,scopeId,note,expiresAt
BLACKLIST,IP,203.0.113.0/24,ORG,,Reseller range,
BLACKLIST,HWID,machine-7f3a,LICENSE,<license id>,Shared on a forum,2026-12-31
EXCLUSION,IP,198.51.100.23,ORG,,My office,kind, type and value are required; scope defaults to ORG; scopeId is the product or license id for PRODUCT and LICENSE scopes; expiresAt is a date (the rule stops matching at the end of that day) or a full timestamp. It's every row or none: if any row is wrong, nothing is imported and the dialog lists each row's problem (row 1 is the first line after the header). Rules you already have are skipped. Export CSV downloads your rules in the same format.
With the API
With the management API (or a personal access token in scripts):
# Block a leaked key's machine, for this license only
curl -X POST https://api.sunlicense.com/api/v1/access-rules \
-H "Authorization: Bearer $SUNLICENSE_TOKEN" -H "Content-Type: application/json" \
-d '{"kind":"BLACKLIST","type":"HWID","value":"machine-7f3a","scope":"LICENSE","scopeId":"<license id>","note":"Shared on a forum"}'
# Exclude your own address while you test
curl -s https://api.sunlicense.com/api/v1/access-rules/my-ip -H "Authorization: Bearer $SUNLICENSE_TOKEN"
curl -X POST https://api.sunlicense.com/api/v1/access-rules \
-H "Authorization: Bearer $SUNLICENSE_TOKEN" -H "Content-Type: application/json" \
-d '{"kind":"EXCLUSION","type":"IP","value":"198.51.100.23","note":"My office"}'POST /api/v1/access-rules/import takes the same rules as JSON ({ "rules": [ … ] }).
Seeing rules needs licenses.read; adding, changing and deleting them needs licenses.write, like revoking a license.
Limits
| Free | Lite | Standard | |
|---|---|---|---|
| Rules (blacklists and exclusions together, unexpired) | 10 | 500 | Unlimited |
| Country blacklist | ✓ | ✓ |
Limits only apply to adding rules. Rules you already have keep working after a downgrade.
Good to know
- Addresses are compared, never stored. The caller's IP is matched against your rules in memory and discarded; SunLicense still keeps no IP addresses of license checks (privacy policy).
- Country blocks are a soft control. A VPN or proxy changes the country a request appears to come from. Use them to stop casual resale in a region, not as a security boundary.
- Exclude an address, not a whole provider. Home connections often change address; for a developer machine a machine (HWID) exclusion is more reliable.
- Merging customers moves their customer rules to the customer that remains.
