Skip to main content

Overview

In some cases you may want to increase or reduce friction for previously fingerprinted instances. For example, manually ALLOW a user due to a false positive, or BLOCK an authentic user who violated the terms of service. You can create a rule that changes the verdict action based on fingerprint attributes. In this guide you’ll learn how to set up rules. By the end, you’ll have:
  • Called the Set Rule endpoint to apply an authorization action on a specific fingerprint.
  • Removed the rule.

Important considerations

Consider the following when setting a rule:

Verify the request

When you receive a support request to be unblocked, you should consider the risk of social engineering. Bad actors can also file support requests to try to evade your defenses, so you shouldn’t blindly set ALLOW rules based on support requests. When setting an ALLOW rule for a customer who reaches out, you should confirm that the user is a good actor and should be allowed access to your application.

Determine which identifier to use

You’ll need a fingerprint, ID, or IPGEO attribute (IP address, ASN, or country code) you want to set a rule for. These identifiers are returned by the Fingerprint Lookup endpoint for each telemetry_id. The ideal rule is precise and targets the specific users you are looking for. Consider the granularity and other characteristics to avoid setting a rule that unintentionally affects good users.
If multiple rules apply, the highest precedence wins. For example, one request matches a Visitor ID Rule to ALLOW and a Country Code Rule to BLOCK, the more-specific Visitor ID Rule wins and the verdict is ALLOW.

CIDR rule conflicts

Since CIDR block rules may conflict with each other, we have two additional rules for precedence:
  • The smallest block size takes precedence. For example, if an ip_address overlaps with a cidr_block rule of ALLOW for a block with a prefix of /32 and a cidr_block rule of BLOCK with a prefix of /24, the rule match verdict will be ALLOW.
  • Among equivalent size blocks, BLOCK takes precedence over CHALLENGE, which takes precedence over ALLOW. For example, if an ip_address overlaps with two cidr_block rules with blocks of the same size that return CHALLENGE and ALLOW, the rule match verdict will be CHALLENGE.

Validate against historical traffic

Before setting a rule on an identifier, compare the identifier against your historical traffic if available. You can look up the various fingerprint types to identify the uniqueness in the Dashboard.
  • When you search an identifier in the Device Fingerprinting Dashboard, it will show how frequently other fingerprint types have shared that identifier. You should make sure the percentage of ALLOWs isn’t too high.
  • When you create a new rule in the Dashboard, you can test the impact to check the number of changes is expected.
  • In addition to the Stytch Dashboard, you should cross-reference the identifier with your own internal monitoring to verify that the rule won’t affect other valid users. Ensure the rule targets your expected scope of users.

Prerequisites

  • An existing Stytch project in the Dashboard.
  • The project_id and secret for your project’s Test environment. These can be found under your project’s Project ID & API keys section in the Dashboard.
  • Device Fingerprinting enabled for your project.

Steps

1

Create a rule in the Dashboard

  1. Navigate to Device Fingerprinting Rules in the Dashboard.
  2. Click New rule.
  3. Enter the identifier, like a visitor_id or browser_id, or an IPGEO attribute (IP address, ASN, or country code).
  4. Set action to ALLOW, BLOCK, or CHALLENGE.
  5. (Optional) Set an expiration time and a description for the rule.
  6. Click Test rule impact and confirm the expected impact.
  7. Click Save.
2

Example rule

SetRule Dashboard Event Logs
The example above creates a rule that ensures this Visitor ID always receives a BLOCK verdict. Any future calls to the Fingerprint Lookup endpoint involving this fingerprint will automatically return a BLOCK verdict with a reason of RULE_MATCH.You also have the option of providing an expires_in_minutes parameter if you need a rule to expire after a specified lifetime. Since expires_in_minutes was omitted in our example request, the rule will be kept permanently.
3

Deleting the rule

  1. Click the Delete rule button to delete the rule.
Delete DFP Rule

Want to try Stytch Device Fingerprinting?

Find out why Stytch’s device intelligence is trusted by Calendly, Replit, and many more.