Skip to main content

behavior_detection_rules

Creates, updates, deletes, gets or lists a behavior_detection_rules resource.

Overview​

Namebehavior_detection_rules
TypeResource
Idokta.behaviors.behavior_detection_rules

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Behavior Detection Rule
namestringName of the Behavior Detection Rule
_linkobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
createdstringTimestamp when the Behavior Detection Rule was created
lastUpdatedstringTimestamp when the Behavior Detection Rule was last modified
statusstring (ACTIVE, INACTIVE)
typestring (ANOMALOUS_DEVICE, ANOMALOUS_IP, ANOMALOUS_LOCATION, VELOCITY, ANOMALOUS_ASN)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_behavior_detection_ruleselectbehaviorId, subdomainRetrieves a Behavior Detection Rule by behaviorId
list_behavior_detection_rulesselectsubdomainLists all behavior detection rules with pagination support
create_behavior_detection_ruleinsertsubdomain, name, typeCreates a new behavior detection rule
replace_behavior_detection_rulereplacebehaviorId, subdomain, name, typeReplaces a Behavior Detection Rule by behaviorId
delete_behavior_detection_ruledeletebehaviorId, subdomainDeletes a Behavior Detection Rule by behaviorId
activate_behavior_detection_ruleexecbehaviorId, subdomainActivates a behavior detection rule
deactivate_behavior_detection_ruleexecbehaviorId, subdomainDeactivates a behavior detection rule

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
behaviorIdstringID of the Behavior Detection Rule
subdomainstring(default: my-org)

SELECT examples​

Retrieves a Behavior Detection Rule by behaviorId

SELECT
id,
name,
_link,
created,
lastUpdated,
status,
type
FROM okta.behaviors.behavior_detection_rules
WHERE behaviorId = '{{ behaviorId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a new behavior detection rule

INSERT INTO okta.behaviors.behavior_detection_rules (
name,
status,
type,
subdomain
)
SELECT
'{{ name }}' /* required */,
'{{ status }}',
'{{ type }}' /* required */,
'{{ subdomain }}'
RETURNING
id,
name,
_link,
created,
lastUpdated,
status,
type
;

REPLACE examples​

Replaces a Behavior Detection Rule by behaviorId

REPLACE okta.behaviors.behavior_detection_rules
SET
name = '{{ name }}',
status = '{{ status }}',
type = '{{ type }}'
WHERE
behaviorId = '{{ behaviorId }}' --required
AND subdomain = '{{ subdomain }}' --required
AND name = '{{ name }}' --required
AND type = '{{ type }}' --required
RETURNING
id,
name,
_link,
created,
lastUpdated,
status,
type;

DELETE examples​

Deletes a Behavior Detection Rule by behaviorId

DELETE FROM okta.behaviors.behavior_detection_rules
WHERE behaviorId = '{{ behaviorId }}' --required
AND subdomain = '{{ subdomain }}' --required
;

Lifecycle Methods​

Activates a behavior detection rule

EXEC okta.behaviors.behavior_detection_rules.activate_behavior_detection_rule
@behaviorId='{{ behaviorId }}' --required,
@subdomain='{{ subdomain }}' --required
;