Discovery Rule πŸ†•ΒΆ


Data StructuresΒΆ

DiscoveryRuleModelΒΆ

Attribute

Type

Required

Description

id

string

Read-only. Unique identifier.

name

string

yes

Case-insensitive. Unique.

description

string

type

string {account, server}

yes

enabled

boolean; default value true

yes

category

string {privileged, nonprivileged, all}

action

string{onboard, quarantine}

yes

filter_type

string{consists, ends_with, starts_with}

with filter_value

filter_value

string

with filter_type

scanners

object-array

Read-only; expensive to use.

scanner_ids

string-array

Read-only; expensive to use; hidden.

scanner_names

string-array

Read-only; expensive to use; hidden.

created_at

datetime

Read-only. Timestamp of creation.

modified_at

datetime

Read-only. Timestamp of modification.

removed

boolean

Read-only.

builtin

boolean

Read-only; Expensive to use; If true, the object is not editable.

hidden

boolean

Read-only; Expensive to use; If true, the object is hidden in UI.

Retrieve Available Attributes of the DiscoveryRuleModelΒΆ

Request

Method

GET

Path

/api/v2/objspec/rule

GET /api/v2/objspec/rule

To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.


Get Rules ListΒΆ

Request

Method

GET

Path

/api/v2/discovery/rule

GET /api/v2/discovery/rule

Example Request

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/discovery/rule'

Response

{
    "result": "success",
    "rule": [
        {
            "id": "9115285645797883905",
            "name": "Rule_1",
            "type": "account",
            "enabled": true,
            "category": "privileged",
            "action": "onboard",
            "filter_type": "starts_with",
            "filter_value": "admin",
            "created_at": "2025-05-06 00:27:11.928953-07",
            "modified_at": "2025-05-06 00:27:11.928953-07",
            "builtin": false,
            "hidden": false
        }
    ]
}

Get Rule by IDΒΆ

Request

Method

GET

Path

/api/v2/discovery/rule

GET /api/v2/discovery/rule/<id>

Example Request

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/discovery/rule/9115285645797883905'

Response

{
    "result": "success",
    "rule": [
        {
            "id": "9115285645797883905",
            "name": "Rule_1",
            "type": "account",
            "enabled": true,
            "category": "privileged",
            "action": "onboard",
            "filter_type": "starts_with",
            "filter_value": "admin",
            "created_at": "2025-05-06 00:27:11.928953-07",
            "modified_at": "2025-05-06 00:27:11.928953-07",
            "builtin": false,
            "hidden": false
        }
    ]
}

Create RuleΒΆ

Request

Method

POST

Path

/api/v2/discovery/rule

Headers

Content-Type: application/json

Body

DiscoveryRuleModel

POST /api/v2/discovery/rule

Example Request

curl -s -k -X POST \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  -H 'Content-Type: application/json' \
  'https://10.0.214.98/api/v2/discovery/rule' \
  -d'{"name": "Rule_2","type": "account","enabled": true,"category": "privileged","action": "onboard","filter_type": "starts_with","filter_value": "admin"}'

Response

{
    "result": "success",
    "rule": {
        "id": "9115285645797883906"
    }
}

Modify RuleΒΆ

Request

Method

PATCH

Path

/api/v2/discovery/rule/<id>

Headers

Content-Type: application/json

Body

DiscoveryRuleModel

PATCH /api/v2/discovery/rule/<id>

Example Request

curl -s -k -X PATCH \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  -H 'Content-Type: application/json' \
  'https://10.0.214.98/api/v2/scanner/9115285645797883906' \
  -d'{"action":"quarantine","filter_type":"starts_with","filter_value":"fudo_admin"}'

Response

{
    "result": "success"
}

Delete RuleΒΆ

Request

Method

DELETE

Path

/api/v2/discovery/rule/<id>

DELETE /api/v2/discovery/rule/<id>

Example Request

curl -s -k -X DELETE \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/discovery/rule/9115285645797883906'

Response

{
    "result": "success"
}