|
| 1 | +--- |
| 2 | +title: Access Control Rules |
| 3 | +description: Configure access control rules to apply custom CAPTCHA policies based on user attributes. |
| 4 | +i18nReady: true |
| 5 | +--- |
| 6 | +import {Image} from 'astro:assets'; |
| 7 | +import AccessControlRules from '~/assets/access-control-rules.png'; |
| 8 | + |
| 9 | +Access Control Rules allow you to configure custom CAPTCHA policies for specific users or groups based on their attributes. You can increase or decrease CAPTCHA difficulty, or block access entirely, based on combinations of IP addresses, user IDs, browser fingerprints, and other identifiers. |
| 10 | + |
| 11 | +:::note[Account-Wide Rules] |
| 12 | +Access control rules are applied **account-wide** to all site keys in your account. A rule created for one site will affect CAPTCHA verification for all sites in your account. |
| 13 | +::: |
| 14 | + |
| 15 | +## Overview |
| 16 | + |
| 17 | +Access control rules evaluate incoming CAPTCHA requests against configured conditions. When a request matches a rule's conditions, the specified policy is applied instead of your site's default CAPTCHA settings. |
| 18 | + |
| 19 | +<Image src={AccessControlRules} alt={'Access Control Rules'} style="margin: 20px auto;"/> |
| 20 | + |
| 21 | +## Rule Matching |
| 22 | + |
| 23 | +### Matching Logic |
| 24 | + |
| 25 | +Rules use **AND logic** - all conditions within a rule must match for the rule to apply. Each condition specifies a field, operator, and value that must be satisfied. |
| 26 | + |
| 27 | +For example, a rule with conditions for IP address AND country code will only match requests that satisfy both conditions simultaneously. |
| 28 | + |
| 29 | +### Match Precedence |
| 30 | + |
| 31 | +When multiple rules could apply to a request, rules are matched in order of **specificity** - the number of conditions that match the request. Rules with more matching conditions take precedence over rules with fewer matching conditions. |
| 32 | + |
| 33 | +**Example:** |
| 34 | +- Rule A: IP = 1.1.1.1 AND Country = US (2 conditions) |
| 35 | +- Rule B: IP = 1.1.1.1 (1 condition) |
| 36 | + |
| 37 | +A request from IP 1.1.1.1 in the US would match Rule A because it has more matching conditions. |
| 38 | + |
| 39 | +## Conditions |
| 40 | + |
| 41 | +### Available Fields |
| 42 | + |
| 43 | +Access control rules can match on the following fields: |
| 44 | + |
| 45 | +#### IP Address |
| 46 | + |
| 47 | +Match exact IPv4 addresses. |
| 48 | + |
| 49 | +**Format:** `1.1.1.1` |
| 50 | + |
| 51 | +**Use case:** Target specific IP addresses for blocking or custom CAPTCHA policies. |
| 52 | + |
| 53 | +#### IP Mask (CIDR) |
| 54 | + |
| 55 | +Match ranges of IPv4 addresses using CIDR notation. |
| 56 | + |
| 57 | +**Format:** `1.1.1.0/24` |
| 58 | + |
| 59 | +**Example:** `192.168.1.0/24` matches all IPs from 192.168.1.0 to 192.168.1.255 |
| 60 | + |
| 61 | +**Use case:** Apply policies to entire IP ranges, such as corporate networks or VPN services. |
| 62 | + |
| 63 | +#### User ID |
| 64 | + |
| 65 | +Match specific user identifiers passed in the CAPTCHA request. |
| 66 | + |
| 67 | +**Format:** Alphanumeric string |
| 68 | + |
| 69 | +**Use case:** Apply different CAPTCHA policies to known users versus anonymous users. |
| 70 | + |
| 71 | +#### JA4 Hash |
| 72 | + |
| 73 | +Match browser fingerprints using JA4 TLS fingerprinting. |
| 74 | + |
| 75 | +**Format:** `t13d1516h2_8daaf6152771_a278895b5b6a` |
| 76 | + |
| 77 | +**Use case:** Identify and respond to specific browser/TLS configurations associated with bots or automation tools. |
| 78 | + |
| 79 | +#### User Agent |
| 80 | + |
| 81 | +Match HTTP User-Agent strings. |
| 82 | + |
| 83 | +**Format:** Full User-Agent string |
| 84 | + |
| 85 | +**Example:** `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36` |
| 86 | + |
| 87 | +**Use case:** Apply policies based on browser type, version, or operating system. |
| 88 | + |
| 89 | +#### Country Code |
| 90 | + |
| 91 | +Match requests from specific countries using ISO 3166-1 alpha-2 country codes. |
| 92 | + |
| 93 | +**Format:** Two-letter country code (e.g., `US`, `GB`, `FR`) |
| 94 | + |
| 95 | +**Use case:** Apply stricter or more lenient policies for specific geographic regions. |
| 96 | + |
| 97 | +### Operators |
| 98 | + |
| 99 | +Currently, only the **equals** operator is supported. The condition matches when the field value exactly equals the specified value. |
| 100 | + |
| 101 | +## Policies |
| 102 | + |
| 103 | +When a rule matches, one of the following policies is applied: |
| 104 | + |
| 105 | +### Block |
| 106 | + |
| 107 | +Completely blocks the request. The CAPTCHA verification will fail regardless of whether the user completes the challenge. |
| 108 | + |
| 109 | +**Use case:** Block known malicious IPs, bot networks, or abusive users. |
| 110 | + |
| 111 | +### Restrict with Custom CAPTCHA |
| 112 | + |
| 113 | +Override the site's default CAPTCHA settings with a custom configuration: |
| 114 | + |
| 115 | +#### Image CAPTCHA |
| 116 | + |
| 117 | +Require the user to solve image-based CAPTCHA challenges. |
| 118 | + |
| 119 | +**Configuration:** |
| 120 | +- **Number of rounds**: How many image challenges the user must solve (1-10) |
| 121 | + |
| 122 | +**Use case:** Apply stricter verification to suspicious traffic while allowing legitimate users to proceed. |
| 123 | + |
| 124 | +#### Proof of Work |
| 125 | + |
| 126 | +Require the user to complete a computational challenge. |
| 127 | + |
| 128 | +**Configuration:** |
| 129 | +- **Difficulty level**: Computational difficulty (1-10, higher is more difficult) |
| 130 | + |
| 131 | +**Use case:** Slow down automated requests without requiring user interaction. |
| 132 | + |
| 133 | +## Rule Expiry |
| 134 | + |
| 135 | +All rules have an expiration time. When a rule expires, it is no longer evaluated and will not affect incoming requests. |
| 136 | + |
| 137 | +**Expiry units:** |
| 138 | +- Minutes |
| 139 | +- Hours |
| 140 | +- Days |
| 141 | + |
| 142 | +**Use case:** Temporarily block an IP address during an active attack, or apply stricter policies during high-risk periods. |
| 143 | + |
| 144 | +## Configuration via Portal |
| 145 | + |
| 146 | +Access control rules can be managed through the [Prosopo Portal](https://portal.prosopo.io) in the Access Control page. The interface provides three tabs: |
| 147 | + |
| 148 | +### Editor Tab |
| 149 | + |
| 150 | +Create custom rules by: |
| 151 | +1. Adding one or more conditions (field, operator, value) |
| 152 | +2. Configuring the policy (block or custom CAPTCHA) |
| 153 | +3. Setting the expiration time |
| 154 | +4. Adding an optional description |
| 155 | + |
| 156 | +### Display Tab |
| 157 | + |
| 158 | +View all active and expired rules for your site. Rules can be deleted individually. |
| 159 | + |
| 160 | +## Examples |
| 161 | + |
| 162 | +### Block Specific IP Address |
| 163 | + |
| 164 | +**Conditions:** |
| 165 | +- IP Address equals `203.0.113.45` |
| 166 | + |
| 167 | +**Policy:** Block |
| 168 | + |
| 169 | +**Expiry:** 24 hours |
| 170 | + |
| 171 | +**Description:** Blocking detected bot IP |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +### Strict Verification for VPN Range |
| 176 | + |
| 177 | +**Conditions:** |
| 178 | +- IP Mask equals `10.8.0.0/16` |
| 179 | + |
| 180 | +**Policy:** Image CAPTCHA, 3 rounds |
| 181 | + |
| 182 | +**Expiry:** 7 days |
| 183 | + |
| 184 | +**Description:** Additional verification for VPN traffic |
| 185 | + |
| 186 | +--- |
| 187 | + |
| 188 | +### Country-Specific Policy |
| 189 | + |
| 190 | +**Conditions:** |
| 191 | +- Country Code equals `CN` |
| 192 | + |
| 193 | +**Policy:** Proof of Work, difficulty 7 |
| 194 | + |
| 195 | +**Expiry:** 30 days |
| 196 | + |
| 197 | +**Description:** PoW verification for China |
| 198 | + |
| 199 | +--- |
| 200 | + |
| 201 | +### Multi-Condition Rule |
| 202 | + |
| 203 | +**Conditions:** |
| 204 | +- Country Code equals `US` |
| 205 | +- IP Mask equals `1.1.1.0/24` |
| 206 | + |
| 207 | +**Policy:** Block |
| 208 | + |
| 209 | +**Expiry:** 1 hour |
| 210 | + |
| 211 | +**Description:** Block specific range in US during incident |
| 212 | + |
| 213 | +This rule only matches requests that satisfy both the country AND IP mask conditions. |
| 214 | + |
| 215 | +## Rule Creation Workflow |
| 216 | + |
| 217 | +1. **Navigate** to Access Control page in the portal |
| 218 | +2. **Switch** to the Editor tab |
| 219 | +3. **Add conditions** by selecting field, operator, and entering value |
| 220 | +4. **Configure policy** - choose between block or custom CAPTCHA type |
| 221 | +5. **Set expiry** - choose duration and unit |
| 222 | +6. **Add description** (optional) - explain the rule's purpose |
| 223 | +7. **Submit** the rule |
| 224 | + |
| 225 | +The rule becomes active immediately and begins evaluating incoming requests. |
| 226 | + |
| 227 | +## Rule Management |
| 228 | + |
| 229 | +### Viewing Rules |
| 230 | + |
| 231 | +The Display tab shows all rules with: |
| 232 | +- Description |
| 233 | +- Conditions (field, operator, value) |
| 234 | +- Policy details |
| 235 | +- Expiration date/time |
| 236 | +- Status (active or expired) |
| 237 | + |
| 238 | +### Deleting Rules |
| 239 | + |
| 240 | +Rules can be deleted at any time by clicking the "Delete" button on the Display tab. Deletion is immediate and cannot be undone. |
| 241 | + |
| 242 | +### Expired Rules |
| 243 | + |
| 244 | +Expired rules remain visible in the Display tab but are marked as expired. They no longer affect incoming requests. Expired rules can be deleted manually. |
| 245 | + |
| 246 | +## Use Cases |
| 247 | + |
| 248 | +### Bot Mitigation |
| 249 | + |
| 250 | +Block or restrict known bot IP addresses and user agents: |
| 251 | + |
| 252 | +```typescript |
| 253 | +// Block known bot IP |
| 254 | +IP Address equals "192.0.2.100" |
| 255 | +Policy: Block |
| 256 | +``` |
| 257 | + |
| 258 | +### Geographic Access Control |
| 259 | + |
| 260 | +Apply different policies based on geographic origin: |
| 261 | + |
| 262 | +```typescript |
| 263 | +// Stricter verification for high-risk regions |
| 264 | +Country Code equals "XX" |
| 265 | +Policy: Image CAPTCHA, 5 rounds |
| 266 | +``` |
| 267 | + |
| 268 | +### Network-Based Policies |
| 269 | + |
| 270 | +Apply policies to specific networks or organizations: |
| 271 | + |
| 272 | +```typescript |
| 273 | +// Custom policy for corporate VPN |
| 274 | +IP Mask equals "10.0.0.0/8" |
| 275 | +Policy: Proof of Work, difficulty 3 |
| 276 | +``` |
| 277 | + |
| 278 | +### Incident Response |
| 279 | + |
| 280 | +Quickly respond to active attacks: |
| 281 | + |
| 282 | +```typescript |
| 283 | +// Block attacking subnet during incident |
| 284 | +IP Mask equals "203.0.113.0/24" |
| 285 | +Policy: Block |
| 286 | +Expiry: 1 hour |
| 287 | +``` |
| 288 | + |
| 289 | +### Fingerprint-Based Detection |
| 290 | + |
| 291 | +Target specific browser fingerprints associated with automation: |
| 292 | + |
| 293 | +```typescript |
| 294 | +// Block known bot fingerprint |
| 295 | +JA4 Hash equals "t13d1516h2_8daaf6152771_a278895b5b6a" |
| 296 | +Policy: Block |
| 297 | +``` |
| 298 | + |
| 299 | +## Considerations |
| 300 | + |
| 301 | +### Account-Wide Scope |
| 302 | + |
| 303 | +Access control rules apply to **all site keys** in your account. When creating a rule, consider: |
| 304 | +- The rule will affect CAPTCHA verification for all your sites |
| 305 | +- Blocking an IP address will block it across all sites |
| 306 | +- Custom CAPTCHA policies will apply to all sites |
| 307 | +- Use appropriate conditions to avoid unintended impacts across multiple sites |
| 308 | + |
| 309 | +### Rule Limits |
| 310 | + |
| 311 | +Each site can have multiple active rules. However, a large number of rules may impact performance. Consider consolidating rules where possible using IP masks instead of individual IP addresses. |
| 312 | + |
| 313 | +### AND Logic |
| 314 | + |
| 315 | +Remember that all conditions within a rule must match. If you need to match requests that satisfy condition A OR condition B, create two separate rules. |
| 316 | + |
| 317 | +### False Positives |
| 318 | + |
| 319 | +Be cautious when creating broad rules (e.g., blocking entire countries or large IP ranges) as this may block legitimate users. Start with stricter policies (Image CAPTCHA or PoW) before resorting to complete blocks. |
| 320 | + |
| 321 | +### Testing |
| 322 | + |
| 323 | +Test rules with specific conditions before deploying broadly. Create a rule with a short expiry time and monitor its impact before extending the duration. |
| 324 | + |
| 325 | +### Expiry Management |
| 326 | + |
| 327 | +Set appropriate expiry times based on your use case: |
| 328 | +- **Minutes/Hours:** Active incidents, temporary blocks |
| 329 | +- **Days:** Known malicious sources, ongoing threats |
| 330 | +- **Review regularly:** Check and remove expired rules to keep the rules list clean |
| 331 | + |
| 332 | +## Availability |
| 333 | + |
| 334 | +Access Control Rules are available to customers with the Access Rules feature flag enabled. Contact support to enable this feature for your account. |
0 commit comments