Class: ModelSecurityRulesClient
Defined in: src/model-security/security-rules-client.ts:43
Client for Model Security management plane security rule operations (read-only).
Constructors
Constructor
new ModelSecurityRulesClient(opts): ModelSecurityRulesClient;
Defined in: src/model-security/security-rules-client.ts:48
Parameters
| Parameter | Type |
|---|---|
opts | ModelSecurityRulesClientOptions |
Returns
ModelSecurityRulesClient
Methods
list()
list(opts?): Promise<objectOutputType<{
pagination: ZodObject<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">>;
rules: ZodArray<ZodObject<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<...>>;
dropdown_values: ZodOptional<ZodNullable<...>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, "passthrough", ZodTypeAny, objectOutputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">, objectInputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;
Defined in: src/model-security/security-rules-client.ts:72
List available security rules.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts? | ModelSecurityRuleListOptions | Pagination + filter options. |
Returns
Promise<objectOutputType<{
pagination: ZodObject<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">>;
rules: ZodArray<ZodObject<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<...>>;
dropdown_values: ZodOptional<ZodNullable<...>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, "passthrough", ZodTypeAny, objectOutputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">, objectInputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>
Paginated list of security rules.
Example
import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
const ms = new ModelSecurityClient();
const rules = await ms.securityRules.list({
limit: 20,
source_type: 'HUGGING_FACE',
search_query: 'pickle',
});
// rules.rules =>
// [{ uuid: '550e8400-...', name: 'Pickle Scan', rule_type: 'ARTIFACT', default_state: 'BLOCKING', ... }]
listVersions()
listVersions(opts?): Promise<objectOutputType<{
versions: ZodArray<ZodObject<{
generation: ZodNumber;
timestamp: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
generation: ZodNumber;
timestamp: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
generation: ZodNumber;
timestamp: ZodString;
}, ZodTypeAny, "passthrough">>, "many">;
pagination: ZodObject<{
next_token: ZodOptional<ZodNullable<ZodString>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
next_token: ZodOptional<ZodNullable<ZodString>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
next_token: ZodOptional<ZodNullable<ZodString>>;
}, ZodTypeAny, "passthrough">>;
}, ZodTypeAny, "passthrough">>;
Defined in: src/model-security/security-rules-client.ts:91
List security rule snapshot versions.
Parameters
| Parameter | Type |
|---|---|
opts | SnapshotVersionListOptions |
Returns
Promise<objectOutputType<{
versions: ZodArray<ZodObject<{
generation: ZodNumber;
timestamp: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
generation: ZodNumber;
timestamp: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
generation: ZodNumber;
timestamp: ZodString;
}, ZodTypeAny, "passthrough">>, "many">;
pagination: ZodObject<{
next_token: ZodOptional<ZodNullable<ZodString>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
next_token: ZodOptional<ZodNullable<ZodString>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
next_token: ZodOptional<ZodNullable<ZodString>>;
}, ZodTypeAny, "passthrough">>;
}, ZodTypeAny, "passthrough">>
Example
`const page = await ms.securityRules.listVersions({ limit: 20 });`
listAll()
listAll(opts?): Promise<objectOutputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<..., ...>>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<..., ...>>>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">[]>;
Defined in: src/model-security/security-rules-client.ts:104
List every security-rule page.
Parameters
| Parameter | Type |
|---|---|
opts | ModelSecurityRuleListAllOptions |
Returns
Promise<objectOutputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<..., ...>>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<..., ...>>>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">[]>
Example
`const rules = await ms.securityRules.listAll();`
get()
get(uuid): Promise<objectOutputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<{
value: ...;
label: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>;
Defined in: src/model-security/security-rules-client.ts:127
Get a single security rule by UUID.
Parameters
| Parameter | Type | Description |
|---|---|---|
uuid | string | Security rule UUID. |
Returns
Promise<objectOutputType<{
enabled_security_group_count: ZodOptional<ZodUnion<[ZodNumber, ZodNull]>>;
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<{
value: ...;
label: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>
The security rule.
Example
import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
const ms = new ModelSecurityClient();
const rule = await ms.securityRules.get('550e8400-e29b-41d4-a716-446655440000');
// rule =>
// { uuid: '550e8400-...', name: 'Pickle Scan', rule_type: 'ARTIFACT', default_state: 'BLOCKING', ... }