@cdot65/prisma-airs-sdk 0.2.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3626 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21860 -3
- package/dist/index.d.ts +21860 -3
- package/dist/index.js +3403 -10
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
23
23
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
24
24
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
25
25
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
26
|
-
var SDK_VERSION = "0.
|
|
26
|
+
var SDK_VERSION = "0.5.0";
|
|
27
27
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
28
28
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
29
29
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -41,6 +41,41 @@ var MGMT_PROFILES_TSG_PATH = "/v1/mgmt/profiles/tsg";
|
|
|
41
41
|
var MGMT_TOPIC_PATH = "/v1/mgmt/topic";
|
|
42
42
|
var MGMT_TOPICS_TSG_PATH = "/v1/mgmt/topics/tsg";
|
|
43
43
|
var MGMT_TOPIC_FORCE_PATH = "/v1/mgmt/topic/force";
|
|
44
|
+
var DEFAULT_MODEL_SEC_DATA_ENDPOINT = "https://api.sase.paloaltonetworks.com/aims/data";
|
|
45
|
+
var DEFAULT_MODEL_SEC_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aims/mgmt";
|
|
46
|
+
var MODEL_SEC_CLIENT_ID = "PANW_MODEL_SEC_CLIENT_ID";
|
|
47
|
+
var MODEL_SEC_CLIENT_SECRET = "PANW_MODEL_SEC_CLIENT_SECRET";
|
|
48
|
+
var MODEL_SEC_TSG_ID = "PANW_MODEL_SEC_TSG_ID";
|
|
49
|
+
var MODEL_SEC_DATA_ENDPOINT = "PANW_MODEL_SEC_DATA_ENDPOINT";
|
|
50
|
+
var MODEL_SEC_MGMT_ENDPOINT = "PANW_MODEL_SEC_MGMT_ENDPOINT";
|
|
51
|
+
var MODEL_SEC_TOKEN_ENDPOINT = "PANW_MODEL_SEC_TOKEN_ENDPOINT";
|
|
52
|
+
var MODEL_SEC_SCANS_PATH = "/v1/scans";
|
|
53
|
+
var MODEL_SEC_EVALUATIONS_PATH = "/v1/evaluations";
|
|
54
|
+
var MODEL_SEC_VIOLATIONS_PATH = "/v1/violations";
|
|
55
|
+
var MODEL_SEC_SECURITY_GROUPS_PATH = "/v1/security-groups";
|
|
56
|
+
var MODEL_SEC_SECURITY_RULES_PATH = "/v1/security-rules";
|
|
57
|
+
var MODEL_SEC_PYPI_AUTH_PATH = "/v1/pypi/authenticate";
|
|
58
|
+
var DEFAULT_RED_TEAM_DATA_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/data-plane";
|
|
59
|
+
var DEFAULT_RED_TEAM_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/ai-red-teaming/mgmt-plane";
|
|
60
|
+
var RED_TEAM_CLIENT_ID = "PANW_RED_TEAM_CLIENT_ID";
|
|
61
|
+
var RED_TEAM_CLIENT_SECRET = "PANW_RED_TEAM_CLIENT_SECRET";
|
|
62
|
+
var RED_TEAM_TSG_ID = "PANW_RED_TEAM_TSG_ID";
|
|
63
|
+
var RED_TEAM_DATA_ENDPOINT = "PANW_RED_TEAM_DATA_ENDPOINT";
|
|
64
|
+
var RED_TEAM_MGMT_ENDPOINT = "PANW_RED_TEAM_MGMT_ENDPOINT";
|
|
65
|
+
var RED_TEAM_TOKEN_ENDPOINT = "PANW_RED_TEAM_TOKEN_ENDPOINT";
|
|
66
|
+
var RED_TEAM_SCAN_PATH = "/v1/scan";
|
|
67
|
+
var RED_TEAM_CATEGORIES_PATH = "/v1/categories";
|
|
68
|
+
var RED_TEAM_REPORT_STATIC_PATH = "/v1/report/static";
|
|
69
|
+
var RED_TEAM_REPORT_DYNAMIC_PATH = "/v1/report/dynamic";
|
|
70
|
+
var RED_TEAM_REPORT_PATH = "/v1/report";
|
|
71
|
+
var RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH = "/v1/custom-attacks";
|
|
72
|
+
var RED_TEAM_DASHBOARD_PATH = "/v1/dashboard";
|
|
73
|
+
var RED_TEAM_QUOTA_PATH = "/v1/metering/quota";
|
|
74
|
+
var RED_TEAM_ERROR_LOG_PATH = "/v1/error-log/job";
|
|
75
|
+
var RED_TEAM_SENTIMENT_PATH = "/v1/sentiment";
|
|
76
|
+
var RED_TEAM_TARGET_PATH = "/v1/target";
|
|
77
|
+
var RED_TEAM_CUSTOM_ATTACK_PATH = "/v1/custom-attack";
|
|
78
|
+
var RED_TEAM_MGMT_DASHBOARD_PATH = "/v1/dashboard/overview";
|
|
44
79
|
|
|
45
80
|
// src/errors.ts
|
|
46
81
|
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
@@ -875,22 +910,1413 @@ var DeleteTopicConflictSchema = z16.object({
|
|
|
875
910
|
)
|
|
876
911
|
}).passthrough();
|
|
877
912
|
|
|
878
|
-
// src/models/
|
|
913
|
+
// src/models/model-security-enums.ts
|
|
914
|
+
var ErrorCodes = {
|
|
915
|
+
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
916
|
+
SCAN_ERROR: "SCAN_ERROR",
|
|
917
|
+
INVALID_RESPONSE: "INVALID_RESPONSE",
|
|
918
|
+
ACCESS_DENIED: "ACCESS_DENIED",
|
|
919
|
+
MISSING_CREDENTIALS: "MISSING_CREDENTIALS",
|
|
920
|
+
NO_SUCH_KEY: "NO_SUCH_KEY",
|
|
921
|
+
NO_SUCH_BUCKET: "NO_SUCH_BUCKET",
|
|
922
|
+
INVALID_BUCKET_NAME: "INVALID_BUCKET_NAME",
|
|
923
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
924
|
+
SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE",
|
|
925
|
+
INVALID_OBJECT_STATE: "INVALID_OBJECT_STATE",
|
|
926
|
+
UNKNOWN_REMOTE_SERVICE_ERROR: "UNKNOWN_REMOTE_SERVICE_ERROR",
|
|
927
|
+
UNSUPPORTED_REMOTE_STORAGE: "UNSUPPORTED_REMOTE_STORAGE",
|
|
928
|
+
MISSING_ARTIFACTS: "MISSING_ARTIFACTS",
|
|
929
|
+
WORKER_ERROR: "WORKER_ERROR",
|
|
930
|
+
POLICY_EVAL_ERROR: "POLICY_EVAL_ERROR"
|
|
931
|
+
};
|
|
932
|
+
var EvalOutcome = {
|
|
933
|
+
PENDING: "PENDING",
|
|
934
|
+
ALLOWED: "ALLOWED",
|
|
935
|
+
BLOCKED: "BLOCKED",
|
|
936
|
+
ERROR: "ERROR"
|
|
937
|
+
};
|
|
938
|
+
var FileScanResult = {
|
|
939
|
+
SKIPPED: "SKIPPED",
|
|
940
|
+
SUCCESS: "SUCCESS",
|
|
941
|
+
ERROR: "ERROR",
|
|
942
|
+
FAILED: "FAILED"
|
|
943
|
+
};
|
|
944
|
+
var FileType = {
|
|
945
|
+
DIRECTORY: "DIRECTORY",
|
|
946
|
+
FILE: "FILE"
|
|
947
|
+
};
|
|
948
|
+
var ModelScanStatus = {
|
|
949
|
+
SCANNED: "SCANNED",
|
|
950
|
+
SKIPPED: "SKIPPED",
|
|
951
|
+
ERROR: "ERROR"
|
|
952
|
+
};
|
|
953
|
+
var RuleEvaluationResult = {
|
|
954
|
+
PASSED: "PASSED",
|
|
955
|
+
FAILED: "FAILED",
|
|
956
|
+
ERROR: "ERROR"
|
|
957
|
+
};
|
|
958
|
+
var RuleState = {
|
|
959
|
+
DISABLED: "DISABLED",
|
|
960
|
+
ALLOWING: "ALLOWING",
|
|
961
|
+
BLOCKING: "BLOCKING"
|
|
962
|
+
};
|
|
963
|
+
var ScanOrigin = {
|
|
964
|
+
MODEL_SECURITY_SDK: "MODEL_SECURITY_SDK",
|
|
965
|
+
HUGGING_FACE: "HUGGING_FACE"
|
|
966
|
+
};
|
|
967
|
+
var SortByDateField = {
|
|
968
|
+
CREATED_AT: "created_at",
|
|
969
|
+
UPDATED_AT: "updated_at"
|
|
970
|
+
};
|
|
971
|
+
var SortByFileField = {
|
|
972
|
+
PATH: "path",
|
|
973
|
+
TYPE: "type"
|
|
974
|
+
};
|
|
975
|
+
var SortDirection = {
|
|
976
|
+
ASC: "asc",
|
|
977
|
+
DESC: "desc"
|
|
978
|
+
};
|
|
979
|
+
var SourceType = {
|
|
980
|
+
LOCAL: "LOCAL",
|
|
981
|
+
HUGGING_FACE: "HUGGING_FACE",
|
|
982
|
+
S3: "S3",
|
|
983
|
+
GCS: "GCS",
|
|
984
|
+
AZURE: "AZURE",
|
|
985
|
+
ARTIFACTORY: "ARTIFACTORY",
|
|
986
|
+
GITLAB: "GITLAB",
|
|
987
|
+
ALL: "ALL"
|
|
988
|
+
};
|
|
989
|
+
var ThreatCategory = {
|
|
990
|
+
PAIT_ARV_100: "PAIT-ARV-100",
|
|
991
|
+
PAIT_GGUF_100: "PAIT-GGUF-100",
|
|
992
|
+
PAIT_GGUF_101: "PAIT-GGUF-101",
|
|
993
|
+
PAIT_KERAS_100: "PAIT-KERAS-100",
|
|
994
|
+
PAIT_KERAS_101: "PAIT-KERAS-101",
|
|
995
|
+
PAIT_KERAS_102: "PAIT-KERAS-102",
|
|
996
|
+
PAIT_JOBLIB_100: "PAIT-JOBLIB-100",
|
|
997
|
+
PAIT_JOBLIB_101: "PAIT-JOBLIB-101",
|
|
998
|
+
PAIT_PKL_100: "PAIT-PKL-100",
|
|
999
|
+
PAIT_PKL_101: "PAIT-PKL-101",
|
|
1000
|
+
PAIT_PYTCH_100: "PAIT-PYTCH-100",
|
|
1001
|
+
PAIT_PYTCH_101: "PAIT-PYTCH-101",
|
|
1002
|
+
PAIT_EXDIR_100: "PAIT-EXDIR-100",
|
|
1003
|
+
PAIT_EXDIR_101: "PAIT-EXDIR-101",
|
|
1004
|
+
PAIT_ONNX_200: "PAIT-ONNX-200",
|
|
1005
|
+
PAIT_TF_200: "PAIT-TF-200",
|
|
1006
|
+
PAIT_LMAFL_300: "PAIT-LMAFL-300",
|
|
1007
|
+
PAIT_LITERT_300: "PAIT-LITERT-300",
|
|
1008
|
+
PAIT_LITERT_301: "PAIT-LITERT-301",
|
|
1009
|
+
PAIT_LITERT_302: "PAIT-LITERT-302",
|
|
1010
|
+
PAIT_KERAS_300: "PAIT-KERAS-300",
|
|
1011
|
+
PAIT_KERAS_301: "PAIT-KERAS-301",
|
|
1012
|
+
PAIT_TCHST_300: "PAIT-TCHST-300",
|
|
1013
|
+
PAIT_TCHST_301: "PAIT-TCHST-301",
|
|
1014
|
+
PAIT_TF_300: "PAIT-TF-300",
|
|
1015
|
+
PAIT_TF_301: "PAIT-TF-301",
|
|
1016
|
+
PAIT_TF_302: "PAIT-TF-302",
|
|
1017
|
+
PAIT_TMT_300: "PAIT-TMT-300",
|
|
1018
|
+
PAIT_TMT_301: "PAIT-TMT-301",
|
|
1019
|
+
UNAPPROVED_FORMATS: "UNAPPROVED_FORMATS"
|
|
1020
|
+
};
|
|
1021
|
+
var ModelSecurityGroupState = {
|
|
1022
|
+
PENDING: "PENDING",
|
|
1023
|
+
ACTIVE: "ACTIVE"
|
|
1024
|
+
};
|
|
1025
|
+
var RuleType = {
|
|
1026
|
+
METADATA: "METADATA",
|
|
1027
|
+
ARTIFACT: "ARTIFACT"
|
|
1028
|
+
};
|
|
1029
|
+
var RuleEditableFieldType = {
|
|
1030
|
+
SELECT: "SELECT",
|
|
1031
|
+
LIST: "LIST"
|
|
1032
|
+
};
|
|
1033
|
+
var RuleFieldValueKey = {
|
|
1034
|
+
APPROVED_FORMATS: "approved_formats",
|
|
1035
|
+
APPROVED_LOCATIONS: "approved_locations",
|
|
1036
|
+
APPROVED_LICENSES: "approved_licenses",
|
|
1037
|
+
DENY_ORGS: "deny_orgs",
|
|
1038
|
+
DENIED_ORG_MODELS: "denied_org_models",
|
|
1039
|
+
APPROVED_ORG_MODELS: "approved_org_models"
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
// src/models/model-security.ts
|
|
879
1043
|
import { z as z17 } from "zod";
|
|
880
|
-
var
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1044
|
+
var ModelSecurityPaginationSchema = z17.object({
|
|
1045
|
+
total_items: z17.number().int().nullable().optional()
|
|
1046
|
+
}).passthrough();
|
|
1047
|
+
var LabelSchema = z17.object({
|
|
1048
|
+
key: z17.string(),
|
|
1049
|
+
value: z17.string()
|
|
1050
|
+
});
|
|
1051
|
+
var LabelsCreateRequestSchema = z17.object({
|
|
1052
|
+
labels: z17.array(LabelSchema)
|
|
1053
|
+
});
|
|
1054
|
+
var LabelsResponseSchema = z17.object({}).passthrough();
|
|
1055
|
+
var LabelKeyListSchema = z17.object({
|
|
1056
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1057
|
+
keys: z17.array(z17.string())
|
|
1058
|
+
}).passthrough();
|
|
1059
|
+
var LabelValueListSchema = z17.object({
|
|
1060
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1061
|
+
values: z17.array(z17.string())
|
|
1062
|
+
}).passthrough();
|
|
1063
|
+
var EvalSummarySchema = z17.object({
|
|
1064
|
+
rules_failed: z17.number().int().optional().default(0),
|
|
1065
|
+
rules_passed: z17.number().int().optional().default(0),
|
|
1066
|
+
total_rules: z17.number().int().optional().default(0)
|
|
1067
|
+
}).passthrough();
|
|
1068
|
+
var ModelScanIssueSchema = z17.object({
|
|
1069
|
+
description: z17.string(),
|
|
1070
|
+
source: z17.string(),
|
|
1071
|
+
threat: z17.string().nullable().optional(),
|
|
1072
|
+
module: z17.string().nullable().optional(),
|
|
1073
|
+
operator: z17.string().nullable().optional()
|
|
1074
|
+
}).passthrough();
|
|
1075
|
+
var FileScanDataSchema = z17.object({
|
|
1076
|
+
file_path: z17.string(),
|
|
1077
|
+
modelscan_status: z17.string(),
|
|
1078
|
+
blob_id: z17.string(),
|
|
1079
|
+
error_message: z17.string().nullable().optional(),
|
|
1080
|
+
formats: z17.array(z17.string()).nullable().optional(),
|
|
1081
|
+
issues_detected: z17.array(ModelScanIssueSchema).nullable().optional()
|
|
1082
|
+
}).passthrough();
|
|
1083
|
+
var ScanDetailsSchema = z17.object({
|
|
1084
|
+
scanner_version: z17.string(),
|
|
1085
|
+
time_started: z17.string(),
|
|
1086
|
+
files: z17.array(FileScanDataSchema),
|
|
1087
|
+
total_files_scanned: z17.number().int(),
|
|
1088
|
+
total_files_skipped: z17.number().int(),
|
|
1089
|
+
model_formats: z17.array(z17.string()),
|
|
1090
|
+
model_size_bytes: z17.number().int(),
|
|
1091
|
+
scan_duration_ms: z17.number().int(),
|
|
1092
|
+
error_code: z17.string().nullable().optional(),
|
|
1093
|
+
error_message: z17.string().nullable().optional()
|
|
1094
|
+
});
|
|
1095
|
+
var ScanCreateRequestSchema = z17.object({
|
|
1096
|
+
model_uri: z17.string(),
|
|
1097
|
+
security_group_uuid: z17.string(),
|
|
1098
|
+
scan_origin: z17.string(),
|
|
1099
|
+
allow_patterns: z17.array(z17.string()).nullable().optional(),
|
|
1100
|
+
ignore_patterns: z17.array(z17.string()).nullable().optional(),
|
|
1101
|
+
labels: z17.array(LabelSchema).nullable().optional(),
|
|
1102
|
+
model_author: z17.string().nullable().optional(),
|
|
1103
|
+
model_name: z17.string().nullable().optional(),
|
|
1104
|
+
model_version: z17.string().nullable().optional(),
|
|
1105
|
+
scan_details: ScanDetailsSchema.nullable().optional()
|
|
1106
|
+
});
|
|
1107
|
+
var ScanBaseResponseSchema = z17.object({
|
|
1108
|
+
uuid: z17.string(),
|
|
1109
|
+
tsg_id: z17.string(),
|
|
1110
|
+
created_at: z17.string(),
|
|
1111
|
+
updated_at: z17.string(),
|
|
1112
|
+
model_uri: z17.string(),
|
|
1113
|
+
owner: z17.string(),
|
|
1114
|
+
scan_origin: z17.string(),
|
|
1115
|
+
security_group_uuid: z17.string(),
|
|
1116
|
+
security_group_name: z17.string(),
|
|
1117
|
+
model_version_uuid: z17.string(),
|
|
1118
|
+
eval_outcome: z17.string(),
|
|
1119
|
+
source_type: z17.string(),
|
|
1120
|
+
created_by: z17.string().nullable().optional(),
|
|
1121
|
+
enabled_rule_count_snapshot: z17.number().int().nullable().optional(),
|
|
1122
|
+
error_code: z17.string().nullable().optional(),
|
|
1123
|
+
error_message: z17.string().nullable().optional(),
|
|
1124
|
+
eval_summary: EvalSummarySchema.nullable().optional(),
|
|
1125
|
+
labels: z17.array(LabelSchema).optional(),
|
|
1126
|
+
model_formats: z17.array(z17.string()).nullable().optional(),
|
|
1127
|
+
scanner_version: z17.string().nullable().optional(),
|
|
1128
|
+
time_started: z17.string().nullable().optional(),
|
|
1129
|
+
total_files_scanned: z17.number().int().nullable().optional(),
|
|
1130
|
+
total_files_skipped: z17.number().int().nullable().optional()
|
|
1131
|
+
}).passthrough();
|
|
1132
|
+
var ScanListSchema = z17.object({
|
|
1133
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1134
|
+
scans: z17.array(ScanBaseResponseSchema)
|
|
1135
|
+
}).passthrough();
|
|
1136
|
+
var FileResponseSchema = z17.object({
|
|
1137
|
+
uuid: z17.string(),
|
|
1138
|
+
tsg_id: z17.string(),
|
|
1139
|
+
created_at: z17.string(),
|
|
1140
|
+
updated_at: z17.string(),
|
|
1141
|
+
path: z17.string(),
|
|
1142
|
+
parent_path: z17.string(),
|
|
1143
|
+
type: z17.string(),
|
|
1144
|
+
result: z17.string(),
|
|
1145
|
+
model_version_uuid: z17.string(),
|
|
1146
|
+
blob_id: z17.string().nullable().optional(),
|
|
1147
|
+
formats: z17.array(z17.string()).nullable().optional(),
|
|
1148
|
+
scan_uuid: z17.string().nullable().optional()
|
|
1149
|
+
}).passthrough();
|
|
1150
|
+
var FileListSchema = z17.object({
|
|
1151
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1152
|
+
files: z17.array(FileResponseSchema)
|
|
1153
|
+
}).passthrough();
|
|
1154
|
+
var RuleEvaluationResponseSchema = z17.object({
|
|
1155
|
+
uuid: z17.string(),
|
|
1156
|
+
tsg_id: z17.string(),
|
|
1157
|
+
created_at: z17.string(),
|
|
1158
|
+
updated_at: z17.string(),
|
|
1159
|
+
result: z17.string(),
|
|
1160
|
+
violation_count: z17.number().int(),
|
|
1161
|
+
rule_instance_uuid: z17.string(),
|
|
1162
|
+
scan_uuid: z17.string(),
|
|
1163
|
+
rule_name: z17.string(),
|
|
1164
|
+
rule_description: z17.string(),
|
|
1165
|
+
rule_instance_state: z17.string()
|
|
1166
|
+
}).passthrough();
|
|
1167
|
+
var RuleEvaluationListSchema = z17.object({
|
|
1168
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1169
|
+
evaluations: z17.array(RuleEvaluationResponseSchema)
|
|
1170
|
+
}).passthrough();
|
|
1171
|
+
var ViolationResponseSchema = z17.object({
|
|
1172
|
+
uuid: z17.string(),
|
|
1173
|
+
tsg_id: z17.string(),
|
|
1174
|
+
created_at: z17.string(),
|
|
1175
|
+
updated_at: z17.string(),
|
|
1176
|
+
description: z17.string(),
|
|
1177
|
+
rule_instance_uuid: z17.string(),
|
|
1178
|
+
rule_name: z17.string(),
|
|
1179
|
+
rule_description: z17.string(),
|
|
1180
|
+
rule_instance_state: z17.string(),
|
|
1181
|
+
file: z17.string().nullable().optional(),
|
|
1182
|
+
hash: z17.string().nullable().optional(),
|
|
1183
|
+
module: z17.string().nullable().optional(),
|
|
1184
|
+
operator: z17.string().nullable().optional(),
|
|
1185
|
+
threat: z17.string().nullable().optional(),
|
|
1186
|
+
threat_description: z17.string().nullable().optional()
|
|
1187
|
+
}).passthrough();
|
|
1188
|
+
var ViolationListSchema = z17.object({
|
|
1189
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1190
|
+
violations: z17.array(ViolationResponseSchema)
|
|
1191
|
+
}).passthrough();
|
|
1192
|
+
var RuleEditableFieldDropdownSchema = z17.object({
|
|
1193
|
+
value: z17.string(),
|
|
1194
|
+
label: z17.string()
|
|
1195
|
+
}).passthrough();
|
|
1196
|
+
var RuleEditableFieldSchema = z17.object({
|
|
1197
|
+
attribute_name: z17.string(),
|
|
1198
|
+
type: z17.string(),
|
|
1199
|
+
display_name: z17.string(),
|
|
1200
|
+
display_type: z17.string(),
|
|
1201
|
+
description: z17.string().nullable().optional(),
|
|
1202
|
+
dropdown_values: z17.array(RuleEditableFieldDropdownSchema).nullable().optional()
|
|
1203
|
+
}).passthrough();
|
|
1204
|
+
var RuleRemediationSchema = z17.object({
|
|
1205
|
+
description: z17.string(),
|
|
1206
|
+
steps: z17.array(z17.string()),
|
|
1207
|
+
url: z17.string()
|
|
1208
|
+
}).passthrough();
|
|
1209
|
+
var RuleConfigurationSchema = z17.object({
|
|
1210
|
+
field_values: z17.record(z17.unknown()).optional(),
|
|
1211
|
+
state: z17.string().nullable().optional()
|
|
1212
|
+
}).passthrough();
|
|
1213
|
+
var ModelSecurityRuleResponseSchema = z17.object({
|
|
1214
|
+
uuid: z17.string(),
|
|
1215
|
+
name: z17.string(),
|
|
1216
|
+
description: z17.string(),
|
|
1217
|
+
rule_type: z17.string(),
|
|
1218
|
+
compatible_sources: z17.array(z17.string()),
|
|
1219
|
+
default_state: z17.string(),
|
|
1220
|
+
remediation: RuleRemediationSchema,
|
|
1221
|
+
editable_fields: z17.array(RuleEditableFieldSchema),
|
|
1222
|
+
constant_values: z17.record(z17.unknown()),
|
|
1223
|
+
default_values: z17.record(z17.unknown())
|
|
1224
|
+
}).passthrough();
|
|
1225
|
+
var ListModelSecurityRulesResponseSchema = z17.object({
|
|
1226
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1227
|
+
rules: z17.array(ModelSecurityRuleResponseSchema)
|
|
1228
|
+
}).passthrough();
|
|
1229
|
+
var ModelSecurityRuleInstanceResponseSchema = z17.object({
|
|
1230
|
+
uuid: z17.string(),
|
|
1231
|
+
tsg_id: z17.string(),
|
|
1232
|
+
created_at: z17.string(),
|
|
1233
|
+
updated_at: z17.string(),
|
|
1234
|
+
security_group_uuid: z17.string(),
|
|
1235
|
+
security_rule_uuid: z17.string(),
|
|
1236
|
+
state: z17.string(),
|
|
1237
|
+
rule: ModelSecurityRuleResponseSchema,
|
|
1238
|
+
field_values: z17.record(z17.unknown()).optional()
|
|
1239
|
+
}).passthrough();
|
|
1240
|
+
var ModelSecurityRuleInstanceUpdateRequestSchema = z17.object({
|
|
1241
|
+
security_group_uuid: z17.string(),
|
|
1242
|
+
state: z17.string().nullable().optional(),
|
|
1243
|
+
field_values: z17.record(z17.unknown()).nullable().optional()
|
|
1244
|
+
});
|
|
1245
|
+
var ListModelSecurityRuleInstancesResponseSchema = z17.object({
|
|
1246
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1247
|
+
rule_instances: z17.array(ModelSecurityRuleInstanceResponseSchema)
|
|
1248
|
+
}).passthrough();
|
|
1249
|
+
var ModelSecurityGroupCreateRequestSchema = z17.object({
|
|
1250
|
+
name: z17.string(),
|
|
1251
|
+
source_type: z17.string(),
|
|
1252
|
+
description: z17.string().optional().default(""),
|
|
1253
|
+
rule_configurations: z17.record(RuleConfigurationSchema).optional()
|
|
1254
|
+
});
|
|
1255
|
+
var ModelSecurityGroupResponseSchema = z17.object({
|
|
1256
|
+
uuid: z17.string(),
|
|
1257
|
+
tsg_id: z17.string(),
|
|
1258
|
+
created_at: z17.string(),
|
|
1259
|
+
updated_at: z17.string(),
|
|
1260
|
+
name: z17.string(),
|
|
1261
|
+
description: z17.string(),
|
|
1262
|
+
source_type: z17.string(),
|
|
1263
|
+
state: z17.string(),
|
|
1264
|
+
is_tombstone: z17.boolean()
|
|
1265
|
+
}).passthrough();
|
|
1266
|
+
var ModelSecurityGroupUpdateRequestSchema = z17.object({
|
|
1267
|
+
name: z17.string().nullable().optional(),
|
|
1268
|
+
description: z17.string().nullable().optional()
|
|
1269
|
+
});
|
|
1270
|
+
var ListModelSecurityGroupsResponseSchema = z17.object({
|
|
1271
|
+
pagination: ModelSecurityPaginationSchema,
|
|
1272
|
+
security_groups: z17.array(ModelSecurityGroupResponseSchema)
|
|
1273
|
+
}).passthrough();
|
|
1274
|
+
var PyPIAuthResponseSchema = z17.object({
|
|
1275
|
+
url: z17.string(),
|
|
1276
|
+
expires_at: z17.string()
|
|
1277
|
+
}).passthrough();
|
|
1278
|
+
|
|
1279
|
+
// src/models/red-team-enums.ts
|
|
1280
|
+
var ApiEndpointType = {
|
|
1281
|
+
PUBLIC: "PUBLIC",
|
|
1282
|
+
PRIVATE: "PRIVATE",
|
|
1283
|
+
NETWORK_BROKER: "NETWORK_BROKER"
|
|
1284
|
+
};
|
|
1285
|
+
var AttackStatus = {
|
|
1286
|
+
INIT: "INIT",
|
|
1287
|
+
ATTACK: "ATTACK",
|
|
1288
|
+
DETECTION: "DETECTION",
|
|
1289
|
+
REPORT: "REPORT",
|
|
1290
|
+
COMPLETED: "COMPLETED",
|
|
1291
|
+
FAILED: "FAILED"
|
|
1292
|
+
};
|
|
1293
|
+
var AttackType = {
|
|
1294
|
+
NORMAL: "NORMAL",
|
|
1295
|
+
CUSTOM: "CUSTOM"
|
|
1296
|
+
};
|
|
1297
|
+
var AuthType = {
|
|
1298
|
+
OAUTH: "OAUTH",
|
|
1299
|
+
ACCESS_TOKEN: "ACCESS_TOKEN"
|
|
1300
|
+
};
|
|
1301
|
+
var BrandSubCategory = {
|
|
1302
|
+
COMPETITOR_ENDORSEMENTS: "COMPETITOR_ENDORSEMENTS",
|
|
1303
|
+
BRAND_TARNISHING_SELF_CRITICISM: "BRAND_TARNISHING_SELF_CRITICISM",
|
|
1304
|
+
DISCRIMINATING_CLAIMS: "DISCRIMINATING_CLAIMS",
|
|
1305
|
+
POLITICAL_ENDORSEMENTS: "POLITICAL_ENDORSEMENTS"
|
|
1306
|
+
};
|
|
1307
|
+
var ComplianceSubCategory = {
|
|
1308
|
+
OWASP: "OWASP",
|
|
1309
|
+
MITRE_ATLAS: "MITRE_ATLAS",
|
|
1310
|
+
NIST: "NIST",
|
|
1311
|
+
DASF_V2: "DASF_V2"
|
|
1312
|
+
};
|
|
1313
|
+
var CountedQuotaEnum = {
|
|
1314
|
+
HELD: "HELD",
|
|
1315
|
+
COUNTED: "COUNTED",
|
|
1316
|
+
NOT_COUNTED: "NOT_COUNTED"
|
|
1317
|
+
};
|
|
1318
|
+
var DateRangeFilter = {
|
|
1319
|
+
LAST_7_DAYS: "LAST_7_DAYS",
|
|
1320
|
+
LAST_15_DAYS: "LAST_15_DAYS",
|
|
1321
|
+
LAST_30_DAYS: "LAST_30_DAYS",
|
|
1322
|
+
ALL: "ALL"
|
|
1323
|
+
};
|
|
1324
|
+
var ErrorSource = {
|
|
1325
|
+
TARGET: "TARGET",
|
|
1326
|
+
JOB: "JOB",
|
|
1327
|
+
SYSTEM: "SYSTEM",
|
|
1328
|
+
VALIDATION: "VALIDATION",
|
|
1329
|
+
TARGET_PROFILING: "TARGET_PROFILING"
|
|
1330
|
+
};
|
|
1331
|
+
var RedTeamErrorType = {
|
|
1332
|
+
CONTENT_FILTER: "CONTENT_FILTER",
|
|
1333
|
+
RATE_LIMIT: "RATE_LIMIT",
|
|
1334
|
+
AUTHENTICATION: "AUTHENTICATION",
|
|
1335
|
+
NETWORK: "NETWORK",
|
|
1336
|
+
VALIDATION: "VALIDATION",
|
|
1337
|
+
NETWORK_CHANNEL: "NETWORK_CHANNEL",
|
|
1338
|
+
UNKNOWN: "UNKNOWN"
|
|
1339
|
+
};
|
|
1340
|
+
var FileFormat = {
|
|
1341
|
+
CSV: "CSV",
|
|
1342
|
+
JSON: "JSON",
|
|
1343
|
+
ALL: "ALL"
|
|
1344
|
+
};
|
|
1345
|
+
var GoalType = {
|
|
1346
|
+
BASE: "BASE",
|
|
1347
|
+
TOOL_MISUSE: "TOOL_MISUSE",
|
|
1348
|
+
GOAL_MANIPULATION: "GOAL_MANIPULATION"
|
|
1349
|
+
};
|
|
1350
|
+
var GoalTypeQueryParam = {
|
|
1351
|
+
AGENT: "AGENT",
|
|
1352
|
+
HUMAN_AUGMENTED: "HUMAN_AUGMENTED"
|
|
1353
|
+
};
|
|
1354
|
+
var GuardrailAction = {
|
|
1355
|
+
ALLOW: "ALLOW",
|
|
1356
|
+
BLOCK: "BLOCK"
|
|
1357
|
+
};
|
|
1358
|
+
var JobStatus = {
|
|
1359
|
+
INIT: "INIT",
|
|
1360
|
+
QUEUED: "QUEUED",
|
|
1361
|
+
RUNNING: "RUNNING",
|
|
1362
|
+
COMPLETED: "COMPLETED",
|
|
1363
|
+
PARTIALLY_COMPLETE: "PARTIALLY_COMPLETE",
|
|
1364
|
+
FAILED: "FAILED",
|
|
1365
|
+
ABORTED: "ABORTED"
|
|
1366
|
+
};
|
|
1367
|
+
var JobStatusFilter = {
|
|
1368
|
+
QUEUED: "QUEUED",
|
|
1369
|
+
RUNNING: "RUNNING",
|
|
1370
|
+
COMPLETED: "COMPLETED",
|
|
1371
|
+
PARTIALLY_COMPLETE: "PARTIALLY_COMPLETE",
|
|
1372
|
+
FAILED: "FAILED",
|
|
1373
|
+
ABORTED: "ABORTED"
|
|
1374
|
+
};
|
|
1375
|
+
var JobType = {
|
|
1376
|
+
STATIC: "STATIC",
|
|
1377
|
+
DYNAMIC: "DYNAMIC",
|
|
1378
|
+
CUSTOM: "CUSTOM"
|
|
1379
|
+
};
|
|
1380
|
+
var PolicyType = {
|
|
1381
|
+
PROMPT_INJECTION: "PROMPT_INJECTION",
|
|
1382
|
+
TOXIC_CONTENT: "TOXIC_CONTENT",
|
|
1383
|
+
CUSTOM_TOPIC_GUARDRAILS: "CUSTOM_TOPIC_GUARDRAILS",
|
|
1384
|
+
MALICIOUS_CODE_DETECTION: "MALICIOUS_CODE_DETECTION",
|
|
1385
|
+
MALICIOUS_URL_DETECTION: "MALICIOUS_URL_DETECTION",
|
|
1386
|
+
SENSITIVE_DATA_PROTECTION: "SENSITIVE_DATA_PROTECTION"
|
|
1387
|
+
};
|
|
1388
|
+
var ProfilingStatus = {
|
|
1389
|
+
INIT: "INIT",
|
|
1390
|
+
QUEUED: "QUEUED",
|
|
1391
|
+
IN_PROGRESS: "IN_PROGRESS",
|
|
1392
|
+
COMPLETED: "COMPLETED",
|
|
1393
|
+
FAILED: "FAILED"
|
|
1394
|
+
};
|
|
1395
|
+
var RedTeamCategory = {
|
|
1396
|
+
SECURITY: "SECURITY",
|
|
1397
|
+
SAFETY: "SAFETY",
|
|
1398
|
+
COMPLIANCE: "COMPLIANCE",
|
|
1399
|
+
BRAND: "BRAND"
|
|
1400
|
+
};
|
|
1401
|
+
var ResponseMode = {
|
|
1402
|
+
REST: "REST",
|
|
1403
|
+
STREAMING: "STREAMING"
|
|
1404
|
+
};
|
|
1405
|
+
var RiskRating = {
|
|
1406
|
+
LOW: "LOW",
|
|
1407
|
+
MEDIUM: "MEDIUM",
|
|
1408
|
+
HIGH: "HIGH",
|
|
1409
|
+
CRITICAL: "CRITICAL"
|
|
1410
|
+
};
|
|
1411
|
+
var SafetySubCategory = {
|
|
1412
|
+
BIAS: "BIAS",
|
|
1413
|
+
CBRN: "CBRN",
|
|
1414
|
+
CYBERCRIME: "CYBERCRIME",
|
|
1415
|
+
DRUGS: "DRUGS",
|
|
1416
|
+
HATE_TOXIC_ABUSE: "HATE_TOXIC_ABUSE",
|
|
1417
|
+
NON_VIOLENT_CRIMES: "NON_VIOLENT_CRIMES",
|
|
1418
|
+
POLITICAL: "POLITICAL",
|
|
1419
|
+
SELF_HARM: "SELF_HARM",
|
|
1420
|
+
SEXUAL: "SEXUAL",
|
|
1421
|
+
VIOLENT_CRIMES_WEAPONS: "VIOLENT_CRIMES_WEAPONS"
|
|
1422
|
+
};
|
|
1423
|
+
var SecuritySubCategory = {
|
|
1424
|
+
ADVERSARIAL_SUFFIX: "ADVERSARIAL_SUFFIX",
|
|
1425
|
+
EVASION: "EVASION",
|
|
1426
|
+
INDIRECT_PROMPT_INJECTION: "INDIRECT_PROMPT_INJECTION",
|
|
1427
|
+
JAILBREAK: "JAILBREAK",
|
|
1428
|
+
MULTI_TURN: "MULTI_TURN",
|
|
1429
|
+
PROMPT_INJECTION: "PROMPT_INJECTION",
|
|
1430
|
+
REMOTE_CODE_EXECUTION: "REMOTE_CODE_EXECUTION",
|
|
1431
|
+
SYSTEM_PROMPT_LEAK: "SYSTEM_PROMPT_LEAK",
|
|
1432
|
+
TOOL_LEAK: "TOOL_LEAK",
|
|
1433
|
+
MALWARE_GENERATION: "MALWARE_GENERATION"
|
|
1434
|
+
};
|
|
1435
|
+
var SeverityFilter = {
|
|
1436
|
+
LOW: "LOW",
|
|
1437
|
+
MEDIUM: "MEDIUM",
|
|
1438
|
+
HIGH: "HIGH",
|
|
1439
|
+
CRITICAL: "CRITICAL"
|
|
1440
|
+
};
|
|
1441
|
+
var StatusQueryParam = {
|
|
1442
|
+
SUCCESSFUL: "SUCCESSFUL",
|
|
1443
|
+
FAILED: "FAILED"
|
|
1444
|
+
};
|
|
1445
|
+
var StreamType = {
|
|
1446
|
+
NORMAL: "NORMAL",
|
|
1447
|
+
ADVERSARIAL: "ADVERSARIAL"
|
|
1448
|
+
};
|
|
1449
|
+
var TargetConnectionType = {
|
|
1450
|
+
DATABRICKS: "DATABRICKS",
|
|
1451
|
+
BEDROCK: "BEDROCK",
|
|
1452
|
+
OPENAI: "OPENAI",
|
|
1453
|
+
HUGGING_FACE: "HUGGING_FACE",
|
|
1454
|
+
CUSTOM: "CUSTOM",
|
|
1455
|
+
REST: "REST",
|
|
1456
|
+
STREAMING: "STREAMING"
|
|
1457
|
+
};
|
|
1458
|
+
var TargetStatus = {
|
|
1459
|
+
DRAFT: "DRAFT",
|
|
1460
|
+
VALIDATING: "VALIDATING",
|
|
1461
|
+
VALIDATED: "VALIDATED",
|
|
1462
|
+
ACTIVE: "ACTIVE",
|
|
1463
|
+
INACTIVE: "INACTIVE",
|
|
1464
|
+
FAILED: "FAILED",
|
|
1465
|
+
PENDING_AUTH: "PENDING_AUTH"
|
|
1466
|
+
};
|
|
1467
|
+
var TargetType = {
|
|
1468
|
+
APPLICATION: "APPLICATION",
|
|
1469
|
+
AGENT: "AGENT",
|
|
1470
|
+
MODEL: "MODEL"
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
// src/models/red-team.ts
|
|
1474
|
+
import { z as z18 } from "zod";
|
|
1475
|
+
var RedTeamPaginationSchema = z18.object({ total_items: z18.number().int().nullable().optional() }).passthrough();
|
|
1476
|
+
var CountByNameSchema = z18.object({ name: z18.string(), count: z18.number().int() });
|
|
1477
|
+
var ValidationErrorSchema = z18.object({
|
|
1478
|
+
loc: z18.array(z18.union([z18.string(), z18.number()])),
|
|
1479
|
+
msg: z18.string(),
|
|
1480
|
+
type: z18.string()
|
|
1481
|
+
});
|
|
1482
|
+
var HTTPValidationErrorSchema = z18.object({ detail: z18.array(ValidationErrorSchema).optional() }).passthrough();
|
|
1483
|
+
var TargetBackgroundSchema = z18.object({
|
|
1484
|
+
industry: z18.unknown().optional(),
|
|
1485
|
+
use_case: z18.unknown().optional(),
|
|
1486
|
+
competitors: z18.unknown().optional()
|
|
1487
|
+
}).passthrough();
|
|
1488
|
+
var TargetAdditionalContextSchema = z18.object({
|
|
1489
|
+
base_model: z18.unknown().optional(),
|
|
1490
|
+
core_architecture: z18.unknown().optional(),
|
|
1491
|
+
system_prompt: z18.unknown().optional(),
|
|
1492
|
+
languages_supported: z18.unknown().optional(),
|
|
1493
|
+
banned_keywords: z18.unknown().optional(),
|
|
1494
|
+
tools_accessible: z18.unknown().optional()
|
|
1495
|
+
}).passthrough();
|
|
1496
|
+
var TargetMetadataSchema = z18.object({
|
|
1497
|
+
multi_turn: z18.boolean().optional(),
|
|
1498
|
+
multi_turn_error_message: z18.unknown().optional(),
|
|
1499
|
+
rate_limit: z18.unknown().optional(),
|
|
1500
|
+
rate_limit_enabled: z18.boolean().optional(),
|
|
1501
|
+
rate_limit_error_code: z18.unknown().optional(),
|
|
1502
|
+
rate_limit_error_json: z18.unknown().optional(),
|
|
1503
|
+
rate_limit_error_message: z18.unknown().optional(),
|
|
1504
|
+
content_filter_enabled: z18.boolean().optional(),
|
|
1505
|
+
content_filter_error_code: z18.unknown().optional(),
|
|
1506
|
+
content_filter_error_json: z18.unknown().optional(),
|
|
1507
|
+
content_filter_error_message: z18.unknown().optional(),
|
|
1508
|
+
probe_message: z18.string().optional(),
|
|
1509
|
+
request_timeout: z18.number().optional()
|
|
1510
|
+
}).passthrough();
|
|
1511
|
+
var TargetJobRequestSchema = z18.object({
|
|
1512
|
+
uuid: z18.string(),
|
|
1513
|
+
version: z18.number().int().nullable().optional()
|
|
1514
|
+
});
|
|
1515
|
+
var JobTimeRecordSchema = z18.object({
|
|
1516
|
+
queued_at: z18.string().nullable().optional(),
|
|
1517
|
+
started_at: z18.string().nullable().optional(),
|
|
1518
|
+
completed_at: z18.string().nullable().optional(),
|
|
1519
|
+
time_taken: z18.string().nullable().optional()
|
|
1520
|
+
}).passthrough();
|
|
1521
|
+
var StaticJobMetadataSchema = z18.object({
|
|
1522
|
+
categories: z18.record(z18.unknown()),
|
|
1523
|
+
rate_limit_enabled: z18.boolean().optional(),
|
|
1524
|
+
rate_limit: z18.number().int().nullable().optional(),
|
|
1525
|
+
rate_limit_error_code: z18.number().int().nullable().optional(),
|
|
1526
|
+
rate_limit_error_message: z18.string().nullable().optional(),
|
|
1527
|
+
rate_limit_error_json: z18.unknown().optional(),
|
|
1528
|
+
content_filter_enabled: z18.boolean().optional(),
|
|
1529
|
+
content_filter_error_code: z18.number().int().nullable().optional(),
|
|
1530
|
+
content_filter_error_message: z18.string().nullable().optional(),
|
|
1531
|
+
content_filter_error_json: z18.unknown().optional()
|
|
1532
|
+
}).passthrough();
|
|
1533
|
+
var DynamicJobMetadataSchema = z18.object({
|
|
1534
|
+
rate_limit_enabled: z18.boolean().optional(),
|
|
1535
|
+
rate_limit: z18.number().int().nullable().optional(),
|
|
1536
|
+
rate_limit_error_code: z18.number().int().nullable().optional(),
|
|
1537
|
+
rate_limit_error_message: z18.string().nullable().optional(),
|
|
1538
|
+
rate_limit_error_json: z18.unknown().optional(),
|
|
1539
|
+
content_filter_enabled: z18.boolean().optional(),
|
|
1540
|
+
content_filter_error_code: z18.number().int().nullable().optional(),
|
|
1541
|
+
content_filter_error_message: z18.string().nullable().optional(),
|
|
1542
|
+
content_filter_error_json: z18.unknown().optional(),
|
|
1543
|
+
stream_breadth: z18.number().int().optional(),
|
|
1544
|
+
stream_depth: z18.number().int().optional(),
|
|
1545
|
+
max_tokens: z18.number().int().optional(),
|
|
1546
|
+
context_size: z18.number().int().optional(),
|
|
1547
|
+
attack_goals: z18.array(z18.unknown()).optional(),
|
|
1548
|
+
base_model: z18.string().nullable().optional(),
|
|
1549
|
+
use_case: z18.string().nullable().optional(),
|
|
1550
|
+
system_prompt: z18.string().nullable().optional()
|
|
1551
|
+
}).passthrough();
|
|
1552
|
+
var CustomJobMetadataSchema = z18.object({
|
|
1553
|
+
custom_prompt_sets: z18.array(z18.unknown()),
|
|
1554
|
+
rate_limit_enabled: z18.boolean().optional(),
|
|
1555
|
+
rate_limit: z18.number().int().nullable().optional(),
|
|
1556
|
+
rate_limit_error_code: z18.number().int().nullable().optional(),
|
|
1557
|
+
rate_limit_error_message: z18.string().nullable().optional(),
|
|
1558
|
+
rate_limit_error_json: z18.unknown().optional(),
|
|
1559
|
+
content_filter_enabled: z18.boolean().optional(),
|
|
1560
|
+
content_filter_error_code: z18.number().int().nullable().optional(),
|
|
1561
|
+
content_filter_error_message: z18.string().nullable().optional(),
|
|
1562
|
+
content_filter_error_json: z18.unknown().optional()
|
|
1563
|
+
}).passthrough();
|
|
1564
|
+
var JobCreateRequestSchema = z18.object({
|
|
1565
|
+
name: z18.string(),
|
|
1566
|
+
target: TargetJobRequestSchema,
|
|
1567
|
+
job_type: z18.string(),
|
|
1568
|
+
job_metadata: z18.union([
|
|
1569
|
+
StaticJobMetadataSchema,
|
|
1570
|
+
DynamicJobMetadataSchema,
|
|
1571
|
+
CustomJobMetadataSchema
|
|
1572
|
+
]),
|
|
1573
|
+
version: z18.number().int().nullable().optional(),
|
|
1574
|
+
extra_info: z18.record(z18.unknown()).nullable().optional()
|
|
1575
|
+
});
|
|
1576
|
+
var StaticJobReportStatsSchema = z18.object({
|
|
1577
|
+
output_completion_percentage: z18.number(),
|
|
1578
|
+
partial_report_unlocked: z18.boolean().optional(),
|
|
1579
|
+
partial_report_unlocked_at: z18.string().nullable().optional(),
|
|
1580
|
+
report_summary: z18.string().nullable().optional()
|
|
1581
|
+
}).passthrough();
|
|
1582
|
+
var DynamicJobReportStatsSchema = z18.object({
|
|
1583
|
+
total_goals: z18.number().int().optional(),
|
|
1584
|
+
total_streams: z18.number().int().optional(),
|
|
1585
|
+
total_threats: z18.number().int().optional(),
|
|
1586
|
+
goals_achieved: z18.number().int().optional(),
|
|
1587
|
+
report_summary: z18.string().nullable().optional()
|
|
1588
|
+
}).passthrough();
|
|
1589
|
+
var TargetReferenceSchema = z18.object({
|
|
1590
|
+
uuid: z18.string(),
|
|
1591
|
+
tsg_id: z18.string(),
|
|
1592
|
+
name: z18.string(),
|
|
1593
|
+
description: z18.string().nullable().optional(),
|
|
1594
|
+
target_type: z18.string().nullable().optional(),
|
|
1595
|
+
connection_type: z18.string().nullable().optional(),
|
|
1596
|
+
api_endpoint_type: z18.string().nullable().optional(),
|
|
1597
|
+
response_mode: z18.string().nullable().optional(),
|
|
1598
|
+
session_supported: z18.boolean().optional(),
|
|
1599
|
+
extra_info: z18.record(z18.unknown()).nullable().optional(),
|
|
1600
|
+
status: z18.string(),
|
|
1601
|
+
active: z18.boolean(),
|
|
1602
|
+
validated: z18.boolean(),
|
|
1603
|
+
version: z18.number().int().nullable().optional(),
|
|
1604
|
+
secret_version: z18.string().nullable().optional(),
|
|
1605
|
+
created_by_user_id: z18.string().nullable().optional(),
|
|
1606
|
+
updated_by_user_id: z18.string().nullable().optional(),
|
|
1607
|
+
created_at: z18.string(),
|
|
1608
|
+
updated_at: z18.string(),
|
|
1609
|
+
target_metadata: TargetMetadataSchema.optional(),
|
|
1610
|
+
target_background: TargetBackgroundSchema.nullable().optional(),
|
|
1611
|
+
profiling_status: z18.string().nullable().optional(),
|
|
1612
|
+
additional_context: TargetAdditionalContextSchema.nullable().optional()
|
|
1613
|
+
}).passthrough();
|
|
1614
|
+
var JobResponseSchema = z18.object({
|
|
1615
|
+
uuid: z18.string(),
|
|
1616
|
+
tsg_id: z18.string(),
|
|
1617
|
+
name: z18.string(),
|
|
1618
|
+
target: TargetReferenceSchema,
|
|
1619
|
+
job_type: z18.string(),
|
|
1620
|
+
job_metadata: z18.unknown(),
|
|
1621
|
+
version: z18.number().int().nullable().optional(),
|
|
1622
|
+
extra_info: z18.record(z18.unknown()).nullable().optional(),
|
|
1623
|
+
target_id: z18.string(),
|
|
1624
|
+
target_type: z18.string(),
|
|
1625
|
+
total: z18.number().int().nullable().optional(),
|
|
1626
|
+
completed: z18.number().int().nullable().optional(),
|
|
1627
|
+
status: z18.string().optional(),
|
|
1628
|
+
score: z18.number().nullable().optional(),
|
|
1629
|
+
asr: z18.number().nullable().optional(),
|
|
1630
|
+
time_record: JobTimeRecordSchema.nullable().optional(),
|
|
1631
|
+
created_at: z18.string().nullable().optional(),
|
|
1632
|
+
updated_at: z18.string().nullable().optional(),
|
|
1633
|
+
created_by_user_id: z18.string().nullable().optional(),
|
|
1634
|
+
report_stats: z18.unknown().optional(),
|
|
1635
|
+
metering_quota_uuid: z18.string().nullable().optional(),
|
|
1636
|
+
counted_towards_quota: z18.string().optional(),
|
|
1637
|
+
invocation_id: z18.string().nullable().optional()
|
|
1638
|
+
}).passthrough();
|
|
1639
|
+
var JobListResponseSchema = z18.object({
|
|
1640
|
+
pagination: RedTeamPaginationSchema,
|
|
1641
|
+
data: z18.array(JobResponseSchema)
|
|
1642
|
+
}).passthrough();
|
|
1643
|
+
var JobAbortResponseSchema = z18.object({
|
|
1644
|
+
job_id: z18.string(),
|
|
1645
|
+
message: z18.string()
|
|
1646
|
+
});
|
|
1647
|
+
var PrerequisiteModelSchema = z18.object({
|
|
1648
|
+
id: z18.string(),
|
|
1649
|
+
display_name: z18.string(),
|
|
1650
|
+
description: z18.string()
|
|
1651
|
+
});
|
|
1652
|
+
var SubCategoryModelSchema = z18.object({
|
|
1653
|
+
id: z18.string(),
|
|
1654
|
+
display_name: z18.string(),
|
|
1655
|
+
description: z18.string(),
|
|
1656
|
+
preselect: z18.boolean().optional(),
|
|
1657
|
+
prerequisites: z18.array(PrerequisiteModelSchema).nullable().optional(),
|
|
1658
|
+
active: z18.boolean().optional()
|
|
1659
|
+
}).passthrough();
|
|
1660
|
+
var CategoryModelSchema = z18.object({
|
|
1661
|
+
id: z18.string(),
|
|
1662
|
+
display_name: z18.string(),
|
|
1663
|
+
description: z18.string(),
|
|
1664
|
+
preselect: z18.boolean().optional(),
|
|
1665
|
+
sub_categories: z18.array(SubCategoryModelSchema)
|
|
1666
|
+
}).passthrough();
|
|
1667
|
+
var AttackOutputSchema = z18.object({
|
|
1668
|
+
uuid: z18.string(),
|
|
1669
|
+
tsg_id: z18.string(),
|
|
1670
|
+
attack_id: z18.string(),
|
|
1671
|
+
job_id: z18.string(),
|
|
1672
|
+
target_id: z18.string(),
|
|
1673
|
+
output: z18.string(),
|
|
1674
|
+
threat: z18.boolean().nullable().optional(),
|
|
1675
|
+
marked_safe: z18.boolean().nullable().optional()
|
|
1676
|
+
}).passthrough();
|
|
1677
|
+
var AttackMultiTurnOutputSchema = z18.object({
|
|
1678
|
+
uuid: z18.string(),
|
|
1679
|
+
tsg_id: z18.string(),
|
|
1680
|
+
attack_id: z18.string(),
|
|
1681
|
+
job_id: z18.string(),
|
|
1682
|
+
target_id: z18.string(),
|
|
1683
|
+
output: z18.string(),
|
|
1684
|
+
prompt: z18.string(),
|
|
1685
|
+
turn: z18.number().int(),
|
|
1686
|
+
threat: z18.boolean().nullable().optional(),
|
|
1687
|
+
marked_safe: z18.boolean().nullable().optional(),
|
|
1688
|
+
generation: z18.number().int().optional(),
|
|
1689
|
+
multi_turn: z18.boolean().optional()
|
|
1690
|
+
}).passthrough();
|
|
1691
|
+
var AttackListItemSchema = z18.object({
|
|
1692
|
+
uuid: z18.string(),
|
|
1693
|
+
tsg_id: z18.string(),
|
|
1694
|
+
job_id: z18.string(),
|
|
1695
|
+
target_id: z18.string(),
|
|
1696
|
+
prompt: z18.string(),
|
|
1697
|
+
prompt_mapping_id: z18.string(),
|
|
1698
|
+
prompt_id: z18.string(),
|
|
1699
|
+
category: z18.string(),
|
|
1700
|
+
sub_category: z18.string(),
|
|
1701
|
+
category_display_name: z18.string(),
|
|
1702
|
+
sub_category_display_name: z18.string(),
|
|
1703
|
+
status: z18.string().optional(),
|
|
1704
|
+
marked_safe: z18.boolean().nullable().optional(),
|
|
1705
|
+
extra_info: z18.record(z18.unknown()).optional(),
|
|
1706
|
+
threat: z18.boolean().nullable().optional(),
|
|
1707
|
+
attack_type: z18.string().optional(),
|
|
1708
|
+
multi_turn: z18.boolean().optional(),
|
|
1709
|
+
asr: z18.number().nullable().optional(),
|
|
1710
|
+
version: z18.number().int().nullable().optional(),
|
|
1711
|
+
severity: z18.string().optional()
|
|
1712
|
+
}).passthrough();
|
|
1713
|
+
var AttackListResponseSchema = z18.object({
|
|
1714
|
+
pagination: RedTeamPaginationSchema,
|
|
1715
|
+
data: z18.array(AttackListItemSchema)
|
|
1716
|
+
}).passthrough();
|
|
1717
|
+
var AttackDetailResponseSchema = z18.object({
|
|
1718
|
+
uuid: z18.string(),
|
|
1719
|
+
tsg_id: z18.string(),
|
|
1720
|
+
job_id: z18.string(),
|
|
1721
|
+
target_id: z18.string(),
|
|
1722
|
+
prompt: z18.string(),
|
|
1723
|
+
prompt_mapping_id: z18.string(),
|
|
1724
|
+
prompt_id: z18.string(),
|
|
1725
|
+
category: z18.string(),
|
|
1726
|
+
sub_category: z18.string(),
|
|
1727
|
+
category_display_name: z18.string(),
|
|
1728
|
+
sub_category_display_name: z18.string(),
|
|
1729
|
+
compliance_frameworks: z18.array(z18.unknown()),
|
|
1730
|
+
goal: z18.string().nullable(),
|
|
1731
|
+
status: z18.string().optional(),
|
|
1732
|
+
marked_safe: z18.boolean().nullable().optional(),
|
|
1733
|
+
extra_info: z18.record(z18.unknown()).optional(),
|
|
1734
|
+
threat: z18.boolean().nullable().optional(),
|
|
1735
|
+
attack_type: z18.string().optional(),
|
|
1736
|
+
multi_turn: z18.boolean().optional(),
|
|
1737
|
+
asr: z18.number().nullable().optional(),
|
|
1738
|
+
version: z18.number().int().nullable().optional(),
|
|
1739
|
+
severity: z18.string().optional(),
|
|
1740
|
+
outputs: z18.array(AttackOutputSchema).optional()
|
|
1741
|
+
}).passthrough();
|
|
1742
|
+
var AttackMultiTurnDetailResponseSchema = z18.object({
|
|
1743
|
+
uuid: z18.string(),
|
|
1744
|
+
tsg_id: z18.string(),
|
|
1745
|
+
job_id: z18.string(),
|
|
1746
|
+
target_id: z18.string(),
|
|
1747
|
+
prompt: z18.string(),
|
|
1748
|
+
prompt_mapping_id: z18.string(),
|
|
1749
|
+
prompt_id: z18.string(),
|
|
1750
|
+
category: z18.string(),
|
|
1751
|
+
sub_category: z18.string(),
|
|
1752
|
+
category_display_name: z18.string(),
|
|
1753
|
+
sub_category_display_name: z18.string(),
|
|
1754
|
+
compliance_frameworks: z18.array(z18.unknown()),
|
|
1755
|
+
goal: z18.string().nullable(),
|
|
1756
|
+
status: z18.string().optional(),
|
|
1757
|
+
marked_safe: z18.boolean().nullable().optional(),
|
|
1758
|
+
extra_info: z18.record(z18.unknown()).optional(),
|
|
1759
|
+
threat: z18.boolean().nullable().optional(),
|
|
1760
|
+
attack_type: z18.string().optional(),
|
|
1761
|
+
multi_turn: z18.boolean().optional(),
|
|
1762
|
+
asr: z18.number().nullable().optional(),
|
|
1763
|
+
version: z18.number().int().nullable().optional(),
|
|
1764
|
+
severity: z18.string().optional(),
|
|
1765
|
+
outputs: z18.array(AttackMultiTurnOutputSchema).optional()
|
|
1766
|
+
}).passthrough();
|
|
1767
|
+
var SubCategoryStatsSchema = z18.object({
|
|
1768
|
+
id: z18.string(),
|
|
1769
|
+
display_name: z18.string(),
|
|
1770
|
+
description: z18.string(),
|
|
1771
|
+
preselect: z18.boolean().optional(),
|
|
1772
|
+
prerequisites: z18.array(PrerequisiteModelSchema).nullable().optional(),
|
|
1773
|
+
active: z18.boolean().optional(),
|
|
1774
|
+
successful: z18.number().int(),
|
|
1775
|
+
failed: z18.number().int(),
|
|
1776
|
+
total: z18.number().int().optional()
|
|
1777
|
+
}).passthrough();
|
|
1778
|
+
var CategoryReportSchema = z18.object({
|
|
1779
|
+
id: z18.string(),
|
|
1780
|
+
display_name: z18.string(),
|
|
1781
|
+
description: z18.string(),
|
|
1782
|
+
preselect: z18.boolean().optional(),
|
|
1783
|
+
sub_categories: z18.array(SubCategoryStatsSchema),
|
|
1784
|
+
asr: z18.number(),
|
|
1785
|
+
total_prompts: z18.number().int(),
|
|
1786
|
+
total_attacks: z18.number().int(),
|
|
1787
|
+
successful: z18.number().int(),
|
|
1788
|
+
failed: z18.number().int()
|
|
1789
|
+
}).passthrough();
|
|
1790
|
+
var SeverityStatsSchema = z18.object({
|
|
1791
|
+
severity: z18.string(),
|
|
1792
|
+
successful: z18.number().int().optional(),
|
|
1793
|
+
failed: z18.number().int().optional()
|
|
1794
|
+
}).passthrough();
|
|
1795
|
+
var SeverityReportSchema = z18.object({
|
|
1796
|
+
stats: z18.array(SeverityStatsSchema),
|
|
1797
|
+
successful: z18.number().int().optional(),
|
|
1798
|
+
failed: z18.number().int().optional(),
|
|
1799
|
+
total_attacks: z18.number().int().optional()
|
|
1800
|
+
}).passthrough();
|
|
1801
|
+
var ComplianceTechniqueSchema = z18.object({
|
|
1802
|
+
id: z18.string(),
|
|
1803
|
+
display_name: z18.string(),
|
|
1804
|
+
compliance_id: z18.string(),
|
|
1805
|
+
description: z18.string(),
|
|
1806
|
+
link: z18.string(),
|
|
1807
|
+
version: z18.string(),
|
|
1808
|
+
active: z18.boolean(),
|
|
1809
|
+
successful: z18.number().int().optional(),
|
|
1810
|
+
failed: z18.number().int().optional(),
|
|
1811
|
+
total: z18.number().int().optional()
|
|
1812
|
+
}).passthrough();
|
|
1813
|
+
var ComplianceReportSchema = z18.object({
|
|
1814
|
+
id: z18.string(),
|
|
1815
|
+
display_name: z18.string(),
|
|
1816
|
+
description: z18.string(),
|
|
1817
|
+
active: z18.boolean(),
|
|
1818
|
+
version: z18.string(),
|
|
1819
|
+
link: z18.string(),
|
|
1820
|
+
techniques: z18.array(ComplianceTechniqueSchema),
|
|
1821
|
+
score: z18.number().int().optional()
|
|
1822
|
+
}).passthrough();
|
|
1823
|
+
var RuntimeSecurityPolicySchema = z18.object({
|
|
1824
|
+
policy_id: z18.string(),
|
|
1825
|
+
display_name: z18.string(),
|
|
1826
|
+
config: z18.record(z18.unknown())
|
|
1827
|
+
}).passthrough();
|
|
1828
|
+
var StaticJobRemediationSchema = z18.object({
|
|
1829
|
+
remediation: z18.string(),
|
|
1830
|
+
description: z18.string(),
|
|
1831
|
+
mapping_remediation_id: z18.string().nullable().optional(),
|
|
1832
|
+
subcategories: z18.array(z18.string()).nullable().optional(),
|
|
1833
|
+
effectiveness: z18.number().int().optional(),
|
|
1834
|
+
ease_of_implementation: z18.number().int().optional(),
|
|
1835
|
+
priority: z18.number().int().optional(),
|
|
1836
|
+
resource_links: z18.array(z18.string()).optional(),
|
|
1837
|
+
categories: z18.array(z18.string()).nullable().optional()
|
|
1838
|
+
}).passthrough();
|
|
1839
|
+
var StaticJobRemediationRecommendationSchema = z18.object({
|
|
1840
|
+
runtime_security_policy_configuration: z18.array(RuntimeSecurityPolicySchema).nullable().optional(),
|
|
1841
|
+
other_measures: z18.array(StaticJobRemediationSchema).optional()
|
|
1842
|
+
}).passthrough();
|
|
1843
|
+
var StaticJobReportSchema = z18.object({
|
|
1844
|
+
severity_report: SeverityReportSchema,
|
|
1845
|
+
asr: z18.number().nullable().optional(),
|
|
1846
|
+
score: z18.number().nullable().optional(),
|
|
1847
|
+
security_report: CategoryReportSchema.nullable().optional(),
|
|
1848
|
+
safety_report: CategoryReportSchema.nullable().optional(),
|
|
1849
|
+
brand_report: CategoryReportSchema.nullable().optional(),
|
|
1850
|
+
compliance_report: z18.array(ComplianceReportSchema).nullable().optional(),
|
|
1851
|
+
report_summary: z18.string().nullable().optional(),
|
|
1852
|
+
recommendations: StaticJobRemediationRecommendationSchema.nullable().optional()
|
|
1853
|
+
}).passthrough();
|
|
1854
|
+
var DynamicJobReportSchema = z18.object({
|
|
1855
|
+
total_goals: z18.number().int().optional(),
|
|
1856
|
+
total_streams: z18.number().int().optional(),
|
|
1857
|
+
total_threats: z18.number().int().optional(),
|
|
1858
|
+
goals_achieved: z18.number().int().optional(),
|
|
1859
|
+
report_summary: z18.string().nullable().optional(),
|
|
1860
|
+
score: z18.number().optional(),
|
|
1861
|
+
asr: z18.number().optional()
|
|
1862
|
+
}).passthrough();
|
|
1863
|
+
var RemediationDetailSchema = z18.object({
|
|
1864
|
+
remediation: z18.string(),
|
|
1865
|
+
description: z18.string(),
|
|
1866
|
+
resource_links: z18.array(z18.string()).optional(),
|
|
1867
|
+
priority_level: z18.string().optional(),
|
|
1868
|
+
ease_of_implementation_level: z18.string().optional(),
|
|
1869
|
+
effectiveness_level: z18.string().optional()
|
|
1870
|
+
}).passthrough();
|
|
1871
|
+
var RemediationResponseSchema = z18.object({ remediations: z18.array(RemediationDetailSchema).optional() }).passthrough();
|
|
1872
|
+
var RuntimeSecurityProfileResponseSchema = z18.object({
|
|
1873
|
+
runtime_security_profile: z18.array(RuntimeSecurityPolicySchema).nullable().optional()
|
|
1874
|
+
}).passthrough();
|
|
1875
|
+
var GoalSchema = z18.object({
|
|
1876
|
+
goal: z18.string(),
|
|
1877
|
+
safe_response: z18.string(),
|
|
1878
|
+
jailbroken_response: z18.string(),
|
|
1879
|
+
goal_metadata: z18.record(z18.unknown()).optional(),
|
|
1880
|
+
custom_goal: z18.boolean().optional(),
|
|
1881
|
+
goal_type: z18.string().optional(),
|
|
1882
|
+
uuid: z18.string(),
|
|
1883
|
+
tsg_id: z18.string(),
|
|
1884
|
+
job_id: z18.string(),
|
|
1885
|
+
goal_to_show: z18.string().nullable().optional(),
|
|
1886
|
+
threat: z18.boolean().optional(),
|
|
1887
|
+
version: z18.number().int().nullable().optional(),
|
|
1888
|
+
extra_info: z18.record(z18.unknown()).nullable().optional()
|
|
1889
|
+
}).passthrough();
|
|
1890
|
+
var GoalListResponseSchema = z18.object({ pagination: RedTeamPaginationSchema, data: z18.array(GoalSchema) }).passthrough();
|
|
1891
|
+
var StreamIterationDataSchema = z18.object({
|
|
1892
|
+
uuid: z18.string(),
|
|
1893
|
+
tsg_id: z18.string(),
|
|
1894
|
+
job_id: z18.string(),
|
|
1895
|
+
stream_id: z18.string(),
|
|
1896
|
+
goal_id: z18.string(),
|
|
1897
|
+
iteration: z18.number().int(),
|
|
1898
|
+
prompt: z18.string(),
|
|
1899
|
+
techniques: z18.string(),
|
|
1900
|
+
improvement: z18.string(),
|
|
1901
|
+
prompts_objective: z18.string(),
|
|
1902
|
+
summary: z18.string(),
|
|
1903
|
+
output: z18.string().nullable().optional(),
|
|
1904
|
+
score: z18.number().int().nullable().optional(),
|
|
1905
|
+
judge_reasoning: z18.string().nullable().optional(),
|
|
1906
|
+
threat: z18.boolean().optional(),
|
|
1907
|
+
created_at: z18.string().nullable().optional(),
|
|
1908
|
+
updated_at: z18.string().nullable().optional(),
|
|
1909
|
+
extra_info: z18.record(z18.unknown()).nullable().optional(),
|
|
1910
|
+
version: z18.number().int().nullable().optional()
|
|
1911
|
+
}).passthrough();
|
|
1912
|
+
var StreamDetailResponseSchema = z18.object({
|
|
1913
|
+
uuid: z18.string(),
|
|
1914
|
+
tsg_id: z18.string(),
|
|
1915
|
+
job_id: z18.string(),
|
|
1916
|
+
target_id: z18.string(),
|
|
1917
|
+
goal_id: z18.string(),
|
|
1918
|
+
stream_idx: z18.number().int().optional(),
|
|
1919
|
+
iteration: z18.number().int().optional(),
|
|
1920
|
+
goal: z18.unknown().optional(),
|
|
1921
|
+
marked_safe: z18.boolean().optional(),
|
|
1922
|
+
stream_type: z18.string().nullable().optional(),
|
|
1923
|
+
threat: z18.boolean().optional(),
|
|
1924
|
+
first_threat_iteration: StreamIterationDataSchema.nullable().optional(),
|
|
1925
|
+
created_at: z18.string().nullable().optional(),
|
|
1926
|
+
updated_at: z18.string().nullable().optional(),
|
|
1927
|
+
extra_info: z18.record(z18.unknown()).optional(),
|
|
1928
|
+
version: z18.number().int().nullable().optional(),
|
|
1929
|
+
iterations: z18.array(StreamIterationDataSchema).optional()
|
|
1930
|
+
}).passthrough();
|
|
1931
|
+
var StreamListResponseSchema = z18.object({ pagination: RedTeamPaginationSchema, data: z18.array(StreamDetailResponseSchema) }).passthrough();
|
|
1932
|
+
var CustomAttackOutputSchema = z18.object({
|
|
1933
|
+
uuid: z18.string(),
|
|
1934
|
+
tsg_id: z18.string(),
|
|
1935
|
+
custom_attack_id: z18.string(),
|
|
1936
|
+
job_id: z18.string(),
|
|
1937
|
+
target_id: z18.string(),
|
|
1938
|
+
output: z18.string(),
|
|
1939
|
+
threat: z18.boolean().nullable().optional(),
|
|
1940
|
+
marked_safe: z18.boolean().nullable().optional()
|
|
1941
|
+
}).passthrough();
|
|
1942
|
+
var PropertyAssignmentSchema = z18.object({
|
|
1943
|
+
name: z18.string(),
|
|
1944
|
+
value: z18.string()
|
|
1945
|
+
});
|
|
1946
|
+
var PropertyValueStatisticSchema = z18.object({
|
|
1947
|
+
value: z18.string(),
|
|
1948
|
+
successful_attack_count: z18.number().int(),
|
|
1949
|
+
total_attack_count: z18.number().int(),
|
|
1950
|
+
success_rate: z18.number()
|
|
1951
|
+
});
|
|
1952
|
+
var PropertyStatisticSchema = z18.object({
|
|
1953
|
+
property_name: z18.string(),
|
|
1954
|
+
values: z18.array(PropertyValueStatisticSchema)
|
|
1955
|
+
});
|
|
1956
|
+
var PromptSetSummarySchema = z18.object({
|
|
1957
|
+
prompt_set_id: z18.string(),
|
|
1958
|
+
prompt_set_name: z18.string(),
|
|
1959
|
+
total_prompts: z18.number().int(),
|
|
1960
|
+
total_attacks: z18.number().int(),
|
|
1961
|
+
total_threats: z18.number().int(),
|
|
1962
|
+
failed_attacks: z18.number().int(),
|
|
1963
|
+
threat_rate: z18.number(),
|
|
1964
|
+
property_names: z18.array(z18.string()).optional(),
|
|
1965
|
+
property_statistics: z18.array(PropertyStatisticSchema).optional()
|
|
1966
|
+
}).passthrough();
|
|
1967
|
+
var CustomAttackReportResponseSchema = z18.object({
|
|
1968
|
+
total_prompts: z18.number().int(),
|
|
1969
|
+
total_attacks: z18.number().int(),
|
|
1970
|
+
total_threats: z18.number().int(),
|
|
1971
|
+
failed_attacks: z18.number().int(),
|
|
1972
|
+
score: z18.number(),
|
|
1973
|
+
asr: z18.number(),
|
|
1974
|
+
custom_attack_reports: z18.array(PromptSetSummarySchema).optional(),
|
|
1975
|
+
property_statistics: z18.array(PropertyStatisticSchema).optional()
|
|
1976
|
+
}).passthrough();
|
|
1977
|
+
var PromptSetsReportResponseSchema = z18.object({
|
|
1978
|
+
prompt_sets: z18.array(PromptSetSummarySchema),
|
|
1979
|
+
total_prompt_sets: z18.number().int(),
|
|
1980
|
+
applied_filters: z18.record(z18.unknown()).optional()
|
|
1981
|
+
}).passthrough();
|
|
1982
|
+
var PromptDetailResponseSchema = z18.object({
|
|
1983
|
+
prompt_id: z18.string(),
|
|
1984
|
+
prompt_text: z18.string(),
|
|
1985
|
+
goal: z18.string().nullable().optional(),
|
|
1986
|
+
user_defined_goal: z18.boolean().optional(),
|
|
1987
|
+
properties: z18.array(PropertyAssignmentSchema).optional(),
|
|
1988
|
+
attack_id: z18.string().nullable().optional(),
|
|
1989
|
+
threat: z18.boolean().nullable().optional(),
|
|
1990
|
+
attack_outputs: z18.array(CustomAttackOutputSchema).optional(),
|
|
1991
|
+
asr: z18.number().nullable().optional(),
|
|
1992
|
+
prompt_set_id: z18.string().nullable().optional(),
|
|
1993
|
+
prompt_set_name: z18.string().nullable().optional()
|
|
1994
|
+
}).passthrough();
|
|
1995
|
+
var CustomAttacksListResponseSchema = z18.object({
|
|
1996
|
+
pagination: RedTeamPaginationSchema,
|
|
1997
|
+
data: z18.array(z18.unknown()),
|
|
1998
|
+
total_attacks: z18.number().int(),
|
|
1999
|
+
total_threats: z18.number().int()
|
|
2000
|
+
}).passthrough();
|
|
2001
|
+
var RiskLevelSchema = z18.object({
|
|
2002
|
+
risk_rating: z18.string(),
|
|
2003
|
+
total: z18.number().int(),
|
|
2004
|
+
targets_by_type: z18.array(CountByNameSchema).optional()
|
|
2005
|
+
}).passthrough();
|
|
2006
|
+
var ScanStatisticsResponseSchema = z18.object({
|
|
2007
|
+
total_scans: z18.number().int(),
|
|
2008
|
+
targets_scanned: z18.number().int(),
|
|
2009
|
+
targets_scanned_by_type: z18.array(CountByNameSchema).optional(),
|
|
2010
|
+
scan_status: z18.array(CountByNameSchema).optional(),
|
|
2011
|
+
risk_profile: z18.array(RiskLevelSchema).optional()
|
|
2012
|
+
}).passthrough();
|
|
2013
|
+
var ScoreTrendSeriesSchema = z18.object({
|
|
2014
|
+
label: z18.string(),
|
|
2015
|
+
data: z18.array(z18.number().nullable())
|
|
2016
|
+
});
|
|
2017
|
+
var ScoreTrendResponseSchema = z18.object({
|
|
2018
|
+
labels: z18.array(z18.string()),
|
|
2019
|
+
series: z18.array(ScoreTrendSeriesSchema)
|
|
2020
|
+
});
|
|
2021
|
+
var SentimentRequestSchema = z18.object({
|
|
2022
|
+
job_id: z18.string(),
|
|
2023
|
+
up_vote: z18.boolean().optional(),
|
|
2024
|
+
down_vote: z18.boolean().optional()
|
|
2025
|
+
});
|
|
2026
|
+
var SentimentResponseSchema = z18.object({
|
|
2027
|
+
job_id: z18.string(),
|
|
2028
|
+
up_vote: z18.boolean().optional(),
|
|
2029
|
+
down_vote: z18.boolean().optional()
|
|
2030
|
+
}).passthrough();
|
|
2031
|
+
var QuotaDetailsSchema = z18.object({
|
|
2032
|
+
allocated: z18.number().int(),
|
|
2033
|
+
unlimited: z18.boolean(),
|
|
2034
|
+
consumed: z18.number().int()
|
|
2035
|
+
});
|
|
2036
|
+
var QuotaSummarySchema = z18.object({
|
|
2037
|
+
static: QuotaDetailsSchema,
|
|
2038
|
+
dynamic: QuotaDetailsSchema,
|
|
2039
|
+
custom: QuotaDetailsSchema
|
|
2040
|
+
});
|
|
2041
|
+
var ErrorLogSchema = z18.object({
|
|
2042
|
+
created_at: z18.string(),
|
|
2043
|
+
updated_at: z18.string(),
|
|
2044
|
+
job_id: z18.string().nullable().optional(),
|
|
2045
|
+
target_id: z18.string().nullable().optional(),
|
|
2046
|
+
target_version: z18.number().int().nullable().optional(),
|
|
2047
|
+
attack_id: z18.string().nullable().optional(),
|
|
2048
|
+
error_type: z18.string().nullable().optional(),
|
|
2049
|
+
error_source: z18.string().nullable().optional(),
|
|
2050
|
+
error_message: z18.string().nullable().optional(),
|
|
2051
|
+
target_object: z18.record(z18.unknown()).nullable().optional(),
|
|
2052
|
+
extra_info: z18.record(z18.unknown()).nullable().optional(),
|
|
2053
|
+
version: z18.number().int().optional()
|
|
2054
|
+
}).passthrough();
|
|
2055
|
+
var ErrorLogListResponseSchema = z18.object({ pagination: RedTeamPaginationSchema, data: z18.array(ErrorLogSchema) }).passthrough();
|
|
2056
|
+
var TargetCreateRequestSchema = z18.object({
|
|
2057
|
+
name: z18.string(),
|
|
2058
|
+
description: z18.unknown().optional(),
|
|
2059
|
+
target_type: z18.unknown().optional(),
|
|
2060
|
+
connection_type: z18.unknown().optional(),
|
|
2061
|
+
api_endpoint_type: z18.unknown().optional(),
|
|
2062
|
+
response_mode: z18.unknown().optional(),
|
|
2063
|
+
connection_params: z18.unknown().optional(),
|
|
2064
|
+
session_supported: z18.boolean().optional(),
|
|
2065
|
+
target_metadata: z18.unknown().optional(),
|
|
2066
|
+
target_background: z18.unknown().optional(),
|
|
2067
|
+
additional_context: z18.unknown().optional(),
|
|
2068
|
+
extra_info: z18.unknown().optional(),
|
|
2069
|
+
network_broker_channel_uuid: z18.unknown().optional()
|
|
2070
|
+
}).passthrough();
|
|
2071
|
+
var TargetUpdateRequestSchema = z18.object({
|
|
2072
|
+
name: z18.string(),
|
|
2073
|
+
description: z18.unknown().optional(),
|
|
2074
|
+
target_type: z18.unknown().optional(),
|
|
2075
|
+
connection_type: z18.unknown().optional(),
|
|
2076
|
+
api_endpoint_type: z18.unknown().optional(),
|
|
2077
|
+
response_mode: z18.unknown().optional(),
|
|
2078
|
+
connection_params: z18.unknown().optional(),
|
|
2079
|
+
session_supported: z18.boolean().optional(),
|
|
2080
|
+
target_metadata: z18.unknown().optional(),
|
|
2081
|
+
target_background: z18.unknown().optional(),
|
|
2082
|
+
additional_context: z18.unknown().optional(),
|
|
2083
|
+
extra_info: z18.unknown().optional(),
|
|
2084
|
+
network_broker_channel_uuid: z18.unknown().optional()
|
|
2085
|
+
}).passthrough();
|
|
2086
|
+
var TargetContextUpdateSchema = z18.object({
|
|
2087
|
+
target_background: z18.unknown().optional(),
|
|
2088
|
+
additional_context: z18.unknown().optional()
|
|
2089
|
+
}).passthrough();
|
|
2090
|
+
var TargetResponseSchema = z18.object({
|
|
2091
|
+
uuid: z18.string(),
|
|
2092
|
+
tsg_id: z18.string(),
|
|
2093
|
+
name: z18.string(),
|
|
2094
|
+
status: z18.unknown(),
|
|
2095
|
+
active: z18.boolean(),
|
|
2096
|
+
validated: z18.boolean(),
|
|
2097
|
+
created_at: z18.string(),
|
|
2098
|
+
updated_at: z18.string(),
|
|
2099
|
+
description: z18.unknown().optional(),
|
|
2100
|
+
target_type: z18.unknown().optional(),
|
|
2101
|
+
connection_type: z18.unknown().optional(),
|
|
2102
|
+
api_endpoint_type: z18.unknown().optional(),
|
|
2103
|
+
response_mode: z18.unknown().optional(),
|
|
2104
|
+
session_supported: z18.boolean().optional(),
|
|
2105
|
+
extra_info: z18.unknown().optional(),
|
|
2106
|
+
version: z18.unknown().optional(),
|
|
2107
|
+
secret_version: z18.unknown().optional(),
|
|
2108
|
+
created_by_user_id: z18.unknown().optional(),
|
|
2109
|
+
updated_by_user_id: z18.unknown().optional(),
|
|
2110
|
+
target_metadata: z18.unknown().optional(),
|
|
2111
|
+
target_background: z18.unknown().optional(),
|
|
2112
|
+
profiling_status: z18.unknown().optional(),
|
|
2113
|
+
additional_context: z18.unknown().optional()
|
|
2114
|
+
}).passthrough();
|
|
2115
|
+
var TargetListItemSchema = z18.object({
|
|
2116
|
+
uuid: z18.string(),
|
|
2117
|
+
tsg_id: z18.string(),
|
|
2118
|
+
name: z18.string(),
|
|
2119
|
+
status: z18.unknown(),
|
|
2120
|
+
active: z18.boolean(),
|
|
2121
|
+
validated: z18.boolean(),
|
|
2122
|
+
created_at: z18.string(),
|
|
2123
|
+
updated_at: z18.string(),
|
|
2124
|
+
description: z18.unknown().optional(),
|
|
2125
|
+
target_type: z18.unknown().optional(),
|
|
2126
|
+
connection_type: z18.unknown().optional(),
|
|
2127
|
+
api_endpoint_type: z18.unknown().optional(),
|
|
2128
|
+
response_mode: z18.unknown().optional(),
|
|
2129
|
+
session_supported: z18.boolean().optional(),
|
|
2130
|
+
extra_info: z18.unknown().optional(),
|
|
2131
|
+
version: z18.unknown().optional(),
|
|
2132
|
+
secret_version: z18.unknown().optional(),
|
|
2133
|
+
created_by_user_id: z18.unknown().optional(),
|
|
2134
|
+
updated_by_user_id: z18.unknown().optional()
|
|
2135
|
+
}).passthrough();
|
|
2136
|
+
var TargetListSchema = z18.object({ pagination: RedTeamPaginationSchema, data: z18.array(TargetListItemSchema).optional() }).passthrough();
|
|
2137
|
+
var TargetProbeRequestSchema = z18.object({
|
|
2138
|
+
name: z18.string(),
|
|
2139
|
+
uuid: z18.unknown().optional(),
|
|
2140
|
+
description: z18.unknown().optional(),
|
|
2141
|
+
target_type: z18.unknown().optional(),
|
|
2142
|
+
connection_type: z18.unknown().optional(),
|
|
2143
|
+
api_endpoint_type: z18.unknown().optional(),
|
|
2144
|
+
response_mode: z18.unknown().optional(),
|
|
2145
|
+
connection_params: z18.unknown().optional(),
|
|
2146
|
+
session_supported: z18.boolean().optional(),
|
|
2147
|
+
target_metadata: z18.unknown().optional(),
|
|
2148
|
+
target_background: z18.unknown().optional(),
|
|
2149
|
+
additional_context: z18.unknown().optional(),
|
|
2150
|
+
extra_info: z18.unknown().optional(),
|
|
2151
|
+
network_broker_channel_uuid: z18.unknown().optional(),
|
|
2152
|
+
probe_fields: z18.unknown().optional()
|
|
2153
|
+
}).passthrough();
|
|
2154
|
+
var TargetProfileResponseSchema = z18.object({
|
|
2155
|
+
target_id: z18.string(),
|
|
2156
|
+
target_version: z18.number().int(),
|
|
2157
|
+
status: z18.string(),
|
|
2158
|
+
profiling_status: z18.unknown().optional(),
|
|
2159
|
+
target_background: z18.unknown().optional(),
|
|
2160
|
+
additional_context: z18.unknown().optional(),
|
|
2161
|
+
ai_generated_fields: z18.unknown().optional(),
|
|
2162
|
+
other_details: z18.unknown().optional()
|
|
2163
|
+
}).passthrough();
|
|
2164
|
+
var BaseResponseSchema = z18.object({
|
|
2165
|
+
message: z18.string(),
|
|
2166
|
+
status: z18.number().int()
|
|
2167
|
+
});
|
|
2168
|
+
var PromptSetStatsSchema = z18.object({
|
|
2169
|
+
total_prompts: z18.number().int(),
|
|
2170
|
+
active_prompts: z18.number().int(),
|
|
2171
|
+
inactive_prompts: z18.number().int(),
|
|
2172
|
+
failed_prompts: z18.number().int().optional(),
|
|
2173
|
+
validation_prompts: z18.number().int().optional()
|
|
2174
|
+
}).passthrough();
|
|
2175
|
+
var CustomPromptSetCreateRequestSchema = z18.object({
|
|
2176
|
+
name: z18.string(),
|
|
2177
|
+
description: z18.unknown().optional(),
|
|
2178
|
+
property_names: z18.array(z18.string()).optional()
|
|
2179
|
+
});
|
|
2180
|
+
var CustomPromptSetUpdateRequestSchema = z18.object({
|
|
2181
|
+
name: z18.unknown().optional(),
|
|
2182
|
+
description: z18.unknown().optional(),
|
|
2183
|
+
archive: z18.unknown().optional(),
|
|
2184
|
+
property_names: z18.unknown().optional()
|
|
2185
|
+
}).passthrough();
|
|
2186
|
+
var CustomPromptSetArchiveRequestSchema = z18.object({ archive: z18.boolean() });
|
|
2187
|
+
var CustomPromptSetResponseSchema = z18.object({
|
|
2188
|
+
uuid: z18.string(),
|
|
2189
|
+
name: z18.string(),
|
|
2190
|
+
active: z18.boolean(),
|
|
2191
|
+
archive: z18.boolean(),
|
|
2192
|
+
status: z18.string(),
|
|
2193
|
+
created_at: z18.string(),
|
|
2194
|
+
updated_at: z18.string(),
|
|
2195
|
+
description: z18.unknown().optional(),
|
|
2196
|
+
property_names: z18.array(z18.string()).optional(),
|
|
2197
|
+
properties: z18.array(z18.unknown()).optional(),
|
|
2198
|
+
stats: z18.unknown().optional(),
|
|
2199
|
+
extra_info: z18.unknown().optional(),
|
|
2200
|
+
version: z18.unknown().optional(),
|
|
2201
|
+
created_by_user_id: z18.unknown().optional(),
|
|
2202
|
+
updated_by_user_id: z18.unknown().optional()
|
|
2203
|
+
}).passthrough();
|
|
2204
|
+
var CustomPromptSetListItemSchema = z18.object({
|
|
2205
|
+
uuid: z18.string(),
|
|
2206
|
+
name: z18.string(),
|
|
2207
|
+
active: z18.boolean(),
|
|
2208
|
+
archive: z18.boolean(),
|
|
2209
|
+
status: z18.string(),
|
|
2210
|
+
created_at: z18.string(),
|
|
2211
|
+
updated_at: z18.string(),
|
|
2212
|
+
description: z18.unknown().optional(),
|
|
2213
|
+
property_names: z18.array(z18.string()).optional(),
|
|
2214
|
+
stats: z18.unknown().optional(),
|
|
2215
|
+
created_by_user_id: z18.unknown().optional()
|
|
2216
|
+
}).passthrough();
|
|
2217
|
+
var CustomPromptSetListSchema = z18.object({
|
|
2218
|
+
pagination: RedTeamPaginationSchema,
|
|
2219
|
+
data: z18.array(CustomPromptSetListItemSchema).optional()
|
|
2220
|
+
}).passthrough();
|
|
2221
|
+
var CustomPromptSetListActiveSchema = z18.object({ data: z18.array(CustomPromptSetListItemSchema).optional() }).passthrough();
|
|
2222
|
+
var CustomPromptSetReferenceSchema = z18.object({
|
|
2223
|
+
uuid: z18.string(),
|
|
2224
|
+
name: z18.string(),
|
|
2225
|
+
status: z18.string(),
|
|
2226
|
+
active: z18.boolean(),
|
|
2227
|
+
tsg_id: z18.string(),
|
|
2228
|
+
created_at: z18.string(),
|
|
2229
|
+
updated_at: z18.string(),
|
|
2230
|
+
version: z18.unknown().optional()
|
|
2231
|
+
}).passthrough();
|
|
2232
|
+
var CustomPromptSetVersionInfoSchema = z18.object({
|
|
2233
|
+
uuid: z18.string(),
|
|
2234
|
+
status: z18.string(),
|
|
2235
|
+
is_latest: z18.boolean(),
|
|
2236
|
+
version: z18.unknown().optional(),
|
|
2237
|
+
stats: z18.unknown().optional(),
|
|
2238
|
+
snapshot_created_at: z18.unknown().optional()
|
|
2239
|
+
}).passthrough();
|
|
2240
|
+
var CustomPromptCreateRequestSchema = z18.object({
|
|
2241
|
+
prompt: z18.string(),
|
|
2242
|
+
prompt_set_id: z18.string(),
|
|
2243
|
+
goal: z18.unknown().optional(),
|
|
2244
|
+
properties: z18.unknown().optional()
|
|
2245
|
+
});
|
|
2246
|
+
var CustomPromptUpdateRequestSchema = z18.object({
|
|
2247
|
+
prompt: z18.unknown().optional(),
|
|
2248
|
+
goal: z18.unknown().optional(),
|
|
2249
|
+
properties: z18.unknown().optional()
|
|
2250
|
+
}).passthrough();
|
|
2251
|
+
var CustomPromptResponseSchema = z18.object({
|
|
2252
|
+
uuid: z18.string(),
|
|
2253
|
+
prompt: z18.string(),
|
|
2254
|
+
user_defined_goal: z18.boolean(),
|
|
2255
|
+
status: z18.string(),
|
|
2256
|
+
active: z18.boolean(),
|
|
2257
|
+
prompt_set_id: z18.string(),
|
|
2258
|
+
created_at: z18.string(),
|
|
2259
|
+
updated_at: z18.string(),
|
|
2260
|
+
goal: z18.unknown().optional(),
|
|
2261
|
+
properties: z18.unknown().optional(),
|
|
2262
|
+
property_assignments: z18.array(z18.unknown()).optional(),
|
|
2263
|
+
detector_category: z18.unknown().optional(),
|
|
2264
|
+
severity: z18.unknown().optional(),
|
|
2265
|
+
extra_info: z18.unknown().optional()
|
|
2266
|
+
}).passthrough();
|
|
2267
|
+
var CustomPromptListItemSchema = z18.object({
|
|
2268
|
+
uuid: z18.string(),
|
|
2269
|
+
prompt: z18.string(),
|
|
2270
|
+
user_defined_goal: z18.boolean(),
|
|
2271
|
+
status: z18.string(),
|
|
2272
|
+
active: z18.boolean(),
|
|
2273
|
+
created_at: z18.string(),
|
|
2274
|
+
updated_at: z18.string(),
|
|
2275
|
+
goal: z18.unknown().optional(),
|
|
2276
|
+
properties: z18.unknown().optional()
|
|
2277
|
+
}).passthrough();
|
|
2278
|
+
var CustomPromptListSchema = z18.object({
|
|
2279
|
+
pagination: RedTeamPaginationSchema,
|
|
2280
|
+
data: z18.array(CustomPromptListItemSchema).optional()
|
|
2281
|
+
}).passthrough();
|
|
2282
|
+
var PropertyNameCreateRequestSchema = z18.object({ name: z18.string() });
|
|
2283
|
+
var PropertyValueCreateRequestSchema = z18.object({
|
|
2284
|
+
property_name: z18.string(),
|
|
2285
|
+
property_value: z18.string()
|
|
2286
|
+
});
|
|
2287
|
+
var PropertyDefinitionSchema = z18.object({
|
|
2288
|
+
property_name: z18.string(),
|
|
2289
|
+
created_at: z18.string()
|
|
2290
|
+
});
|
|
2291
|
+
var PropertyNamesListResponseSchema = z18.object({ data: z18.array(PropertyDefinitionSchema).optional() }).passthrough();
|
|
2292
|
+
var PropertyValuesResponseSchema = z18.object({
|
|
2293
|
+
name: z18.string(),
|
|
2294
|
+
values: z18.array(z18.string()).optional()
|
|
2295
|
+
}).passthrough();
|
|
2296
|
+
var PropertyValuesMultipleResponseSchema = z18.object({ data: z18.record(z18.array(z18.string())).optional() }).passthrough();
|
|
2297
|
+
var DashboardOverviewResponseSchema = z18.object({
|
|
2298
|
+
total_targets: z18.number().int(),
|
|
2299
|
+
targets_by_type: z18.array(CountByNameSchema).optional()
|
|
2300
|
+
}).passthrough();
|
|
2301
|
+
|
|
2302
|
+
// src/models/oauth-token.ts
|
|
2303
|
+
import { z as z19 } from "zod";
|
|
2304
|
+
var OAuthTokenResponseSchema = z19.object({
|
|
2305
|
+
access_token: z19.string(),
|
|
2306
|
+
token_type: z19.string().optional(),
|
|
2307
|
+
expires_in: z19.number(),
|
|
2308
|
+
scope: z19.string().optional()
|
|
885
2309
|
});
|
|
886
2310
|
|
|
887
2311
|
// src/management/oauth-client.ts
|
|
888
|
-
var
|
|
2312
|
+
var DEFAULT_TOKEN_BUFFER_MS = 3e4;
|
|
889
2313
|
var OAuthClient = class {
|
|
890
2314
|
tokenEndpoint;
|
|
891
2315
|
clientId;
|
|
892
2316
|
clientSecret;
|
|
893
2317
|
tsgId;
|
|
2318
|
+
tokenBufferMs;
|
|
2319
|
+
onTokenRefresh;
|
|
894
2320
|
accessToken = null;
|
|
895
2321
|
expiresAt = 0;
|
|
896
2322
|
pendingFetch = null;
|
|
@@ -899,13 +2325,15 @@ var OAuthClient = class {
|
|
|
899
2325
|
this.clientSecret = opts.clientSecret;
|
|
900
2326
|
this.tsgId = opts.tsgId;
|
|
901
2327
|
this.tokenEndpoint = opts.tokenEndpoint ?? DEFAULT_TOKEN_ENDPOINT;
|
|
2328
|
+
this.tokenBufferMs = opts.tokenBufferMs ?? DEFAULT_TOKEN_BUFFER_MS;
|
|
2329
|
+
this.onTokenRefresh = opts.onTokenRefresh;
|
|
902
2330
|
}
|
|
903
2331
|
/**
|
|
904
2332
|
* Get a valid access token, refreshing if needed.
|
|
905
2333
|
* @returns Bearer access token string.
|
|
906
2334
|
*/
|
|
907
2335
|
async getToken() {
|
|
908
|
-
if (this.accessToken && Date.now() < this.expiresAt -
|
|
2336
|
+
if (this.accessToken && Date.now() < this.expiresAt - this.tokenBufferMs) {
|
|
909
2337
|
return this.accessToken;
|
|
910
2338
|
}
|
|
911
2339
|
if (this.pendingFetch) {
|
|
@@ -921,6 +2349,40 @@ var OAuthClient = class {
|
|
|
921
2349
|
this.accessToken = null;
|
|
922
2350
|
this.expiresAt = 0;
|
|
923
2351
|
}
|
|
2352
|
+
/** Check if the current token has passed its expiry time. Returns true if no token exists. */
|
|
2353
|
+
isTokenExpired() {
|
|
2354
|
+
if (!this.accessToken) return true;
|
|
2355
|
+
return Date.now() >= this.expiresAt;
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* Check if the token is within the pre-expiry buffer window.
|
|
2359
|
+
* Returns true if no token exists.
|
|
2360
|
+
* @param bufferMs - Custom buffer in ms. Defaults to the configured `tokenBufferMs`.
|
|
2361
|
+
*/
|
|
2362
|
+
isTokenExpiringSoon(bufferMs) {
|
|
2363
|
+
if (!this.accessToken) return true;
|
|
2364
|
+
const buffer = bufferMs ?? this.tokenBufferMs;
|
|
2365
|
+
return Date.now() >= this.expiresAt - buffer;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Get a snapshot of the current token state without exposing the actual token value.
|
|
2369
|
+
* @returns Current {@link TokenInfo}.
|
|
2370
|
+
*/
|
|
2371
|
+
getTokenInfo() {
|
|
2372
|
+
const now = Date.now();
|
|
2373
|
+
const hasToken = this.accessToken !== null;
|
|
2374
|
+
const isExpired = !hasToken || now >= this.expiresAt;
|
|
2375
|
+
const isExpiringSoon = !hasToken || now >= this.expiresAt - this.tokenBufferMs;
|
|
2376
|
+
const expiresInMs = hasToken ? Math.max(0, this.expiresAt - now) : 0;
|
|
2377
|
+
return {
|
|
2378
|
+
hasToken,
|
|
2379
|
+
isValid: hasToken && !isExpiringSoon,
|
|
2380
|
+
isExpired,
|
|
2381
|
+
isExpiringSoon,
|
|
2382
|
+
expiresInMs,
|
|
2383
|
+
expiresAt: hasToken ? this.expiresAt : 0
|
|
2384
|
+
};
|
|
2385
|
+
}
|
|
924
2386
|
async fetchToken() {
|
|
925
2387
|
const credentials = btoa(`${this.clientId}:${this.clientSecret}`);
|
|
926
2388
|
const body = new URLSearchParams({
|
|
@@ -956,6 +2418,12 @@ var OAuthClient = class {
|
|
|
956
2418
|
const data = OAuthTokenResponseSchema.parse(await response.json());
|
|
957
2419
|
this.accessToken = data.access_token;
|
|
958
2420
|
this.expiresAt = Date.now() + data.expires_in * 1e3;
|
|
2421
|
+
if (this.onTokenRefresh) {
|
|
2422
|
+
try {
|
|
2423
|
+
this.onTokenRefresh(this.getTokenInfo());
|
|
2424
|
+
} catch {
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
959
2427
|
return this.accessToken;
|
|
960
2428
|
}
|
|
961
2429
|
};
|
|
@@ -987,7 +2455,7 @@ async function managementHttpRequest(opts) {
|
|
|
987
2455
|
return fetch(url.toString(), { method, headers, body: bodyStr });
|
|
988
2456
|
},
|
|
989
2457
|
onRetryableFailure: async (response2) => {
|
|
990
|
-
if (response2.status === 401 && !hadTokenRefresh) {
|
|
2458
|
+
if ((response2.status === 401 || response2.status === 403) && !hadTokenRefresh) {
|
|
991
2459
|
hadTokenRefresh = true;
|
|
992
2460
|
oauthClient.clearToken();
|
|
993
2461
|
return true;
|
|
@@ -1261,6 +2729,1708 @@ var ManagementClient = class {
|
|
|
1261
2729
|
});
|
|
1262
2730
|
}
|
|
1263
2731
|
};
|
|
2732
|
+
|
|
2733
|
+
// src/model-security/scans-client.ts
|
|
2734
|
+
function buildListParams(opts) {
|
|
2735
|
+
const params = {};
|
|
2736
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
2737
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
2738
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
2739
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
2740
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
2741
|
+
return params;
|
|
2742
|
+
}
|
|
2743
|
+
var ModelSecurityScansClient = class {
|
|
2744
|
+
baseUrl;
|
|
2745
|
+
oauthClient;
|
|
2746
|
+
numRetries;
|
|
2747
|
+
constructor(opts) {
|
|
2748
|
+
this.baseUrl = opts.baseUrl;
|
|
2749
|
+
this.oauthClient = opts.oauthClient;
|
|
2750
|
+
this.numRetries = opts.numRetries;
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* Create a new model security scan.
|
|
2754
|
+
* @param request - Scan creation request body.
|
|
2755
|
+
* @returns The created scan response.
|
|
2756
|
+
*/
|
|
2757
|
+
async create(request) {
|
|
2758
|
+
const res = await managementHttpRequest({
|
|
2759
|
+
method: "POST",
|
|
2760
|
+
baseUrl: this.baseUrl,
|
|
2761
|
+
path: MODEL_SEC_SCANS_PATH,
|
|
2762
|
+
body: request,
|
|
2763
|
+
oauthClient: this.oauthClient,
|
|
2764
|
+
numRetries: this.numRetries
|
|
2765
|
+
});
|
|
2766
|
+
return res.data;
|
|
2767
|
+
}
|
|
2768
|
+
/**
|
|
2769
|
+
* List model security scans with optional filters.
|
|
2770
|
+
* @param opts - Pagination and filter options.
|
|
2771
|
+
* @returns Paginated list of scans.
|
|
2772
|
+
*/
|
|
2773
|
+
async list(opts) {
|
|
2774
|
+
const params = buildListParams(opts);
|
|
2775
|
+
if (opts?.eval_outcome !== void 0) params.eval_outcome = opts.eval_outcome;
|
|
2776
|
+
if (opts?.source_type !== void 0) params.source_type = opts.source_type;
|
|
2777
|
+
if (opts?.scan_origin !== void 0) params.scan_origin = opts.scan_origin;
|
|
2778
|
+
const res = await managementHttpRequest({
|
|
2779
|
+
method: "GET",
|
|
2780
|
+
baseUrl: this.baseUrl,
|
|
2781
|
+
path: MODEL_SEC_SCANS_PATH,
|
|
2782
|
+
params,
|
|
2783
|
+
oauthClient: this.oauthClient,
|
|
2784
|
+
numRetries: this.numRetries
|
|
2785
|
+
});
|
|
2786
|
+
return res.data;
|
|
2787
|
+
}
|
|
2788
|
+
/**
|
|
2789
|
+
* Get a single scan by UUID.
|
|
2790
|
+
* @param uuid - Scan UUID.
|
|
2791
|
+
* @returns The scan response.
|
|
2792
|
+
*/
|
|
2793
|
+
async get(uuid) {
|
|
2794
|
+
if (!isValidUuid(uuid)) {
|
|
2795
|
+
throw new AISecSDKException(
|
|
2796
|
+
`Invalid scan uuid: ${uuid}`,
|
|
2797
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2798
|
+
);
|
|
2799
|
+
}
|
|
2800
|
+
const res = await managementHttpRequest({
|
|
2801
|
+
method: "GET",
|
|
2802
|
+
baseUrl: this.baseUrl,
|
|
2803
|
+
path: `${MODEL_SEC_SCANS_PATH}/${uuid}`,
|
|
2804
|
+
oauthClient: this.oauthClient,
|
|
2805
|
+
numRetries: this.numRetries
|
|
2806
|
+
});
|
|
2807
|
+
return res.data;
|
|
2808
|
+
}
|
|
2809
|
+
/**
|
|
2810
|
+
* Get rule evaluations for a scan.
|
|
2811
|
+
* @param scanUuid - Scan UUID.
|
|
2812
|
+
* @param opts - Pagination options.
|
|
2813
|
+
* @returns Paginated list of rule evaluations.
|
|
2814
|
+
*/
|
|
2815
|
+
async getEvaluations(scanUuid, opts) {
|
|
2816
|
+
if (!isValidUuid(scanUuid)) {
|
|
2817
|
+
throw new AISecSDKException(
|
|
2818
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
2819
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2820
|
+
);
|
|
2821
|
+
}
|
|
2822
|
+
const res = await managementHttpRequest({
|
|
2823
|
+
method: "GET",
|
|
2824
|
+
baseUrl: this.baseUrl,
|
|
2825
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/evaluations`,
|
|
2826
|
+
params: buildListParams(opts),
|
|
2827
|
+
oauthClient: this.oauthClient,
|
|
2828
|
+
numRetries: this.numRetries
|
|
2829
|
+
});
|
|
2830
|
+
return res.data;
|
|
2831
|
+
}
|
|
2832
|
+
/**
|
|
2833
|
+
* Get files for a scan.
|
|
2834
|
+
* @param scanUuid - Scan UUID.
|
|
2835
|
+
* @param opts - Pagination and file filter options.
|
|
2836
|
+
* @returns Paginated list of files.
|
|
2837
|
+
*/
|
|
2838
|
+
async getFiles(scanUuid, opts) {
|
|
2839
|
+
if (!isValidUuid(scanUuid)) {
|
|
2840
|
+
throw new AISecSDKException(
|
|
2841
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
2842
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2843
|
+
);
|
|
2844
|
+
}
|
|
2845
|
+
const params = buildListParams(opts);
|
|
2846
|
+
if (opts?.type !== void 0) params.type = opts.type;
|
|
2847
|
+
if (opts?.result !== void 0) params.result = opts.result;
|
|
2848
|
+
const res = await managementHttpRequest({
|
|
2849
|
+
method: "GET",
|
|
2850
|
+
baseUrl: this.baseUrl,
|
|
2851
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/files`,
|
|
2852
|
+
params,
|
|
2853
|
+
oauthClient: this.oauthClient,
|
|
2854
|
+
numRetries: this.numRetries
|
|
2855
|
+
});
|
|
2856
|
+
return res.data;
|
|
2857
|
+
}
|
|
2858
|
+
/**
|
|
2859
|
+
* Add labels to a scan (merge with existing).
|
|
2860
|
+
* @param scanUuid - Scan UUID.
|
|
2861
|
+
* @param request - Labels to add.
|
|
2862
|
+
* @returns Labels response.
|
|
2863
|
+
*/
|
|
2864
|
+
async addLabels(scanUuid, request) {
|
|
2865
|
+
if (!isValidUuid(scanUuid)) {
|
|
2866
|
+
throw new AISecSDKException(
|
|
2867
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
2868
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2869
|
+
);
|
|
2870
|
+
}
|
|
2871
|
+
const res = await managementHttpRequest({
|
|
2872
|
+
method: "POST",
|
|
2873
|
+
baseUrl: this.baseUrl,
|
|
2874
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels`,
|
|
2875
|
+
body: request,
|
|
2876
|
+
oauthClient: this.oauthClient,
|
|
2877
|
+
numRetries: this.numRetries
|
|
2878
|
+
});
|
|
2879
|
+
return res.data;
|
|
2880
|
+
}
|
|
2881
|
+
/**
|
|
2882
|
+
* Set labels on a scan (replace all existing).
|
|
2883
|
+
* @param scanUuid - Scan UUID.
|
|
2884
|
+
* @param request - Labels to set.
|
|
2885
|
+
* @returns Labels response.
|
|
2886
|
+
*/
|
|
2887
|
+
async setLabels(scanUuid, request) {
|
|
2888
|
+
if (!isValidUuid(scanUuid)) {
|
|
2889
|
+
throw new AISecSDKException(
|
|
2890
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
2891
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2892
|
+
);
|
|
2893
|
+
}
|
|
2894
|
+
const res = await managementHttpRequest({
|
|
2895
|
+
method: "PUT",
|
|
2896
|
+
baseUrl: this.baseUrl,
|
|
2897
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels`,
|
|
2898
|
+
body: request,
|
|
2899
|
+
oauthClient: this.oauthClient,
|
|
2900
|
+
numRetries: this.numRetries
|
|
2901
|
+
});
|
|
2902
|
+
return res.data;
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* Delete labels from a scan by key.
|
|
2906
|
+
* @param scanUuid - Scan UUID.
|
|
2907
|
+
* @param keys - Label keys to delete.
|
|
2908
|
+
*/
|
|
2909
|
+
async deleteLabels(scanUuid, keys) {
|
|
2910
|
+
if (!isValidUuid(scanUuid)) {
|
|
2911
|
+
throw new AISecSDKException(
|
|
2912
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
2913
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2914
|
+
);
|
|
2915
|
+
}
|
|
2916
|
+
const url = new URL(`https://placeholder${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels`);
|
|
2917
|
+
for (const key of keys) {
|
|
2918
|
+
url.searchParams.append("keys", key);
|
|
2919
|
+
}
|
|
2920
|
+
const queryString = url.searchParams.toString();
|
|
2921
|
+
const pathWithQuery = `${MODEL_SEC_SCANS_PATH}/${scanUuid}/labels${queryString ? `?${queryString}` : ""}`;
|
|
2922
|
+
await managementHttpRequest({
|
|
2923
|
+
method: "DELETE",
|
|
2924
|
+
baseUrl: this.baseUrl,
|
|
2925
|
+
path: pathWithQuery,
|
|
2926
|
+
oauthClient: this.oauthClient,
|
|
2927
|
+
numRetries: this.numRetries
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
/**
|
|
2931
|
+
* Get rule violations for a scan.
|
|
2932
|
+
* @param scanUuid - Scan UUID.
|
|
2933
|
+
* @param opts - Pagination options.
|
|
2934
|
+
* @returns Paginated list of violations.
|
|
2935
|
+
*/
|
|
2936
|
+
async getViolations(scanUuid, opts) {
|
|
2937
|
+
if (!isValidUuid(scanUuid)) {
|
|
2938
|
+
throw new AISecSDKException(
|
|
2939
|
+
`Invalid scan uuid: ${scanUuid}`,
|
|
2940
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2941
|
+
);
|
|
2942
|
+
}
|
|
2943
|
+
const res = await managementHttpRequest({
|
|
2944
|
+
method: "GET",
|
|
2945
|
+
baseUrl: this.baseUrl,
|
|
2946
|
+
path: `${MODEL_SEC_SCANS_PATH}/${scanUuid}/rule-violations`,
|
|
2947
|
+
params: buildListParams(opts),
|
|
2948
|
+
oauthClient: this.oauthClient,
|
|
2949
|
+
numRetries: this.numRetries
|
|
2950
|
+
});
|
|
2951
|
+
return res.data;
|
|
2952
|
+
}
|
|
2953
|
+
/**
|
|
2954
|
+
* Get distinct label keys across all scans.
|
|
2955
|
+
* @param opts - Pagination options.
|
|
2956
|
+
* @returns Paginated list of label keys.
|
|
2957
|
+
*/
|
|
2958
|
+
async getLabelKeys(opts) {
|
|
2959
|
+
const res = await managementHttpRequest({
|
|
2960
|
+
method: "GET",
|
|
2961
|
+
baseUrl: this.baseUrl,
|
|
2962
|
+
path: `${MODEL_SEC_SCANS_PATH}/label-keys`,
|
|
2963
|
+
params: buildListParams(opts),
|
|
2964
|
+
oauthClient: this.oauthClient,
|
|
2965
|
+
numRetries: this.numRetries
|
|
2966
|
+
});
|
|
2967
|
+
return res.data;
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Get distinct values for a label key.
|
|
2971
|
+
* @param key - Label key to get values for.
|
|
2972
|
+
* @param opts - Pagination options.
|
|
2973
|
+
* @returns Paginated list of label values.
|
|
2974
|
+
*/
|
|
2975
|
+
async getLabelValues(key, opts) {
|
|
2976
|
+
const res = await managementHttpRequest({
|
|
2977
|
+
method: "GET",
|
|
2978
|
+
baseUrl: this.baseUrl,
|
|
2979
|
+
path: `${MODEL_SEC_SCANS_PATH}/label-keys/${encodeURIComponent(key)}/values`,
|
|
2980
|
+
params: buildListParams(opts),
|
|
2981
|
+
oauthClient: this.oauthClient,
|
|
2982
|
+
numRetries: this.numRetries
|
|
2983
|
+
});
|
|
2984
|
+
return res.data;
|
|
2985
|
+
}
|
|
2986
|
+
/**
|
|
2987
|
+
* Get a single rule evaluation by UUID.
|
|
2988
|
+
* @param uuid - Evaluation UUID.
|
|
2989
|
+
* @returns The rule evaluation response.
|
|
2990
|
+
*/
|
|
2991
|
+
async getEvaluation(uuid) {
|
|
2992
|
+
if (!isValidUuid(uuid)) {
|
|
2993
|
+
throw new AISecSDKException(
|
|
2994
|
+
`Invalid evaluation uuid: ${uuid}`,
|
|
2995
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
2996
|
+
);
|
|
2997
|
+
}
|
|
2998
|
+
const res = await managementHttpRequest({
|
|
2999
|
+
method: "GET",
|
|
3000
|
+
baseUrl: this.baseUrl,
|
|
3001
|
+
path: `${MODEL_SEC_EVALUATIONS_PATH}/${uuid}`,
|
|
3002
|
+
oauthClient: this.oauthClient,
|
|
3003
|
+
numRetries: this.numRetries
|
|
3004
|
+
});
|
|
3005
|
+
return res.data;
|
|
3006
|
+
}
|
|
3007
|
+
/**
|
|
3008
|
+
* Get a single violation by UUID.
|
|
3009
|
+
* @param uuid - Violation UUID.
|
|
3010
|
+
* @returns The violation response.
|
|
3011
|
+
*/
|
|
3012
|
+
async getViolation(uuid) {
|
|
3013
|
+
if (!isValidUuid(uuid)) {
|
|
3014
|
+
throw new AISecSDKException(
|
|
3015
|
+
`Invalid violation uuid: ${uuid}`,
|
|
3016
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3017
|
+
);
|
|
3018
|
+
}
|
|
3019
|
+
const res = await managementHttpRequest({
|
|
3020
|
+
method: "GET",
|
|
3021
|
+
baseUrl: this.baseUrl,
|
|
3022
|
+
path: `${MODEL_SEC_VIOLATIONS_PATH}/${uuid}`,
|
|
3023
|
+
oauthClient: this.oauthClient,
|
|
3024
|
+
numRetries: this.numRetries
|
|
3025
|
+
});
|
|
3026
|
+
return res.data;
|
|
3027
|
+
}
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
// src/model-security/security-groups-client.ts
|
|
3031
|
+
function buildListParams2(opts) {
|
|
3032
|
+
const params = {};
|
|
3033
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3034
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3035
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3036
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3037
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3038
|
+
return params;
|
|
3039
|
+
}
|
|
3040
|
+
var ModelSecurityGroupsClient = class {
|
|
3041
|
+
baseUrl;
|
|
3042
|
+
oauthClient;
|
|
3043
|
+
numRetries;
|
|
3044
|
+
constructor(opts) {
|
|
3045
|
+
this.baseUrl = opts.baseUrl;
|
|
3046
|
+
this.oauthClient = opts.oauthClient;
|
|
3047
|
+
this.numRetries = opts.numRetries;
|
|
3048
|
+
}
|
|
3049
|
+
/**
|
|
3050
|
+
* Create a new security group.
|
|
3051
|
+
* @param request - Security group creation request.
|
|
3052
|
+
* @returns The created security group.
|
|
3053
|
+
*/
|
|
3054
|
+
async create(request) {
|
|
3055
|
+
const res = await managementHttpRequest({
|
|
3056
|
+
method: "POST",
|
|
3057
|
+
baseUrl: this.baseUrl,
|
|
3058
|
+
path: MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
3059
|
+
body: request,
|
|
3060
|
+
oauthClient: this.oauthClient,
|
|
3061
|
+
numRetries: this.numRetries
|
|
3062
|
+
});
|
|
3063
|
+
return res.data;
|
|
3064
|
+
}
|
|
3065
|
+
/**
|
|
3066
|
+
* List security groups with optional filters.
|
|
3067
|
+
* @param opts - Pagination and filter options.
|
|
3068
|
+
* @returns Paginated list of security groups.
|
|
3069
|
+
*/
|
|
3070
|
+
async list(opts) {
|
|
3071
|
+
const res = await managementHttpRequest({
|
|
3072
|
+
method: "GET",
|
|
3073
|
+
baseUrl: this.baseUrl,
|
|
3074
|
+
path: MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
3075
|
+
params: buildListParams2(opts),
|
|
3076
|
+
oauthClient: this.oauthClient,
|
|
3077
|
+
numRetries: this.numRetries
|
|
3078
|
+
});
|
|
3079
|
+
return res.data;
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Get a single security group by UUID.
|
|
3083
|
+
* @param uuid - Security group UUID.
|
|
3084
|
+
* @returns The security group.
|
|
3085
|
+
*/
|
|
3086
|
+
async get(uuid) {
|
|
3087
|
+
if (!isValidUuid(uuid)) {
|
|
3088
|
+
throw new AISecSDKException(
|
|
3089
|
+
`Invalid security group uuid: ${uuid}`,
|
|
3090
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3091
|
+
);
|
|
3092
|
+
}
|
|
3093
|
+
const res = await managementHttpRequest({
|
|
3094
|
+
method: "GET",
|
|
3095
|
+
baseUrl: this.baseUrl,
|
|
3096
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
|
|
3097
|
+
oauthClient: this.oauthClient,
|
|
3098
|
+
numRetries: this.numRetries
|
|
3099
|
+
});
|
|
3100
|
+
return res.data;
|
|
3101
|
+
}
|
|
3102
|
+
/**
|
|
3103
|
+
* Update an existing security group.
|
|
3104
|
+
* @param uuid - Security group UUID.
|
|
3105
|
+
* @param request - Updated security group fields.
|
|
3106
|
+
* @returns The updated security group.
|
|
3107
|
+
*/
|
|
3108
|
+
async update(uuid, request) {
|
|
3109
|
+
if (!isValidUuid(uuid)) {
|
|
3110
|
+
throw new AISecSDKException(
|
|
3111
|
+
`Invalid security group uuid: ${uuid}`,
|
|
3112
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3113
|
+
);
|
|
3114
|
+
}
|
|
3115
|
+
const res = await managementHttpRequest({
|
|
3116
|
+
method: "PUT",
|
|
3117
|
+
baseUrl: this.baseUrl,
|
|
3118
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
|
|
3119
|
+
body: request,
|
|
3120
|
+
oauthClient: this.oauthClient,
|
|
3121
|
+
numRetries: this.numRetries
|
|
3122
|
+
});
|
|
3123
|
+
return res.data;
|
|
3124
|
+
}
|
|
3125
|
+
/**
|
|
3126
|
+
* Delete a security group.
|
|
3127
|
+
* @param uuid - Security group UUID.
|
|
3128
|
+
*/
|
|
3129
|
+
async delete(uuid) {
|
|
3130
|
+
if (!isValidUuid(uuid)) {
|
|
3131
|
+
throw new AISecSDKException(
|
|
3132
|
+
`Invalid security group uuid: ${uuid}`,
|
|
3133
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3134
|
+
);
|
|
3135
|
+
}
|
|
3136
|
+
await managementHttpRequest({
|
|
3137
|
+
method: "DELETE",
|
|
3138
|
+
baseUrl: this.baseUrl,
|
|
3139
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${uuid}`,
|
|
3140
|
+
oauthClient: this.oauthClient,
|
|
3141
|
+
numRetries: this.numRetries
|
|
3142
|
+
});
|
|
3143
|
+
}
|
|
3144
|
+
/**
|
|
3145
|
+
* List rule instances for a security group.
|
|
3146
|
+
* @param securityGroupUuid - Security group UUID.
|
|
3147
|
+
* @param opts - Pagination options.
|
|
3148
|
+
* @returns Paginated list of rule instances.
|
|
3149
|
+
*/
|
|
3150
|
+
async listRuleInstances(securityGroupUuid, opts) {
|
|
3151
|
+
if (!isValidUuid(securityGroupUuid)) {
|
|
3152
|
+
throw new AISecSDKException(
|
|
3153
|
+
`Invalid security group uuid: ${securityGroupUuid}`,
|
|
3154
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3155
|
+
);
|
|
3156
|
+
}
|
|
3157
|
+
const res = await managementHttpRequest({
|
|
3158
|
+
method: "GET",
|
|
3159
|
+
baseUrl: this.baseUrl,
|
|
3160
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances`,
|
|
3161
|
+
params: buildListParams2(opts),
|
|
3162
|
+
oauthClient: this.oauthClient,
|
|
3163
|
+
numRetries: this.numRetries
|
|
3164
|
+
});
|
|
3165
|
+
return res.data;
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* Get a single rule instance within a security group.
|
|
3169
|
+
* @param securityGroupUuid - Security group UUID.
|
|
3170
|
+
* @param ruleInstanceUuid - Rule instance UUID.
|
|
3171
|
+
* @returns The rule instance.
|
|
3172
|
+
*/
|
|
3173
|
+
async getRuleInstance(securityGroupUuid, ruleInstanceUuid) {
|
|
3174
|
+
if (!isValidUuid(securityGroupUuid)) {
|
|
3175
|
+
throw new AISecSDKException(
|
|
3176
|
+
`Invalid security group uuid: ${securityGroupUuid}`,
|
|
3177
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3178
|
+
);
|
|
3179
|
+
}
|
|
3180
|
+
if (!isValidUuid(ruleInstanceUuid)) {
|
|
3181
|
+
throw new AISecSDKException(
|
|
3182
|
+
`Invalid rule instance uuid: ${ruleInstanceUuid}`,
|
|
3183
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3184
|
+
);
|
|
3185
|
+
}
|
|
3186
|
+
const res = await managementHttpRequest({
|
|
3187
|
+
method: "GET",
|
|
3188
|
+
baseUrl: this.baseUrl,
|
|
3189
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances/${ruleInstanceUuid}`,
|
|
3190
|
+
oauthClient: this.oauthClient,
|
|
3191
|
+
numRetries: this.numRetries
|
|
3192
|
+
});
|
|
3193
|
+
return res.data;
|
|
3194
|
+
}
|
|
3195
|
+
/**
|
|
3196
|
+
* Update a rule instance within a security group.
|
|
3197
|
+
* @param securityGroupUuid - Security group UUID.
|
|
3198
|
+
* @param ruleInstanceUuid - Rule instance UUID.
|
|
3199
|
+
* @param request - Updated rule instance fields.
|
|
3200
|
+
* @returns The updated rule instance.
|
|
3201
|
+
*/
|
|
3202
|
+
async updateRuleInstance(securityGroupUuid, ruleInstanceUuid, request) {
|
|
3203
|
+
if (!isValidUuid(securityGroupUuid)) {
|
|
3204
|
+
throw new AISecSDKException(
|
|
3205
|
+
`Invalid security group uuid: ${securityGroupUuid}`,
|
|
3206
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3207
|
+
);
|
|
3208
|
+
}
|
|
3209
|
+
if (!isValidUuid(ruleInstanceUuid)) {
|
|
3210
|
+
throw new AISecSDKException(
|
|
3211
|
+
`Invalid rule instance uuid: ${ruleInstanceUuid}`,
|
|
3212
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3213
|
+
);
|
|
3214
|
+
}
|
|
3215
|
+
const res = await managementHttpRequest({
|
|
3216
|
+
method: "PUT",
|
|
3217
|
+
baseUrl: this.baseUrl,
|
|
3218
|
+
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances/${ruleInstanceUuid}`,
|
|
3219
|
+
body: request,
|
|
3220
|
+
oauthClient: this.oauthClient,
|
|
3221
|
+
numRetries: this.numRetries
|
|
3222
|
+
});
|
|
3223
|
+
return res.data;
|
|
3224
|
+
}
|
|
3225
|
+
};
|
|
3226
|
+
|
|
3227
|
+
// src/model-security/security-rules-client.ts
|
|
3228
|
+
function buildListParams3(opts) {
|
|
3229
|
+
const params = {};
|
|
3230
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3231
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3232
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3233
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3234
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3235
|
+
return params;
|
|
3236
|
+
}
|
|
3237
|
+
var ModelSecurityRulesClient = class {
|
|
3238
|
+
baseUrl;
|
|
3239
|
+
oauthClient;
|
|
3240
|
+
numRetries;
|
|
3241
|
+
constructor(opts) {
|
|
3242
|
+
this.baseUrl = opts.baseUrl;
|
|
3243
|
+
this.oauthClient = opts.oauthClient;
|
|
3244
|
+
this.numRetries = opts.numRetries;
|
|
3245
|
+
}
|
|
3246
|
+
/**
|
|
3247
|
+
* List available security rules.
|
|
3248
|
+
* @param opts - Pagination options.
|
|
3249
|
+
* @returns Paginated list of security rules.
|
|
3250
|
+
*/
|
|
3251
|
+
async list(opts) {
|
|
3252
|
+
const res = await managementHttpRequest({
|
|
3253
|
+
method: "GET",
|
|
3254
|
+
baseUrl: this.baseUrl,
|
|
3255
|
+
path: MODEL_SEC_SECURITY_RULES_PATH,
|
|
3256
|
+
params: buildListParams3(opts),
|
|
3257
|
+
oauthClient: this.oauthClient,
|
|
3258
|
+
numRetries: this.numRetries
|
|
3259
|
+
});
|
|
3260
|
+
return res.data;
|
|
3261
|
+
}
|
|
3262
|
+
/**
|
|
3263
|
+
* Get a single security rule by UUID.
|
|
3264
|
+
* @param uuid - Security rule UUID.
|
|
3265
|
+
* @returns The security rule.
|
|
3266
|
+
*/
|
|
3267
|
+
async get(uuid) {
|
|
3268
|
+
if (!isValidUuid(uuid)) {
|
|
3269
|
+
throw new AISecSDKException(
|
|
3270
|
+
`Invalid security rule uuid: ${uuid}`,
|
|
3271
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3272
|
+
);
|
|
3273
|
+
}
|
|
3274
|
+
const res = await managementHttpRequest({
|
|
3275
|
+
method: "GET",
|
|
3276
|
+
baseUrl: this.baseUrl,
|
|
3277
|
+
path: `${MODEL_SEC_SECURITY_RULES_PATH}/${uuid}`,
|
|
3278
|
+
oauthClient: this.oauthClient,
|
|
3279
|
+
numRetries: this.numRetries
|
|
3280
|
+
});
|
|
3281
|
+
return res.data;
|
|
3282
|
+
}
|
|
3283
|
+
};
|
|
3284
|
+
|
|
3285
|
+
// src/model-security/client.ts
|
|
3286
|
+
var ModelSecurityClient = class {
|
|
3287
|
+
/** Data plane scan operations. */
|
|
3288
|
+
scans;
|
|
3289
|
+
/** Management plane security group operations. */
|
|
3290
|
+
securityGroups;
|
|
3291
|
+
/** Management plane security rule operations (read-only). */
|
|
3292
|
+
securityRules;
|
|
3293
|
+
mgmtEndpoint;
|
|
3294
|
+
oauthClient;
|
|
3295
|
+
numRetries;
|
|
3296
|
+
constructor(opts = {}) {
|
|
3297
|
+
const clientId = opts.clientId ?? process.env[MODEL_SEC_CLIENT_ID] ?? process.env[MGMT_CLIENT_ID];
|
|
3298
|
+
const clientSecret = opts.clientSecret ?? process.env[MODEL_SEC_CLIENT_SECRET] ?? process.env[MGMT_CLIENT_SECRET];
|
|
3299
|
+
const tsgId = opts.tsgId ?? process.env[MODEL_SEC_TSG_ID] ?? process.env[MGMT_TSG_ID];
|
|
3300
|
+
const dataEndpoint = opts.dataEndpoint ?? process.env[MODEL_SEC_DATA_ENDPOINT] ?? DEFAULT_MODEL_SEC_DATA_ENDPOINT;
|
|
3301
|
+
const mgmtEndpoint = opts.mgmtEndpoint ?? process.env[MODEL_SEC_MGMT_ENDPOINT] ?? DEFAULT_MODEL_SEC_MGMT_ENDPOINT;
|
|
3302
|
+
const tokenEndpoint = opts.tokenEndpoint ?? process.env[MODEL_SEC_TOKEN_ENDPOINT] ?? process.env[MGMT_TOKEN_ENDPOINT];
|
|
3303
|
+
const numRetries = Math.min(
|
|
3304
|
+
Math.max(opts.numRetries ?? MAX_NUMBER_OF_RETRIES, 0),
|
|
3305
|
+
MAX_NUMBER_OF_RETRIES
|
|
3306
|
+
);
|
|
3307
|
+
if (!clientId) {
|
|
3308
|
+
throw new AISecSDKException(
|
|
3309
|
+
"clientId is required (option or PANW_MODEL_SEC_CLIENT_ID / PANW_MGMT_CLIENT_ID env var)",
|
|
3310
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
3311
|
+
);
|
|
3312
|
+
}
|
|
3313
|
+
if (!clientSecret) {
|
|
3314
|
+
throw new AISecSDKException(
|
|
3315
|
+
"clientSecret is required (option or PANW_MODEL_SEC_CLIENT_SECRET / PANW_MGMT_CLIENT_SECRET env var)",
|
|
3316
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
3317
|
+
);
|
|
3318
|
+
}
|
|
3319
|
+
if (!tsgId) {
|
|
3320
|
+
throw new AISecSDKException(
|
|
3321
|
+
"tsgId is required (option or PANW_MODEL_SEC_TSG_ID / PANW_MGMT_TSG_ID env var)",
|
|
3322
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
3323
|
+
);
|
|
3324
|
+
}
|
|
3325
|
+
this.oauthClient = new OAuthClient({
|
|
3326
|
+
clientId,
|
|
3327
|
+
clientSecret,
|
|
3328
|
+
tsgId,
|
|
3329
|
+
tokenEndpoint
|
|
3330
|
+
});
|
|
3331
|
+
this.mgmtEndpoint = mgmtEndpoint;
|
|
3332
|
+
this.numRetries = numRetries;
|
|
3333
|
+
this.scans = new ModelSecurityScansClient({
|
|
3334
|
+
baseUrl: dataEndpoint,
|
|
3335
|
+
oauthClient: this.oauthClient,
|
|
3336
|
+
numRetries
|
|
3337
|
+
});
|
|
3338
|
+
this.securityGroups = new ModelSecurityGroupsClient({
|
|
3339
|
+
baseUrl: mgmtEndpoint,
|
|
3340
|
+
oauthClient: this.oauthClient,
|
|
3341
|
+
numRetries
|
|
3342
|
+
});
|
|
3343
|
+
this.securityRules = new ModelSecurityRulesClient({
|
|
3344
|
+
baseUrl: mgmtEndpoint,
|
|
3345
|
+
oauthClient: this.oauthClient,
|
|
3346
|
+
numRetries
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
/**
|
|
3350
|
+
* Get PyPI authentication credentials for Google Artifact Registry.
|
|
3351
|
+
* @returns PyPI auth response with URL and expiration.
|
|
3352
|
+
*/
|
|
3353
|
+
async getPyPIAuth() {
|
|
3354
|
+
const res = await managementHttpRequest({
|
|
3355
|
+
method: "GET",
|
|
3356
|
+
baseUrl: this.mgmtEndpoint,
|
|
3357
|
+
path: MODEL_SEC_PYPI_AUTH_PATH,
|
|
3358
|
+
oauthClient: this.oauthClient,
|
|
3359
|
+
numRetries: this.numRetries
|
|
3360
|
+
});
|
|
3361
|
+
return res.data;
|
|
3362
|
+
}
|
|
3363
|
+
};
|
|
3364
|
+
|
|
3365
|
+
// src/red-team/scans-client.ts
|
|
3366
|
+
function buildListParams4(opts) {
|
|
3367
|
+
const params = {};
|
|
3368
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3369
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3370
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3371
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3372
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3373
|
+
return params;
|
|
3374
|
+
}
|
|
3375
|
+
var RedTeamScansClient = class {
|
|
3376
|
+
baseUrl;
|
|
3377
|
+
oauthClient;
|
|
3378
|
+
numRetries;
|
|
3379
|
+
constructor(opts) {
|
|
3380
|
+
this.baseUrl = opts.baseUrl;
|
|
3381
|
+
this.oauthClient = opts.oauthClient;
|
|
3382
|
+
this.numRetries = opts.numRetries;
|
|
3383
|
+
}
|
|
3384
|
+
/** Create a new red team scan job. */
|
|
3385
|
+
async create(request) {
|
|
3386
|
+
const res = await managementHttpRequest({
|
|
3387
|
+
method: "POST",
|
|
3388
|
+
baseUrl: this.baseUrl,
|
|
3389
|
+
path: RED_TEAM_SCAN_PATH,
|
|
3390
|
+
body: request,
|
|
3391
|
+
oauthClient: this.oauthClient,
|
|
3392
|
+
numRetries: this.numRetries
|
|
3393
|
+
});
|
|
3394
|
+
return res.data;
|
|
3395
|
+
}
|
|
3396
|
+
/** List red team scan jobs with optional filters. */
|
|
3397
|
+
async list(opts) {
|
|
3398
|
+
const params = buildListParams4(opts);
|
|
3399
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
3400
|
+
if (opts?.job_type !== void 0) params.job_type = opts.job_type;
|
|
3401
|
+
if (opts?.target_id !== void 0) params.target_id = opts.target_id;
|
|
3402
|
+
const res = await managementHttpRequest({
|
|
3403
|
+
method: "GET",
|
|
3404
|
+
baseUrl: this.baseUrl,
|
|
3405
|
+
path: RED_TEAM_SCAN_PATH,
|
|
3406
|
+
params,
|
|
3407
|
+
oauthClient: this.oauthClient,
|
|
3408
|
+
numRetries: this.numRetries
|
|
3409
|
+
});
|
|
3410
|
+
return res.data;
|
|
3411
|
+
}
|
|
3412
|
+
/** Get a single scan job by ID. */
|
|
3413
|
+
async get(jobId) {
|
|
3414
|
+
if (!isValidUuid(jobId)) {
|
|
3415
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3416
|
+
}
|
|
3417
|
+
const res = await managementHttpRequest({
|
|
3418
|
+
method: "GET",
|
|
3419
|
+
baseUrl: this.baseUrl,
|
|
3420
|
+
path: `${RED_TEAM_SCAN_PATH}/${jobId}`,
|
|
3421
|
+
oauthClient: this.oauthClient,
|
|
3422
|
+
numRetries: this.numRetries
|
|
3423
|
+
});
|
|
3424
|
+
return res.data;
|
|
3425
|
+
}
|
|
3426
|
+
/** Abort a running scan job. */
|
|
3427
|
+
async abort(jobId) {
|
|
3428
|
+
if (!isValidUuid(jobId)) {
|
|
3429
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3430
|
+
}
|
|
3431
|
+
const res = await managementHttpRequest({
|
|
3432
|
+
method: "POST",
|
|
3433
|
+
baseUrl: this.baseUrl,
|
|
3434
|
+
path: `${RED_TEAM_SCAN_PATH}/${jobId}/abort`,
|
|
3435
|
+
oauthClient: this.oauthClient,
|
|
3436
|
+
numRetries: this.numRetries
|
|
3437
|
+
});
|
|
3438
|
+
return res.data;
|
|
3439
|
+
}
|
|
3440
|
+
/** Get all categories with subcategories. */
|
|
3441
|
+
async getCategories() {
|
|
3442
|
+
const res = await managementHttpRequest({
|
|
3443
|
+
method: "GET",
|
|
3444
|
+
baseUrl: this.baseUrl,
|
|
3445
|
+
path: RED_TEAM_CATEGORIES_PATH,
|
|
3446
|
+
oauthClient: this.oauthClient,
|
|
3447
|
+
numRetries: this.numRetries
|
|
3448
|
+
});
|
|
3449
|
+
return res.data;
|
|
3450
|
+
}
|
|
3451
|
+
};
|
|
3452
|
+
|
|
3453
|
+
// src/red-team/reports-client.ts
|
|
3454
|
+
function buildListParams5(opts) {
|
|
3455
|
+
const params = {};
|
|
3456
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3457
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3458
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3459
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3460
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3461
|
+
return params;
|
|
3462
|
+
}
|
|
3463
|
+
function validateJobId(jobId) {
|
|
3464
|
+
if (!isValidUuid(jobId)) {
|
|
3465
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
var RedTeamReportsClient = class {
|
|
3469
|
+
baseUrl;
|
|
3470
|
+
oauthClient;
|
|
3471
|
+
numRetries;
|
|
3472
|
+
constructor(opts) {
|
|
3473
|
+
this.baseUrl = opts.baseUrl;
|
|
3474
|
+
this.oauthClient = opts.oauthClient;
|
|
3475
|
+
this.numRetries = opts.numRetries;
|
|
3476
|
+
}
|
|
3477
|
+
// -----------------------------------------------------------------------
|
|
3478
|
+
// Static (attack library) report endpoints
|
|
3479
|
+
// -----------------------------------------------------------------------
|
|
3480
|
+
/** List attacks for a static scan. */
|
|
3481
|
+
async listAttacks(jobId, opts) {
|
|
3482
|
+
validateJobId(jobId);
|
|
3483
|
+
const params = buildListParams5(opts);
|
|
3484
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
3485
|
+
if (opts?.severity !== void 0) params.severity = opts.severity;
|
|
3486
|
+
if (opts?.category !== void 0) params.category = opts.category;
|
|
3487
|
+
if (opts?.sub_category !== void 0) params.sub_category = opts.sub_category;
|
|
3488
|
+
const res = await managementHttpRequest({
|
|
3489
|
+
method: "GET",
|
|
3490
|
+
baseUrl: this.baseUrl,
|
|
3491
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/list-attacks`,
|
|
3492
|
+
params,
|
|
3493
|
+
oauthClient: this.oauthClient,
|
|
3494
|
+
numRetries: this.numRetries
|
|
3495
|
+
});
|
|
3496
|
+
return res.data;
|
|
3497
|
+
}
|
|
3498
|
+
/** Get attack details for a static scan. */
|
|
3499
|
+
async getAttackDetail(jobId, attackId) {
|
|
3500
|
+
validateJobId(jobId);
|
|
3501
|
+
if (!isValidUuid(attackId)) {
|
|
3502
|
+
throw new AISecSDKException(
|
|
3503
|
+
`Invalid attack id: ${attackId}`,
|
|
3504
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3505
|
+
);
|
|
3506
|
+
}
|
|
3507
|
+
const res = await managementHttpRequest({
|
|
3508
|
+
method: "GET",
|
|
3509
|
+
baseUrl: this.baseUrl,
|
|
3510
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/attack/${attackId}`,
|
|
3511
|
+
oauthClient: this.oauthClient,
|
|
3512
|
+
numRetries: this.numRetries
|
|
3513
|
+
});
|
|
3514
|
+
return res.data;
|
|
3515
|
+
}
|
|
3516
|
+
/** Get multi-turn attack details for a static scan. */
|
|
3517
|
+
async getMultiTurnAttackDetail(jobId, attackId) {
|
|
3518
|
+
validateJobId(jobId);
|
|
3519
|
+
if (!isValidUuid(attackId)) {
|
|
3520
|
+
throw new AISecSDKException(
|
|
3521
|
+
`Invalid attack id: ${attackId}`,
|
|
3522
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3523
|
+
);
|
|
3524
|
+
}
|
|
3525
|
+
const res = await managementHttpRequest({
|
|
3526
|
+
method: "GET",
|
|
3527
|
+
baseUrl: this.baseUrl,
|
|
3528
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/attack-multi-turn/${attackId}`,
|
|
3529
|
+
oauthClient: this.oauthClient,
|
|
3530
|
+
numRetries: this.numRetries
|
|
3531
|
+
});
|
|
3532
|
+
return res.data;
|
|
3533
|
+
}
|
|
3534
|
+
/** Get the attack library report for a static scan. */
|
|
3535
|
+
async getStaticReport(jobId) {
|
|
3536
|
+
validateJobId(jobId);
|
|
3537
|
+
const res = await managementHttpRequest({
|
|
3538
|
+
method: "GET",
|
|
3539
|
+
baseUrl: this.baseUrl,
|
|
3540
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/report`,
|
|
3541
|
+
oauthClient: this.oauthClient,
|
|
3542
|
+
numRetries: this.numRetries
|
|
3543
|
+
});
|
|
3544
|
+
return res.data;
|
|
3545
|
+
}
|
|
3546
|
+
/** Get remediation recommendations for a static scan. */
|
|
3547
|
+
async getStaticRemediation(jobId) {
|
|
3548
|
+
validateJobId(jobId);
|
|
3549
|
+
const res = await managementHttpRequest({
|
|
3550
|
+
method: "GET",
|
|
3551
|
+
baseUrl: this.baseUrl,
|
|
3552
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/remediation`,
|
|
3553
|
+
oauthClient: this.oauthClient,
|
|
3554
|
+
numRetries: this.numRetries
|
|
3555
|
+
});
|
|
3556
|
+
return res.data;
|
|
3557
|
+
}
|
|
3558
|
+
/** Get runtime security profile config for a static scan. */
|
|
3559
|
+
async getStaticRuntimePolicy(jobId) {
|
|
3560
|
+
validateJobId(jobId);
|
|
3561
|
+
const res = await managementHttpRequest({
|
|
3562
|
+
method: "GET",
|
|
3563
|
+
baseUrl: this.baseUrl,
|
|
3564
|
+
path: `${RED_TEAM_REPORT_STATIC_PATH}/${jobId}/runtime-policy-config`,
|
|
3565
|
+
oauthClient: this.oauthClient,
|
|
3566
|
+
numRetries: this.numRetries
|
|
3567
|
+
});
|
|
3568
|
+
return res.data;
|
|
3569
|
+
}
|
|
3570
|
+
// -----------------------------------------------------------------------
|
|
3571
|
+
// Dynamic (agent) report endpoints
|
|
3572
|
+
// -----------------------------------------------------------------------
|
|
3573
|
+
/** Get the agent scan report for a dynamic scan. */
|
|
3574
|
+
async getDynamicReport(jobId) {
|
|
3575
|
+
validateJobId(jobId);
|
|
3576
|
+
const res = await managementHttpRequest({
|
|
3577
|
+
method: "GET",
|
|
3578
|
+
baseUrl: this.baseUrl,
|
|
3579
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/report`,
|
|
3580
|
+
oauthClient: this.oauthClient,
|
|
3581
|
+
numRetries: this.numRetries
|
|
3582
|
+
});
|
|
3583
|
+
return res.data;
|
|
3584
|
+
}
|
|
3585
|
+
/** Get remediation recommendations for a dynamic scan. */
|
|
3586
|
+
async getDynamicRemediation(jobId) {
|
|
3587
|
+
validateJobId(jobId);
|
|
3588
|
+
const res = await managementHttpRequest({
|
|
3589
|
+
method: "GET",
|
|
3590
|
+
baseUrl: this.baseUrl,
|
|
3591
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/remediation`,
|
|
3592
|
+
oauthClient: this.oauthClient,
|
|
3593
|
+
numRetries: this.numRetries
|
|
3594
|
+
});
|
|
3595
|
+
return res.data;
|
|
3596
|
+
}
|
|
3597
|
+
/** Get runtime security profile config for a dynamic scan. */
|
|
3598
|
+
async getDynamicRuntimePolicy(jobId) {
|
|
3599
|
+
validateJobId(jobId);
|
|
3600
|
+
const res = await managementHttpRequest({
|
|
3601
|
+
method: "GET",
|
|
3602
|
+
baseUrl: this.baseUrl,
|
|
3603
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/runtime-policy-config`,
|
|
3604
|
+
oauthClient: this.oauthClient,
|
|
3605
|
+
numRetries: this.numRetries
|
|
3606
|
+
});
|
|
3607
|
+
return res.data;
|
|
3608
|
+
}
|
|
3609
|
+
/** List goals for a dynamic scan. */
|
|
3610
|
+
async listGoals(jobId, opts) {
|
|
3611
|
+
validateJobId(jobId);
|
|
3612
|
+
const params = buildListParams5(opts);
|
|
3613
|
+
if (opts?.goal_type !== void 0) params.goal_type = opts.goal_type;
|
|
3614
|
+
const res = await managementHttpRequest({
|
|
3615
|
+
method: "GET",
|
|
3616
|
+
baseUrl: this.baseUrl,
|
|
3617
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/list-goals`,
|
|
3618
|
+
params,
|
|
3619
|
+
oauthClient: this.oauthClient,
|
|
3620
|
+
numRetries: this.numRetries
|
|
3621
|
+
});
|
|
3622
|
+
return res.data;
|
|
3623
|
+
}
|
|
3624
|
+
/** List streams for a goal in a dynamic scan. */
|
|
3625
|
+
async listGoalStreams(jobId, goalId, opts) {
|
|
3626
|
+
validateJobId(jobId);
|
|
3627
|
+
if (!isValidUuid(goalId)) {
|
|
3628
|
+
throw new AISecSDKException(
|
|
3629
|
+
`Invalid goal id: ${goalId}`,
|
|
3630
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3631
|
+
);
|
|
3632
|
+
}
|
|
3633
|
+
const res = await managementHttpRequest({
|
|
3634
|
+
method: "GET",
|
|
3635
|
+
baseUrl: this.baseUrl,
|
|
3636
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/goal/${goalId}/list-streams`,
|
|
3637
|
+
params: buildListParams5(opts),
|
|
3638
|
+
oauthClient: this.oauthClient,
|
|
3639
|
+
numRetries: this.numRetries
|
|
3640
|
+
});
|
|
3641
|
+
return res.data;
|
|
3642
|
+
}
|
|
3643
|
+
// -----------------------------------------------------------------------
|
|
3644
|
+
// Common report endpoints
|
|
3645
|
+
// -----------------------------------------------------------------------
|
|
3646
|
+
/** Get stream details by stream ID. */
|
|
3647
|
+
async getStreamDetail(streamId) {
|
|
3648
|
+
if (!isValidUuid(streamId)) {
|
|
3649
|
+
throw new AISecSDKException(
|
|
3650
|
+
`Invalid stream id: ${streamId}`,
|
|
3651
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3652
|
+
);
|
|
3653
|
+
}
|
|
3654
|
+
const res = await managementHttpRequest({
|
|
3655
|
+
method: "GET",
|
|
3656
|
+
baseUrl: this.baseUrl,
|
|
3657
|
+
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/stream/${streamId}`,
|
|
3658
|
+
oauthClient: this.oauthClient,
|
|
3659
|
+
numRetries: this.numRetries
|
|
3660
|
+
});
|
|
3661
|
+
return res.data;
|
|
3662
|
+
}
|
|
3663
|
+
/** Download a report in the specified format. */
|
|
3664
|
+
async downloadReport(jobId, format) {
|
|
3665
|
+
validateJobId(jobId);
|
|
3666
|
+
const params = {};
|
|
3667
|
+
if (format !== void 0) params.file_format = format;
|
|
3668
|
+
const res = await managementHttpRequest({
|
|
3669
|
+
method: "GET",
|
|
3670
|
+
baseUrl: this.baseUrl,
|
|
3671
|
+
path: `${RED_TEAM_REPORT_PATH}/${jobId}/download`,
|
|
3672
|
+
params,
|
|
3673
|
+
oauthClient: this.oauthClient,
|
|
3674
|
+
numRetries: this.numRetries
|
|
3675
|
+
});
|
|
3676
|
+
return res.data;
|
|
3677
|
+
}
|
|
3678
|
+
/** Generate a partial report for a running scan. */
|
|
3679
|
+
async generatePartialReport(jobId) {
|
|
3680
|
+
validateJobId(jobId);
|
|
3681
|
+
const res = await managementHttpRequest({
|
|
3682
|
+
method: "POST",
|
|
3683
|
+
baseUrl: this.baseUrl,
|
|
3684
|
+
path: `${RED_TEAM_REPORT_PATH}/${jobId}/generate-partial-report`,
|
|
3685
|
+
oauthClient: this.oauthClient,
|
|
3686
|
+
numRetries: this.numRetries
|
|
3687
|
+
});
|
|
3688
|
+
return res.data;
|
|
3689
|
+
}
|
|
3690
|
+
};
|
|
3691
|
+
|
|
3692
|
+
// src/red-team/custom-attack-reports-client.ts
|
|
3693
|
+
function buildListParams6(opts) {
|
|
3694
|
+
const params = {};
|
|
3695
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3696
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3697
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3698
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3699
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3700
|
+
return params;
|
|
3701
|
+
}
|
|
3702
|
+
function validateJobId2(jobId) {
|
|
3703
|
+
if (!isValidUuid(jobId)) {
|
|
3704
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
var RedTeamCustomAttackReportsClient = class {
|
|
3708
|
+
baseUrl;
|
|
3709
|
+
oauthClient;
|
|
3710
|
+
numRetries;
|
|
3711
|
+
constructor(opts) {
|
|
3712
|
+
this.baseUrl = opts.baseUrl;
|
|
3713
|
+
this.oauthClient = opts.oauthClient;
|
|
3714
|
+
this.numRetries = opts.numRetries;
|
|
3715
|
+
}
|
|
3716
|
+
/** Get custom attack report for a scan. */
|
|
3717
|
+
async getReport(jobId) {
|
|
3718
|
+
validateJobId2(jobId);
|
|
3719
|
+
const res = await managementHttpRequest({
|
|
3720
|
+
method: "GET",
|
|
3721
|
+
baseUrl: this.baseUrl,
|
|
3722
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}`,
|
|
3723
|
+
oauthClient: this.oauthClient,
|
|
3724
|
+
numRetries: this.numRetries
|
|
3725
|
+
});
|
|
3726
|
+
return res.data;
|
|
3727
|
+
}
|
|
3728
|
+
/** Get prompt sets for a custom attack scan. */
|
|
3729
|
+
async getPromptSets(jobId) {
|
|
3730
|
+
validateJobId2(jobId);
|
|
3731
|
+
const res = await managementHttpRequest({
|
|
3732
|
+
method: "GET",
|
|
3733
|
+
baseUrl: this.baseUrl,
|
|
3734
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-sets`,
|
|
3735
|
+
oauthClient: this.oauthClient,
|
|
3736
|
+
numRetries: this.numRetries
|
|
3737
|
+
});
|
|
3738
|
+
return res.data;
|
|
3739
|
+
}
|
|
3740
|
+
/** Get prompts for a specific prompt set in a scan. */
|
|
3741
|
+
async getPromptsBySet(jobId, promptSetId, opts) {
|
|
3742
|
+
validateJobId2(jobId);
|
|
3743
|
+
if (!isValidUuid(promptSetId)) {
|
|
3744
|
+
throw new AISecSDKException(
|
|
3745
|
+
`Invalid prompt set id: ${promptSetId}`,
|
|
3746
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3747
|
+
);
|
|
3748
|
+
}
|
|
3749
|
+
const res = await managementHttpRequest({
|
|
3750
|
+
method: "GET",
|
|
3751
|
+
baseUrl: this.baseUrl,
|
|
3752
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
3753
|
+
params: buildListParams6(opts),
|
|
3754
|
+
oauthClient: this.oauthClient,
|
|
3755
|
+
numRetries: this.numRetries
|
|
3756
|
+
});
|
|
3757
|
+
return res.data;
|
|
3758
|
+
}
|
|
3759
|
+
/** Get details for a specific prompt. */
|
|
3760
|
+
async getPromptDetail(jobId, promptId) {
|
|
3761
|
+
validateJobId2(jobId);
|
|
3762
|
+
if (!isValidUuid(promptId)) {
|
|
3763
|
+
throw new AISecSDKException(
|
|
3764
|
+
`Invalid prompt id: ${promptId}`,
|
|
3765
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3766
|
+
);
|
|
3767
|
+
}
|
|
3768
|
+
const res = await managementHttpRequest({
|
|
3769
|
+
method: "GET",
|
|
3770
|
+
baseUrl: this.baseUrl,
|
|
3771
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt/${promptId}`,
|
|
3772
|
+
oauthClient: this.oauthClient,
|
|
3773
|
+
numRetries: this.numRetries
|
|
3774
|
+
});
|
|
3775
|
+
return res.data;
|
|
3776
|
+
}
|
|
3777
|
+
/** List custom attacks for a scan. */
|
|
3778
|
+
async listCustomAttacks(jobId, opts) {
|
|
3779
|
+
validateJobId2(jobId);
|
|
3780
|
+
const res = await managementHttpRequest({
|
|
3781
|
+
method: "GET",
|
|
3782
|
+
baseUrl: this.baseUrl,
|
|
3783
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/list-custom-attacks`,
|
|
3784
|
+
params: buildListParams6(opts),
|
|
3785
|
+
oauthClient: this.oauthClient,
|
|
3786
|
+
numRetries: this.numRetries
|
|
3787
|
+
});
|
|
3788
|
+
return res.data;
|
|
3789
|
+
}
|
|
3790
|
+
/** Get attack outputs for a custom attack. */
|
|
3791
|
+
async getAttackOutputs(jobId, attackId) {
|
|
3792
|
+
validateJobId2(jobId);
|
|
3793
|
+
if (!isValidUuid(attackId)) {
|
|
3794
|
+
throw new AISecSDKException(
|
|
3795
|
+
`Invalid attack id: ${attackId}`,
|
|
3796
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3797
|
+
);
|
|
3798
|
+
}
|
|
3799
|
+
const res = await managementHttpRequest({
|
|
3800
|
+
method: "GET",
|
|
3801
|
+
baseUrl: this.baseUrl,
|
|
3802
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/attack/${attackId}/list-outputs`,
|
|
3803
|
+
oauthClient: this.oauthClient,
|
|
3804
|
+
numRetries: this.numRetries
|
|
3805
|
+
});
|
|
3806
|
+
return res.data;
|
|
3807
|
+
}
|
|
3808
|
+
/** Get property statistics for a custom attack scan. */
|
|
3809
|
+
async getPropertyStats(jobId) {
|
|
3810
|
+
validateJobId2(jobId);
|
|
3811
|
+
const res = await managementHttpRequest({
|
|
3812
|
+
method: "GET",
|
|
3813
|
+
baseUrl: this.baseUrl,
|
|
3814
|
+
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/property-stats`,
|
|
3815
|
+
oauthClient: this.oauthClient,
|
|
3816
|
+
numRetries: this.numRetries
|
|
3817
|
+
});
|
|
3818
|
+
return res.data;
|
|
3819
|
+
}
|
|
3820
|
+
};
|
|
3821
|
+
|
|
3822
|
+
// src/red-team/targets-client.ts
|
|
3823
|
+
function buildListParams7(opts) {
|
|
3824
|
+
const params = {};
|
|
3825
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3826
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3827
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3828
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3829
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3830
|
+
return params;
|
|
3831
|
+
}
|
|
3832
|
+
var RedTeamTargetsClient = class {
|
|
3833
|
+
baseUrl;
|
|
3834
|
+
oauthClient;
|
|
3835
|
+
numRetries;
|
|
3836
|
+
constructor(opts) {
|
|
3837
|
+
this.baseUrl = opts.baseUrl;
|
|
3838
|
+
this.oauthClient = opts.oauthClient;
|
|
3839
|
+
this.numRetries = opts.numRetries;
|
|
3840
|
+
}
|
|
3841
|
+
/** Create a new target. */
|
|
3842
|
+
async create(request) {
|
|
3843
|
+
const res = await managementHttpRequest({
|
|
3844
|
+
method: "POST",
|
|
3845
|
+
baseUrl: this.baseUrl,
|
|
3846
|
+
path: RED_TEAM_TARGET_PATH,
|
|
3847
|
+
body: request,
|
|
3848
|
+
oauthClient: this.oauthClient,
|
|
3849
|
+
numRetries: this.numRetries
|
|
3850
|
+
});
|
|
3851
|
+
return res.data;
|
|
3852
|
+
}
|
|
3853
|
+
/** List targets with optional filters. */
|
|
3854
|
+
async list(opts) {
|
|
3855
|
+
const params = buildListParams7(opts);
|
|
3856
|
+
if (opts?.target_type !== void 0) params.target_type = opts.target_type;
|
|
3857
|
+
if (opts?.status !== void 0) params.status = opts.status;
|
|
3858
|
+
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
3859
|
+
const res = await managementHttpRequest({
|
|
3860
|
+
method: "GET",
|
|
3861
|
+
baseUrl: this.baseUrl,
|
|
3862
|
+
path: RED_TEAM_TARGET_PATH,
|
|
3863
|
+
params,
|
|
3864
|
+
oauthClient: this.oauthClient,
|
|
3865
|
+
numRetries: this.numRetries
|
|
3866
|
+
});
|
|
3867
|
+
return res.data;
|
|
3868
|
+
}
|
|
3869
|
+
/** Get a target by UUID. */
|
|
3870
|
+
async get(uuid) {
|
|
3871
|
+
if (!isValidUuid(uuid)) {
|
|
3872
|
+
throw new AISecSDKException(
|
|
3873
|
+
`Invalid target uuid: ${uuid}`,
|
|
3874
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3875
|
+
);
|
|
3876
|
+
}
|
|
3877
|
+
const res = await managementHttpRequest({
|
|
3878
|
+
method: "GET",
|
|
3879
|
+
baseUrl: this.baseUrl,
|
|
3880
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
|
|
3881
|
+
oauthClient: this.oauthClient,
|
|
3882
|
+
numRetries: this.numRetries
|
|
3883
|
+
});
|
|
3884
|
+
return res.data;
|
|
3885
|
+
}
|
|
3886
|
+
/** Update a target. */
|
|
3887
|
+
async update(uuid, request) {
|
|
3888
|
+
if (!isValidUuid(uuid)) {
|
|
3889
|
+
throw new AISecSDKException(
|
|
3890
|
+
`Invalid target uuid: ${uuid}`,
|
|
3891
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3892
|
+
);
|
|
3893
|
+
}
|
|
3894
|
+
const res = await managementHttpRequest({
|
|
3895
|
+
method: "PUT",
|
|
3896
|
+
baseUrl: this.baseUrl,
|
|
3897
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
|
|
3898
|
+
body: request,
|
|
3899
|
+
oauthClient: this.oauthClient,
|
|
3900
|
+
numRetries: this.numRetries
|
|
3901
|
+
});
|
|
3902
|
+
return res.data;
|
|
3903
|
+
}
|
|
3904
|
+
/** Delete a target. */
|
|
3905
|
+
async delete(uuid) {
|
|
3906
|
+
if (!isValidUuid(uuid)) {
|
|
3907
|
+
throw new AISecSDKException(
|
|
3908
|
+
`Invalid target uuid: ${uuid}`,
|
|
3909
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3910
|
+
);
|
|
3911
|
+
}
|
|
3912
|
+
const res = await managementHttpRequest({
|
|
3913
|
+
method: "DELETE",
|
|
3914
|
+
baseUrl: this.baseUrl,
|
|
3915
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}`,
|
|
3916
|
+
oauthClient: this.oauthClient,
|
|
3917
|
+
numRetries: this.numRetries
|
|
3918
|
+
});
|
|
3919
|
+
return res.data;
|
|
3920
|
+
}
|
|
3921
|
+
/** Run profiling probes on a target. */
|
|
3922
|
+
async probe(request) {
|
|
3923
|
+
const res = await managementHttpRequest({
|
|
3924
|
+
method: "POST",
|
|
3925
|
+
baseUrl: this.baseUrl,
|
|
3926
|
+
path: `${RED_TEAM_TARGET_PATH}/probe`,
|
|
3927
|
+
body: request,
|
|
3928
|
+
oauthClient: this.oauthClient,
|
|
3929
|
+
numRetries: this.numRetries
|
|
3930
|
+
});
|
|
3931
|
+
return res.data;
|
|
3932
|
+
}
|
|
3933
|
+
/** Get profiling results for a target. */
|
|
3934
|
+
async getProfile(uuid) {
|
|
3935
|
+
if (!isValidUuid(uuid)) {
|
|
3936
|
+
throw new AISecSDKException(
|
|
3937
|
+
`Invalid target uuid: ${uuid}`,
|
|
3938
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3939
|
+
);
|
|
3940
|
+
}
|
|
3941
|
+
const res = await managementHttpRequest({
|
|
3942
|
+
method: "GET",
|
|
3943
|
+
baseUrl: this.baseUrl,
|
|
3944
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
|
|
3945
|
+
oauthClient: this.oauthClient,
|
|
3946
|
+
numRetries: this.numRetries
|
|
3947
|
+
});
|
|
3948
|
+
return res.data;
|
|
3949
|
+
}
|
|
3950
|
+
/** Update a target profile (background + additional context). */
|
|
3951
|
+
async updateProfile(uuid, request) {
|
|
3952
|
+
if (!isValidUuid(uuid)) {
|
|
3953
|
+
throw new AISecSDKException(
|
|
3954
|
+
`Invalid target uuid: ${uuid}`,
|
|
3955
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3956
|
+
);
|
|
3957
|
+
}
|
|
3958
|
+
const res = await managementHttpRequest({
|
|
3959
|
+
method: "PUT",
|
|
3960
|
+
baseUrl: this.baseUrl,
|
|
3961
|
+
path: `${RED_TEAM_TARGET_PATH}/${uuid}/profile`,
|
|
3962
|
+
body: request,
|
|
3963
|
+
oauthClient: this.oauthClient,
|
|
3964
|
+
numRetries: this.numRetries
|
|
3965
|
+
});
|
|
3966
|
+
return res.data;
|
|
3967
|
+
}
|
|
3968
|
+
};
|
|
3969
|
+
|
|
3970
|
+
// src/red-team/custom-attacks-client.ts
|
|
3971
|
+
function buildListParams8(opts) {
|
|
3972
|
+
const params = {};
|
|
3973
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3974
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3975
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
3976
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
3977
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
3978
|
+
return params;
|
|
3979
|
+
}
|
|
3980
|
+
function validateUuid(uuid, label) {
|
|
3981
|
+
if (!isValidUuid(uuid)) {
|
|
3982
|
+
throw new AISecSDKException(`Invalid ${label}: ${uuid}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3985
|
+
var RedTeamCustomAttacksClient = class {
|
|
3986
|
+
baseUrl;
|
|
3987
|
+
oauthClient;
|
|
3988
|
+
numRetries;
|
|
3989
|
+
constructor(opts) {
|
|
3990
|
+
this.baseUrl = opts.baseUrl;
|
|
3991
|
+
this.oauthClient = opts.oauthClient;
|
|
3992
|
+
this.numRetries = opts.numRetries;
|
|
3993
|
+
}
|
|
3994
|
+
// -----------------------------------------------------------------------
|
|
3995
|
+
// Prompt Set operations
|
|
3996
|
+
// -----------------------------------------------------------------------
|
|
3997
|
+
/** Create a new custom prompt set. */
|
|
3998
|
+
async createPromptSet(request) {
|
|
3999
|
+
const res = await managementHttpRequest({
|
|
4000
|
+
method: "POST",
|
|
4001
|
+
baseUrl: this.baseUrl,
|
|
4002
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set`,
|
|
4003
|
+
body: request,
|
|
4004
|
+
oauthClient: this.oauthClient,
|
|
4005
|
+
numRetries: this.numRetries
|
|
4006
|
+
});
|
|
4007
|
+
return res.data;
|
|
4008
|
+
}
|
|
4009
|
+
/** List custom prompt sets. */
|
|
4010
|
+
async listPromptSets(opts) {
|
|
4011
|
+
const params = buildListParams8(opts);
|
|
4012
|
+
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4013
|
+
if (opts?.archive !== void 0) params.archive = String(opts.archive);
|
|
4014
|
+
const res = await managementHttpRequest({
|
|
4015
|
+
method: "GET",
|
|
4016
|
+
baseUrl: this.baseUrl,
|
|
4017
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/list-custom-prompt-sets`,
|
|
4018
|
+
params,
|
|
4019
|
+
oauthClient: this.oauthClient,
|
|
4020
|
+
numRetries: this.numRetries
|
|
4021
|
+
});
|
|
4022
|
+
return res.data;
|
|
4023
|
+
}
|
|
4024
|
+
/** Get a prompt set by UUID. */
|
|
4025
|
+
async getPromptSet(uuid) {
|
|
4026
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4027
|
+
const res = await managementHttpRequest({
|
|
4028
|
+
method: "GET",
|
|
4029
|
+
baseUrl: this.baseUrl,
|
|
4030
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
|
|
4031
|
+
oauthClient: this.oauthClient,
|
|
4032
|
+
numRetries: this.numRetries
|
|
4033
|
+
});
|
|
4034
|
+
return res.data;
|
|
4035
|
+
}
|
|
4036
|
+
/** Update a prompt set. */
|
|
4037
|
+
async updatePromptSet(uuid, request) {
|
|
4038
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4039
|
+
const res = await managementHttpRequest({
|
|
4040
|
+
method: "PUT",
|
|
4041
|
+
baseUrl: this.baseUrl,
|
|
4042
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}`,
|
|
4043
|
+
body: request,
|
|
4044
|
+
oauthClient: this.oauthClient,
|
|
4045
|
+
numRetries: this.numRetries
|
|
4046
|
+
});
|
|
4047
|
+
return res.data;
|
|
4048
|
+
}
|
|
4049
|
+
/** Archive or unarchive a prompt set. */
|
|
4050
|
+
async archivePromptSet(uuid, request) {
|
|
4051
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4052
|
+
const res = await managementHttpRequest({
|
|
4053
|
+
method: "PUT",
|
|
4054
|
+
baseUrl: this.baseUrl,
|
|
4055
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/archive`,
|
|
4056
|
+
body: request,
|
|
4057
|
+
oauthClient: this.oauthClient,
|
|
4058
|
+
numRetries: this.numRetries
|
|
4059
|
+
});
|
|
4060
|
+
return res.data;
|
|
4061
|
+
}
|
|
4062
|
+
/** Resolve a prompt set reference for data plane consumption. */
|
|
4063
|
+
async getPromptSetReference(uuid) {
|
|
4064
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4065
|
+
const res = await managementHttpRequest({
|
|
4066
|
+
method: "GET",
|
|
4067
|
+
baseUrl: this.baseUrl,
|
|
4068
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/reference`,
|
|
4069
|
+
oauthClient: this.oauthClient,
|
|
4070
|
+
numRetries: this.numRetries
|
|
4071
|
+
});
|
|
4072
|
+
return res.data;
|
|
4073
|
+
}
|
|
4074
|
+
/** Get version information for a prompt set. */
|
|
4075
|
+
async getPromptSetVersionInfo(uuid) {
|
|
4076
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4077
|
+
const res = await managementHttpRequest({
|
|
4078
|
+
method: "GET",
|
|
4079
|
+
baseUrl: this.baseUrl,
|
|
4080
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${uuid}/version-info`,
|
|
4081
|
+
oauthClient: this.oauthClient,
|
|
4082
|
+
numRetries: this.numRetries
|
|
4083
|
+
});
|
|
4084
|
+
return res.data;
|
|
4085
|
+
}
|
|
4086
|
+
/** List active prompt sets (for data plane). */
|
|
4087
|
+
async listActivePromptSets() {
|
|
4088
|
+
const res = await managementHttpRequest({
|
|
4089
|
+
method: "GET",
|
|
4090
|
+
baseUrl: this.baseUrl,
|
|
4091
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/active-custom-prompt-sets`,
|
|
4092
|
+
oauthClient: this.oauthClient,
|
|
4093
|
+
numRetries: this.numRetries
|
|
4094
|
+
});
|
|
4095
|
+
return res.data;
|
|
4096
|
+
}
|
|
4097
|
+
/** Download CSV template for a prompt set. */
|
|
4098
|
+
async downloadTemplate(uuid) {
|
|
4099
|
+
validateUuid(uuid, "prompt set uuid");
|
|
4100
|
+
const res = await managementHttpRequest({
|
|
4101
|
+
method: "GET",
|
|
4102
|
+
baseUrl: this.baseUrl,
|
|
4103
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/download-template/${uuid}`,
|
|
4104
|
+
oauthClient: this.oauthClient,
|
|
4105
|
+
numRetries: this.numRetries
|
|
4106
|
+
});
|
|
4107
|
+
return res.data;
|
|
4108
|
+
}
|
|
4109
|
+
// -----------------------------------------------------------------------
|
|
4110
|
+
// Prompt operations
|
|
4111
|
+
// -----------------------------------------------------------------------
|
|
4112
|
+
/** Create a new custom prompt. */
|
|
4113
|
+
async createPrompt(request) {
|
|
4114
|
+
const res = await managementHttpRequest({
|
|
4115
|
+
method: "POST",
|
|
4116
|
+
baseUrl: this.baseUrl,
|
|
4117
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/custom-prompt`,
|
|
4118
|
+
body: request,
|
|
4119
|
+
oauthClient: this.oauthClient,
|
|
4120
|
+
numRetries: this.numRetries
|
|
4121
|
+
});
|
|
4122
|
+
return res.data;
|
|
4123
|
+
}
|
|
4124
|
+
/** List prompts in a prompt set. */
|
|
4125
|
+
async listPrompts(promptSetUuid, opts) {
|
|
4126
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4127
|
+
const params = buildListParams8(opts);
|
|
4128
|
+
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4129
|
+
const res = await managementHttpRequest({
|
|
4130
|
+
method: "GET",
|
|
4131
|
+
baseUrl: this.baseUrl,
|
|
4132
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/list-custom-prompts`,
|
|
4133
|
+
params,
|
|
4134
|
+
oauthClient: this.oauthClient,
|
|
4135
|
+
numRetries: this.numRetries
|
|
4136
|
+
});
|
|
4137
|
+
return res.data;
|
|
4138
|
+
}
|
|
4139
|
+
/** Get a prompt by UUID. */
|
|
4140
|
+
async getPrompt(promptSetUuid, promptUuid) {
|
|
4141
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4142
|
+
validateUuid(promptUuid, "prompt uuid");
|
|
4143
|
+
const res = await managementHttpRequest({
|
|
4144
|
+
method: "GET",
|
|
4145
|
+
baseUrl: this.baseUrl,
|
|
4146
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/custom-prompt/${promptUuid}`,
|
|
4147
|
+
oauthClient: this.oauthClient,
|
|
4148
|
+
numRetries: this.numRetries
|
|
4149
|
+
});
|
|
4150
|
+
return res.data;
|
|
4151
|
+
}
|
|
4152
|
+
/** Update a prompt. */
|
|
4153
|
+
async updatePrompt(promptSetUuid, promptUuid, request) {
|
|
4154
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4155
|
+
validateUuid(promptUuid, "prompt uuid");
|
|
4156
|
+
const res = await managementHttpRequest({
|
|
4157
|
+
method: "PUT",
|
|
4158
|
+
baseUrl: this.baseUrl,
|
|
4159
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/custom-prompt/${promptUuid}`,
|
|
4160
|
+
body: request,
|
|
4161
|
+
oauthClient: this.oauthClient,
|
|
4162
|
+
numRetries: this.numRetries
|
|
4163
|
+
});
|
|
4164
|
+
return res.data;
|
|
4165
|
+
}
|
|
4166
|
+
/** Delete a prompt. */
|
|
4167
|
+
async deletePrompt(promptSetUuid, promptUuid) {
|
|
4168
|
+
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4169
|
+
validateUuid(promptUuid, "prompt uuid");
|
|
4170
|
+
const res = await managementHttpRequest({
|
|
4171
|
+
method: "DELETE",
|
|
4172
|
+
baseUrl: this.baseUrl,
|
|
4173
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/custom-prompt-set/${promptSetUuid}/custom-prompt/${promptUuid}`,
|
|
4174
|
+
oauthClient: this.oauthClient,
|
|
4175
|
+
numRetries: this.numRetries
|
|
4176
|
+
});
|
|
4177
|
+
return res.data;
|
|
4178
|
+
}
|
|
4179
|
+
// -----------------------------------------------------------------------
|
|
4180
|
+
// Property operations
|
|
4181
|
+
// -----------------------------------------------------------------------
|
|
4182
|
+
/** Get all property names. */
|
|
4183
|
+
async getPropertyNames() {
|
|
4184
|
+
const res = await managementHttpRequest({
|
|
4185
|
+
method: "GET",
|
|
4186
|
+
baseUrl: this.baseUrl,
|
|
4187
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-names`,
|
|
4188
|
+
oauthClient: this.oauthClient,
|
|
4189
|
+
numRetries: this.numRetries
|
|
4190
|
+
});
|
|
4191
|
+
return res.data;
|
|
4192
|
+
}
|
|
4193
|
+
/** Create a new property name. */
|
|
4194
|
+
async createPropertyName(request) {
|
|
4195
|
+
const res = await managementHttpRequest({
|
|
4196
|
+
method: "POST",
|
|
4197
|
+
baseUrl: this.baseUrl,
|
|
4198
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-names`,
|
|
4199
|
+
body: request,
|
|
4200
|
+
oauthClient: this.oauthClient,
|
|
4201
|
+
numRetries: this.numRetries
|
|
4202
|
+
});
|
|
4203
|
+
return res.data;
|
|
4204
|
+
}
|
|
4205
|
+
/** Get values for a property name. */
|
|
4206
|
+
async getPropertyValues(propertyName) {
|
|
4207
|
+
const res = await managementHttpRequest({
|
|
4208
|
+
method: "GET",
|
|
4209
|
+
baseUrl: this.baseUrl,
|
|
4210
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values/${encodeURIComponent(propertyName)}`,
|
|
4211
|
+
oauthClient: this.oauthClient,
|
|
4212
|
+
numRetries: this.numRetries
|
|
4213
|
+
});
|
|
4214
|
+
return res.data;
|
|
4215
|
+
}
|
|
4216
|
+
/** Get values for multiple property names. */
|
|
4217
|
+
async getPropertyValuesMultiple(propertyNames) {
|
|
4218
|
+
const url = new URL(`https://placeholder${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values`);
|
|
4219
|
+
for (const name of propertyNames) {
|
|
4220
|
+
url.searchParams.append("property_names", name);
|
|
4221
|
+
}
|
|
4222
|
+
const queryString = url.searchParams.toString();
|
|
4223
|
+
const pathWithQuery = `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values${queryString ? `?${queryString}` : ""}`;
|
|
4224
|
+
const res = await managementHttpRequest({
|
|
4225
|
+
method: "GET",
|
|
4226
|
+
baseUrl: this.baseUrl,
|
|
4227
|
+
path: pathWithQuery,
|
|
4228
|
+
oauthClient: this.oauthClient,
|
|
4229
|
+
numRetries: this.numRetries
|
|
4230
|
+
});
|
|
4231
|
+
return res.data;
|
|
4232
|
+
}
|
|
4233
|
+
/** Create a property value. */
|
|
4234
|
+
async createPropertyValue(request) {
|
|
4235
|
+
const res = await managementHttpRequest({
|
|
4236
|
+
method: "POST",
|
|
4237
|
+
baseUrl: this.baseUrl,
|
|
4238
|
+
path: `${RED_TEAM_CUSTOM_ATTACK_PATH}/property-values`,
|
|
4239
|
+
body: request,
|
|
4240
|
+
oauthClient: this.oauthClient,
|
|
4241
|
+
numRetries: this.numRetries
|
|
4242
|
+
});
|
|
4243
|
+
return res.data;
|
|
4244
|
+
}
|
|
4245
|
+
};
|
|
4246
|
+
|
|
4247
|
+
// src/red-team/client.ts
|
|
4248
|
+
function buildListParams9(opts) {
|
|
4249
|
+
const params = {};
|
|
4250
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4251
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
4252
|
+
if (opts?.sort_by !== void 0) params.sort_by = opts.sort_by;
|
|
4253
|
+
if (opts?.sort_direction !== void 0) params.sort_direction = opts.sort_direction;
|
|
4254
|
+
if (opts?.search !== void 0) params.search = opts.search;
|
|
4255
|
+
return params;
|
|
4256
|
+
}
|
|
4257
|
+
var RedTeamClient = class {
|
|
4258
|
+
/** Data plane scan operations. */
|
|
4259
|
+
scans;
|
|
4260
|
+
/** Data plane report operations. */
|
|
4261
|
+
reports;
|
|
4262
|
+
/** Data plane custom attack report operations. */
|
|
4263
|
+
customAttackReports;
|
|
4264
|
+
/** Management plane target operations. */
|
|
4265
|
+
targets;
|
|
4266
|
+
/** Management plane custom attack/prompt set operations. */
|
|
4267
|
+
customAttacks;
|
|
4268
|
+
dataEndpoint;
|
|
4269
|
+
mgmtEndpoint;
|
|
4270
|
+
oauthClient;
|
|
4271
|
+
numRetries;
|
|
4272
|
+
constructor(opts = {}) {
|
|
4273
|
+
const clientId = opts.clientId ?? process.env[RED_TEAM_CLIENT_ID] ?? process.env[MGMT_CLIENT_ID];
|
|
4274
|
+
const clientSecret = opts.clientSecret ?? process.env[RED_TEAM_CLIENT_SECRET] ?? process.env[MGMT_CLIENT_SECRET];
|
|
4275
|
+
const tsgId = opts.tsgId ?? process.env[RED_TEAM_TSG_ID] ?? process.env[MGMT_TSG_ID];
|
|
4276
|
+
const dataEndpoint = opts.dataEndpoint ?? process.env[RED_TEAM_DATA_ENDPOINT] ?? DEFAULT_RED_TEAM_DATA_ENDPOINT;
|
|
4277
|
+
const mgmtEndpoint = opts.mgmtEndpoint ?? process.env[RED_TEAM_MGMT_ENDPOINT] ?? DEFAULT_RED_TEAM_MGMT_ENDPOINT;
|
|
4278
|
+
const tokenEndpoint = opts.tokenEndpoint ?? process.env[RED_TEAM_TOKEN_ENDPOINT] ?? process.env[MGMT_TOKEN_ENDPOINT];
|
|
4279
|
+
const numRetries = Math.min(
|
|
4280
|
+
Math.max(opts.numRetries ?? MAX_NUMBER_OF_RETRIES, 0),
|
|
4281
|
+
MAX_NUMBER_OF_RETRIES
|
|
4282
|
+
);
|
|
4283
|
+
if (!clientId) {
|
|
4284
|
+
throw new AISecSDKException(
|
|
4285
|
+
"clientId is required (option or PANW_RED_TEAM_CLIENT_ID / PANW_MGMT_CLIENT_ID env var)",
|
|
4286
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
4287
|
+
);
|
|
4288
|
+
}
|
|
4289
|
+
if (!clientSecret) {
|
|
4290
|
+
throw new AISecSDKException(
|
|
4291
|
+
"clientSecret is required (option or PANW_RED_TEAM_CLIENT_SECRET / PANW_MGMT_CLIENT_SECRET env var)",
|
|
4292
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
4293
|
+
);
|
|
4294
|
+
}
|
|
4295
|
+
if (!tsgId) {
|
|
4296
|
+
throw new AISecSDKException(
|
|
4297
|
+
"tsgId is required (option or PANW_RED_TEAM_TSG_ID / PANW_MGMT_TSG_ID env var)",
|
|
4298
|
+
"AISEC_MISSING_VARIABLE" /* MISSING_VARIABLE */
|
|
4299
|
+
);
|
|
4300
|
+
}
|
|
4301
|
+
this.oauthClient = new OAuthClient({ clientId, clientSecret, tsgId, tokenEndpoint });
|
|
4302
|
+
this.dataEndpoint = dataEndpoint;
|
|
4303
|
+
this.mgmtEndpoint = mgmtEndpoint;
|
|
4304
|
+
this.numRetries = numRetries;
|
|
4305
|
+
this.scans = new RedTeamScansClient({
|
|
4306
|
+
baseUrl: dataEndpoint,
|
|
4307
|
+
oauthClient: this.oauthClient,
|
|
4308
|
+
numRetries
|
|
4309
|
+
});
|
|
4310
|
+
this.reports = new RedTeamReportsClient({
|
|
4311
|
+
baseUrl: dataEndpoint,
|
|
4312
|
+
oauthClient: this.oauthClient,
|
|
4313
|
+
numRetries
|
|
4314
|
+
});
|
|
4315
|
+
this.customAttackReports = new RedTeamCustomAttackReportsClient({
|
|
4316
|
+
baseUrl: dataEndpoint,
|
|
4317
|
+
oauthClient: this.oauthClient,
|
|
4318
|
+
numRetries
|
|
4319
|
+
});
|
|
4320
|
+
this.targets = new RedTeamTargetsClient({
|
|
4321
|
+
baseUrl: mgmtEndpoint,
|
|
4322
|
+
oauthClient: this.oauthClient,
|
|
4323
|
+
numRetries
|
|
4324
|
+
});
|
|
4325
|
+
this.customAttacks = new RedTeamCustomAttacksClient({
|
|
4326
|
+
baseUrl: mgmtEndpoint,
|
|
4327
|
+
oauthClient: this.oauthClient,
|
|
4328
|
+
numRetries
|
|
4329
|
+
});
|
|
4330
|
+
}
|
|
4331
|
+
// -----------------------------------------------------------------------
|
|
4332
|
+
// Data plane convenience methods
|
|
4333
|
+
// -----------------------------------------------------------------------
|
|
4334
|
+
/** Get scan statistics and risk profile (data plane dashboard). */
|
|
4335
|
+
async getScanStatistics(params) {
|
|
4336
|
+
const p = {};
|
|
4337
|
+
if (params?.date_range !== void 0) p.date_range = params.date_range;
|
|
4338
|
+
if (params?.target_id !== void 0) p.target_id = params.target_id;
|
|
4339
|
+
const res = await managementHttpRequest({
|
|
4340
|
+
method: "GET",
|
|
4341
|
+
baseUrl: this.dataEndpoint,
|
|
4342
|
+
path: `${RED_TEAM_DASHBOARD_PATH}/scan-statistics`,
|
|
4343
|
+
params: p,
|
|
4344
|
+
oauthClient: this.oauthClient,
|
|
4345
|
+
numRetries: this.numRetries
|
|
4346
|
+
});
|
|
4347
|
+
return res.data;
|
|
4348
|
+
}
|
|
4349
|
+
/** Get score trend for a target (data plane dashboard). */
|
|
4350
|
+
async getScoreTrend(targetId) {
|
|
4351
|
+
if (!isValidUuid(targetId)) {
|
|
4352
|
+
throw new AISecSDKException(
|
|
4353
|
+
`Invalid target id: ${targetId}`,
|
|
4354
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
4355
|
+
);
|
|
4356
|
+
}
|
|
4357
|
+
const res = await managementHttpRequest({
|
|
4358
|
+
method: "GET",
|
|
4359
|
+
baseUrl: this.dataEndpoint,
|
|
4360
|
+
path: `${RED_TEAM_DASHBOARD_PATH}/score-trend`,
|
|
4361
|
+
params: { target_id: targetId },
|
|
4362
|
+
oauthClient: this.oauthClient,
|
|
4363
|
+
numRetries: this.numRetries
|
|
4364
|
+
});
|
|
4365
|
+
return res.data;
|
|
4366
|
+
}
|
|
4367
|
+
/** Get quota summary. */
|
|
4368
|
+
async getQuota() {
|
|
4369
|
+
const res = await managementHttpRequest({
|
|
4370
|
+
method: "POST",
|
|
4371
|
+
baseUrl: this.dataEndpoint,
|
|
4372
|
+
path: RED_TEAM_QUOTA_PATH,
|
|
4373
|
+
oauthClient: this.oauthClient,
|
|
4374
|
+
numRetries: this.numRetries
|
|
4375
|
+
});
|
|
4376
|
+
return res.data;
|
|
4377
|
+
}
|
|
4378
|
+
/** List error logs for a scan job. */
|
|
4379
|
+
async getErrorLogs(jobId, opts) {
|
|
4380
|
+
if (!isValidUuid(jobId)) {
|
|
4381
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
4382
|
+
}
|
|
4383
|
+
const res = await managementHttpRequest({
|
|
4384
|
+
method: "GET",
|
|
4385
|
+
baseUrl: this.dataEndpoint,
|
|
4386
|
+
path: `${RED_TEAM_ERROR_LOG_PATH}/${jobId}`,
|
|
4387
|
+
params: buildListParams9(opts),
|
|
4388
|
+
oauthClient: this.oauthClient,
|
|
4389
|
+
numRetries: this.numRetries
|
|
4390
|
+
});
|
|
4391
|
+
return res.data;
|
|
4392
|
+
}
|
|
4393
|
+
/** Update sentiment for a scan report. */
|
|
4394
|
+
async updateSentiment(request) {
|
|
4395
|
+
const res = await managementHttpRequest({
|
|
4396
|
+
method: "POST",
|
|
4397
|
+
baseUrl: this.dataEndpoint,
|
|
4398
|
+
path: RED_TEAM_SENTIMENT_PATH,
|
|
4399
|
+
body: request,
|
|
4400
|
+
oauthClient: this.oauthClient,
|
|
4401
|
+
numRetries: this.numRetries
|
|
4402
|
+
});
|
|
4403
|
+
return res.data;
|
|
4404
|
+
}
|
|
4405
|
+
/** Get sentiment for a scan report. */
|
|
4406
|
+
async getSentiment(jobId) {
|
|
4407
|
+
if (!isValidUuid(jobId)) {
|
|
4408
|
+
throw new AISecSDKException(`Invalid job id: ${jobId}`, "AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */);
|
|
4409
|
+
}
|
|
4410
|
+
const res = await managementHttpRequest({
|
|
4411
|
+
method: "GET",
|
|
4412
|
+
baseUrl: this.dataEndpoint,
|
|
4413
|
+
path: `${RED_TEAM_SENTIMENT_PATH}/${jobId}`,
|
|
4414
|
+
oauthClient: this.oauthClient,
|
|
4415
|
+
numRetries: this.numRetries
|
|
4416
|
+
});
|
|
4417
|
+
return res.data;
|
|
4418
|
+
}
|
|
4419
|
+
// -----------------------------------------------------------------------
|
|
4420
|
+
// Management plane convenience methods
|
|
4421
|
+
// -----------------------------------------------------------------------
|
|
4422
|
+
/** Get management dashboard overview. */
|
|
4423
|
+
async getDashboardOverview() {
|
|
4424
|
+
const res = await managementHttpRequest({
|
|
4425
|
+
method: "GET",
|
|
4426
|
+
baseUrl: this.mgmtEndpoint,
|
|
4427
|
+
path: RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
4428
|
+
oauthClient: this.oauthClient,
|
|
4429
|
+
numRetries: this.numRetries
|
|
4430
|
+
});
|
|
4431
|
+
return res.data;
|
|
4432
|
+
}
|
|
4433
|
+
};
|
|
1264
4434
|
export {
|
|
1265
4435
|
AISecSDKException,
|
|
1266
4436
|
AI_SEC_API_ENDPOINT,
|
|
@@ -1270,32 +4440,112 @@ export {
|
|
|
1270
4440
|
Action,
|
|
1271
4441
|
AgentMetaSchema,
|
|
1272
4442
|
AiProfileSchema,
|
|
4443
|
+
ApiEndpointType,
|
|
1273
4444
|
AsyncScanObjectSchema,
|
|
1274
4445
|
AsyncScanResponseSchema,
|
|
4446
|
+
AttackDetailResponseSchema,
|
|
4447
|
+
AttackListItemSchema,
|
|
4448
|
+
AttackListResponseSchema,
|
|
4449
|
+
AttackMultiTurnDetailResponseSchema,
|
|
4450
|
+
AttackMultiTurnOutputSchema,
|
|
4451
|
+
AttackOutputSchema,
|
|
4452
|
+
AttackStatus,
|
|
4453
|
+
AttackType,
|
|
4454
|
+
AuthType,
|
|
1275
4455
|
BEARER,
|
|
4456
|
+
BaseResponseSchema,
|
|
4457
|
+
BrandSubCategory,
|
|
1276
4458
|
Category,
|
|
4459
|
+
CategoryModelSchema,
|
|
4460
|
+
CategoryReportSchema,
|
|
4461
|
+
ComplianceReportSchema,
|
|
4462
|
+
ComplianceSubCategory,
|
|
4463
|
+
ComplianceTechniqueSchema,
|
|
1277
4464
|
Content,
|
|
4465
|
+
CountByNameSchema,
|
|
4466
|
+
CountedQuotaEnum,
|
|
1278
4467
|
CreateCustomTopicRequestSchema,
|
|
1279
4468
|
CreateSecurityProfileRequestSchema,
|
|
4469
|
+
CustomAttackOutputSchema,
|
|
4470
|
+
CustomAttackReportResponseSchema,
|
|
4471
|
+
CustomAttacksListResponseSchema,
|
|
4472
|
+
CustomJobMetadataSchema,
|
|
4473
|
+
CustomPromptCreateRequestSchema,
|
|
4474
|
+
CustomPromptListItemSchema,
|
|
4475
|
+
CustomPromptListSchema,
|
|
4476
|
+
CustomPromptResponseSchema,
|
|
4477
|
+
CustomPromptSetArchiveRequestSchema,
|
|
4478
|
+
CustomPromptSetCreateRequestSchema,
|
|
4479
|
+
CustomPromptSetListActiveSchema,
|
|
4480
|
+
CustomPromptSetListItemSchema,
|
|
4481
|
+
CustomPromptSetListSchema,
|
|
4482
|
+
CustomPromptSetReferenceSchema,
|
|
4483
|
+
CustomPromptSetResponseSchema,
|
|
4484
|
+
CustomPromptSetUpdateRequestSchema,
|
|
4485
|
+
CustomPromptSetVersionInfoSchema,
|
|
4486
|
+
CustomPromptUpdateRequestSchema,
|
|
1280
4487
|
CustomTopicListResponseSchema,
|
|
1281
4488
|
CustomTopicSchema,
|
|
1282
4489
|
DEFAULT_ENDPOINT,
|
|
1283
4490
|
DEFAULT_MGMT_ENDPOINT,
|
|
4491
|
+
DEFAULT_MODEL_SEC_DATA_ENDPOINT,
|
|
4492
|
+
DEFAULT_MODEL_SEC_MGMT_ENDPOINT,
|
|
4493
|
+
DEFAULT_RED_TEAM_DATA_ENDPOINT,
|
|
4494
|
+
DEFAULT_RED_TEAM_MGMT_ENDPOINT,
|
|
1284
4495
|
DEFAULT_TOKEN_ENDPOINT,
|
|
1285
4496
|
DSDetailResultSchema,
|
|
1286
4497
|
DSResultMetadataSchema,
|
|
4498
|
+
DashboardOverviewResponseSchema,
|
|
4499
|
+
DateRangeFilter,
|
|
1287
4500
|
DeleteProfileConflictSchema,
|
|
1288
4501
|
DeleteProfileResponseSchema,
|
|
1289
4502
|
DeleteTopicConflictSchema,
|
|
1290
4503
|
DeleteTopicResponseSchema,
|
|
1291
4504
|
DetectionServiceResultSchema,
|
|
1292
4505
|
DlpReportSchema,
|
|
4506
|
+
DynamicJobMetadataSchema,
|
|
4507
|
+
DynamicJobReportSchema,
|
|
4508
|
+
DynamicJobReportStatsSchema,
|
|
4509
|
+
ErrorCodes,
|
|
4510
|
+
ErrorLogListResponseSchema,
|
|
4511
|
+
ErrorLogSchema,
|
|
1293
4512
|
ErrorResponseSchema,
|
|
4513
|
+
ErrorSource,
|
|
1294
4514
|
ErrorType,
|
|
4515
|
+
EvalOutcome,
|
|
4516
|
+
EvalSummarySchema,
|
|
4517
|
+
FileFormat,
|
|
4518
|
+
FileListSchema,
|
|
4519
|
+
FileResponseSchema,
|
|
4520
|
+
FileScanDataSchema,
|
|
4521
|
+
FileScanResult,
|
|
4522
|
+
FileType,
|
|
4523
|
+
GoalListResponseSchema,
|
|
4524
|
+
GoalSchema,
|
|
4525
|
+
GoalType,
|
|
4526
|
+
GoalTypeQueryParam,
|
|
4527
|
+
GuardrailAction,
|
|
1295
4528
|
HEADER_API_KEY,
|
|
1296
4529
|
HEADER_AUTH_TOKEN,
|
|
4530
|
+
HTTPValidationErrorSchema,
|
|
1297
4531
|
HTTP_FORCE_RETRY_STATUS_CODES,
|
|
1298
4532
|
IODetectedSchema,
|
|
4533
|
+
JobAbortResponseSchema,
|
|
4534
|
+
JobCreateRequestSchema,
|
|
4535
|
+
JobListResponseSchema,
|
|
4536
|
+
JobResponseSchema,
|
|
4537
|
+
JobStatus,
|
|
4538
|
+
JobStatusFilter,
|
|
4539
|
+
JobTimeRecordSchema,
|
|
4540
|
+
JobType,
|
|
4541
|
+
LabelKeyListSchema,
|
|
4542
|
+
LabelSchema,
|
|
4543
|
+
LabelValueListSchema,
|
|
4544
|
+
LabelsCreateRequestSchema,
|
|
4545
|
+
LabelsResponseSchema,
|
|
4546
|
+
ListModelSecurityGroupsResponseSchema,
|
|
4547
|
+
ListModelSecurityRuleInstancesResponseSchema,
|
|
4548
|
+
ListModelSecurityRulesResponseSchema,
|
|
1299
4549
|
MAX_AI_PROFILE_NAME_LENGTH,
|
|
1300
4550
|
MAX_API_KEY_LENGTH,
|
|
1301
4551
|
MAX_CONNECTION_POOL_SIZE,
|
|
@@ -1321,28 +4571,168 @@ export {
|
|
|
1321
4571
|
MGMT_TOPIC_FORCE_PATH,
|
|
1322
4572
|
MGMT_TOPIC_PATH,
|
|
1323
4573
|
MGMT_TSG_ID,
|
|
4574
|
+
MODEL_SEC_CLIENT_ID,
|
|
4575
|
+
MODEL_SEC_CLIENT_SECRET,
|
|
4576
|
+
MODEL_SEC_DATA_ENDPOINT,
|
|
4577
|
+
MODEL_SEC_EVALUATIONS_PATH,
|
|
4578
|
+
MODEL_SEC_MGMT_ENDPOINT,
|
|
4579
|
+
MODEL_SEC_PYPI_AUTH_PATH,
|
|
4580
|
+
MODEL_SEC_SCANS_PATH,
|
|
4581
|
+
MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
4582
|
+
MODEL_SEC_SECURITY_RULES_PATH,
|
|
4583
|
+
MODEL_SEC_TOKEN_ENDPOINT,
|
|
4584
|
+
MODEL_SEC_TSG_ID,
|
|
4585
|
+
MODEL_SEC_VIOLATIONS_PATH,
|
|
1324
4586
|
ManagementClient,
|
|
1325
4587
|
MaskedDataSchema,
|
|
1326
4588
|
MetadataSchema,
|
|
4589
|
+
ModelScanIssueSchema,
|
|
4590
|
+
ModelScanStatus,
|
|
4591
|
+
ModelSecurityClient,
|
|
4592
|
+
ModelSecurityGroupCreateRequestSchema,
|
|
4593
|
+
ModelSecurityGroupResponseSchema,
|
|
4594
|
+
ModelSecurityGroupState,
|
|
4595
|
+
ModelSecurityGroupUpdateRequestSchema,
|
|
4596
|
+
ModelSecurityGroupsClient,
|
|
4597
|
+
ModelSecurityPaginationSchema,
|
|
4598
|
+
ModelSecurityRuleInstanceResponseSchema,
|
|
4599
|
+
ModelSecurityRuleInstanceUpdateRequestSchema,
|
|
4600
|
+
ModelSecurityRuleResponseSchema,
|
|
4601
|
+
ModelSecurityRulesClient,
|
|
4602
|
+
ModelSecurityScansClient,
|
|
4603
|
+
OAuthClient,
|
|
1327
4604
|
PAYLOAD_HASH,
|
|
1328
4605
|
PolicySchema,
|
|
4606
|
+
PolicyType,
|
|
4607
|
+
PrerequisiteModelSchema,
|
|
1329
4608
|
ProfilesClient,
|
|
4609
|
+
ProfilingStatus,
|
|
4610
|
+
PromptDetailResponseSchema,
|
|
1330
4611
|
PromptDetectedSchema,
|
|
1331
4612
|
PromptDetectionDetailsSchema,
|
|
4613
|
+
PromptSetStatsSchema,
|
|
4614
|
+
PromptSetSummarySchema,
|
|
4615
|
+
PromptSetsReportResponseSchema,
|
|
4616
|
+
PropertyAssignmentSchema,
|
|
4617
|
+
PropertyDefinitionSchema,
|
|
4618
|
+
PropertyNameCreateRequestSchema,
|
|
4619
|
+
PropertyNamesListResponseSchema,
|
|
4620
|
+
PropertyStatisticSchema,
|
|
4621
|
+
PropertyValueCreateRequestSchema,
|
|
4622
|
+
PropertyValueStatisticSchema,
|
|
4623
|
+
PropertyValuesMultipleResponseSchema,
|
|
4624
|
+
PropertyValuesResponseSchema,
|
|
4625
|
+
PyPIAuthResponseSchema,
|
|
4626
|
+
QuotaDetailsSchema,
|
|
4627
|
+
QuotaSummarySchema,
|
|
4628
|
+
RED_TEAM_CATEGORIES_PATH,
|
|
4629
|
+
RED_TEAM_CLIENT_ID,
|
|
4630
|
+
RED_TEAM_CLIENT_SECRET,
|
|
4631
|
+
RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH,
|
|
4632
|
+
RED_TEAM_CUSTOM_ATTACK_PATH,
|
|
4633
|
+
RED_TEAM_DASHBOARD_PATH,
|
|
4634
|
+
RED_TEAM_DATA_ENDPOINT,
|
|
4635
|
+
RED_TEAM_ERROR_LOG_PATH,
|
|
4636
|
+
RED_TEAM_MGMT_DASHBOARD_PATH,
|
|
4637
|
+
RED_TEAM_MGMT_ENDPOINT,
|
|
4638
|
+
RED_TEAM_QUOTA_PATH,
|
|
4639
|
+
RED_TEAM_REPORT_DYNAMIC_PATH,
|
|
4640
|
+
RED_TEAM_REPORT_PATH,
|
|
4641
|
+
RED_TEAM_REPORT_STATIC_PATH,
|
|
4642
|
+
RED_TEAM_SCAN_PATH,
|
|
4643
|
+
RED_TEAM_SENTIMENT_PATH,
|
|
4644
|
+
RED_TEAM_TARGET_PATH,
|
|
4645
|
+
RED_TEAM_TOKEN_ENDPOINT,
|
|
4646
|
+
RED_TEAM_TSG_ID,
|
|
4647
|
+
RedTeamCategory,
|
|
4648
|
+
RedTeamClient,
|
|
4649
|
+
RedTeamCustomAttackReportsClient,
|
|
4650
|
+
RedTeamCustomAttacksClient,
|
|
4651
|
+
RedTeamErrorType,
|
|
4652
|
+
RedTeamPaginationSchema,
|
|
4653
|
+
RedTeamReportsClient,
|
|
4654
|
+
RedTeamScansClient,
|
|
4655
|
+
RedTeamTargetsClient,
|
|
4656
|
+
RemediationDetailSchema,
|
|
4657
|
+
RemediationResponseSchema,
|
|
1332
4658
|
ResponseDetectedSchema,
|
|
1333
4659
|
ResponseDetectionDetailsSchema,
|
|
4660
|
+
ResponseMode,
|
|
4661
|
+
RiskLevelSchema,
|
|
4662
|
+
RiskRating,
|
|
4663
|
+
RuleConfigurationSchema,
|
|
4664
|
+
RuleEditableFieldDropdownSchema,
|
|
4665
|
+
RuleEditableFieldSchema,
|
|
4666
|
+
RuleEditableFieldType,
|
|
4667
|
+
RuleEvaluationListSchema,
|
|
4668
|
+
RuleEvaluationResponseSchema,
|
|
4669
|
+
RuleEvaluationResult,
|
|
4670
|
+
RuleFieldValueKey,
|
|
4671
|
+
RuleRemediationSchema,
|
|
4672
|
+
RuleState,
|
|
4673
|
+
RuleType,
|
|
4674
|
+
RuntimeSecurityPolicySchema,
|
|
4675
|
+
RuntimeSecurityProfileResponseSchema,
|
|
1334
4676
|
SCAN_REPORTS_PATH,
|
|
1335
4677
|
SCAN_RESULTS_PATH,
|
|
1336
4678
|
SDK_VERSION,
|
|
1337
4679
|
SYNC_SCAN_PATH,
|
|
4680
|
+
SafetySubCategory,
|
|
4681
|
+
ScanBaseResponseSchema,
|
|
4682
|
+
ScanCreateRequestSchema,
|
|
4683
|
+
ScanDetailsSchema,
|
|
1338
4684
|
ScanIdResultSchema,
|
|
4685
|
+
ScanListSchema,
|
|
4686
|
+
ScanOrigin,
|
|
1339
4687
|
ScanRequestContentsInnerSchema,
|
|
1340
4688
|
ScanRequestSchema,
|
|
1341
4689
|
ScanResponseSchema,
|
|
4690
|
+
ScanStatisticsResponseSchema,
|
|
1342
4691
|
ScanSummarySchema,
|
|
1343
4692
|
Scanner,
|
|
4693
|
+
ScoreTrendResponseSchema,
|
|
4694
|
+
ScoreTrendSeriesSchema,
|
|
1344
4695
|
SecurityProfileListResponseSchema,
|
|
1345
4696
|
SecurityProfileSchema,
|
|
4697
|
+
SecuritySubCategory,
|
|
4698
|
+
SentimentRequestSchema,
|
|
4699
|
+
SentimentResponseSchema,
|
|
4700
|
+
SeverityFilter,
|
|
4701
|
+
SeverityReportSchema,
|
|
4702
|
+
SeverityStatsSchema,
|
|
4703
|
+
SortByDateField,
|
|
4704
|
+
SortByFileField,
|
|
4705
|
+
SortDirection,
|
|
4706
|
+
SourceType,
|
|
4707
|
+
StaticJobMetadataSchema,
|
|
4708
|
+
StaticJobRemediationRecommendationSchema,
|
|
4709
|
+
StaticJobRemediationSchema,
|
|
4710
|
+
StaticJobReportSchema,
|
|
4711
|
+
StaticJobReportStatsSchema,
|
|
4712
|
+
StatusQueryParam,
|
|
4713
|
+
StreamDetailResponseSchema,
|
|
4714
|
+
StreamIterationDataSchema,
|
|
4715
|
+
StreamListResponseSchema,
|
|
4716
|
+
StreamType,
|
|
4717
|
+
SubCategoryModelSchema,
|
|
4718
|
+
SubCategoryStatsSchema,
|
|
4719
|
+
TargetAdditionalContextSchema,
|
|
4720
|
+
TargetBackgroundSchema,
|
|
4721
|
+
TargetConnectionType,
|
|
4722
|
+
TargetContextUpdateSchema,
|
|
4723
|
+
TargetCreateRequestSchema,
|
|
4724
|
+
TargetJobRequestSchema,
|
|
4725
|
+
TargetListItemSchema,
|
|
4726
|
+
TargetListSchema,
|
|
4727
|
+
TargetMetadataSchema,
|
|
4728
|
+
TargetProbeRequestSchema,
|
|
4729
|
+
TargetProfileResponseSchema,
|
|
4730
|
+
TargetReferenceSchema,
|
|
4731
|
+
TargetResponseSchema,
|
|
4732
|
+
TargetStatus,
|
|
4733
|
+
TargetType,
|
|
4734
|
+
TargetUpdateRequestSchema,
|
|
4735
|
+
ThreatCategory,
|
|
1346
4736
|
ThreatScanReportSchema,
|
|
1347
4737
|
ToolDetectedSchema,
|
|
1348
4738
|
ToolEventMetadataSchema,
|
|
@@ -1350,7 +4740,10 @@ export {
|
|
|
1350
4740
|
TopicsClient,
|
|
1351
4741
|
USER_AGENT,
|
|
1352
4742
|
UrlfEntrySchema,
|
|
4743
|
+
ValidationErrorSchema,
|
|
1353
4744
|
Verdict,
|
|
4745
|
+
ViolationListSchema,
|
|
4746
|
+
ViolationResponseSchema,
|
|
1354
4747
|
globalConfiguration,
|
|
1355
4748
|
init
|
|
1356
4749
|
};
|