behavior_detection_rules
Creates, updates, deletes, gets or lists a behavior_detection_rules resource.
Overview​
| Name | behavior_detection_rules |
| Type | Resource |
| Id | okta.behaviors.behavior_detection_rules |
Fields​
The following fields are returned by SELECT queries:
- get_behavior_detection_rule
- list_behavior_detection_rules
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the Behavior Detection Rule |
name | string | Name of the Behavior Detection Rule |
_link | object | Specifies 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. |
created | string | Timestamp when the Behavior Detection Rule was created |
lastUpdated | string | Timestamp when the Behavior Detection Rule was last modified |
status | string | (ACTIVE, INACTIVE) |
type | string | (ANOMALOUS_DEVICE, ANOMALOUS_IP, ANOMALOUS_LOCATION, VELOCITY, ANOMALOUS_ASN) |
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the Behavior Detection Rule |
name | string | Name of the Behavior Detection Rule |
_link | object | Specifies 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. |
created | string | Timestamp when the Behavior Detection Rule was created |
lastUpdated | string | Timestamp when the Behavior Detection Rule was last modified |
status | string | (ACTIVE, INACTIVE) |
type | string | (ANOMALOUS_DEVICE, ANOMALOUS_IP, ANOMALOUS_LOCATION, VELOCITY, ANOMALOUS_ASN) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_behavior_detection_rule | select | behaviorId, subdomain | Retrieves a Behavior Detection Rule by behaviorId | |
list_behavior_detection_rules | select | subdomain | Lists all behavior detection rules with pagination support | |
create_behavior_detection_rule | insert | subdomain, name, type | Creates a new behavior detection rule | |
replace_behavior_detection_rule | replace | behaviorId, subdomain, name, type | Replaces a Behavior Detection Rule by behaviorId | |
delete_behavior_detection_rule | delete | behaviorId, subdomain | Deletes a Behavior Detection Rule by behaviorId | |
activate_behavior_detection_rule | exec | behaviorId, subdomain | Activates a behavior detection rule | |
deactivate_behavior_detection_rule | exec | behaviorId, subdomain | Deactivates 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.
| Name | Datatype | Description |
|---|---|---|
behaviorId | string | ID of the Behavior Detection Rule |
subdomain | string | (default: my-org) |
SELECT examples​
- get_behavior_detection_rule
- list_behavior_detection_rules
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
;
Lists all behavior detection rules with pagination support
SELECT
id,
name,
_link,
created,
lastUpdated,
status,
type
FROM okta.behaviors.behavior_detection_rules
WHERE subdomain = '{{ subdomain }}' -- required
;
INSERT examples​
- create_behavior_detection_rule
- Manifest
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
;
# Description fields are for documentation purposes
- name: behavior_detection_rules
props:
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the behavior_detection_rules resource.
- name: name
value: "{{ name }}"
description: |
Name of the Behavior Detection Rule
- name: status
value: "{{ status }}"
valid_values: ['ACTIVE', 'INACTIVE']
- name: type
value: "{{ type }}"
valid_values: ['ANOMALOUS_DEVICE', 'ANOMALOUS_IP', 'ANOMALOUS_LOCATION', 'VELOCITY', 'ANOMALOUS_ASN']
REPLACE examples​
- replace_behavior_detection_rule
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​
- delete_behavior_detection_rule
Deletes a Behavior Detection Rule by behaviorId
DELETE FROM okta.behaviors.behavior_detection_rules
WHERE behaviorId = '{{ behaviorId }}' --required
AND subdomain = '{{ subdomain }}' --required
;
Lifecycle Methods​
- activate_behavior_detection_rule
- deactivate_behavior_detection_rule
Activates a behavior detection rule
EXEC okta.behaviors.behavior_detection_rules.activate_behavior_detection_rule
@behaviorId='{{ behaviorId }}' --required,
@subdomain='{{ subdomain }}' --required
;
Deactivates a behavior detection rule
EXEC okta.behaviors.behavior_detection_rules.deactivate_behavior_detection_rule
@behaviorId='{{ behaviorId }}' --required,
@subdomain='{{ subdomain }}' --required
;