@cdot65/prisma-airs-sdk 0.6.7 → 0.6.9
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/README.md +13 -28
- package/dist/index.cjs +148 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18098 -7347
- package/dist/index.d.ts +18098 -7347
- package/dist/index.js +133 -35
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
29
29
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
30
30
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
31
31
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
32
|
-
var SDK_VERSION = "0.6.
|
|
32
|
+
var SDK_VERSION = "0.6.9";
|
|
33
33
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
34
34
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
35
35
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -930,41 +930,90 @@ var ErrorResponseSchema = z15.object({
|
|
|
930
930
|
|
|
931
931
|
// src/models/mgmt-security-profile.ts
|
|
932
932
|
import { z as z16 } from "zod";
|
|
933
|
-
var
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
}).passthrough();
|
|
937
|
-
var
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
"
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}).passthrough()
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
933
|
+
var PolicyLatencySchema = z16.object({
|
|
934
|
+
"inline-timeout-action": z16.string().optional(),
|
|
935
|
+
"max-inline-latency": z16.number().optional()
|
|
936
|
+
}).passthrough();
|
|
937
|
+
var DataLeakDetectionMemberSchema = z16.object({
|
|
938
|
+
text: z16.string(),
|
|
939
|
+
id: z16.string().optional(),
|
|
940
|
+
version: z16.string().optional()
|
|
941
|
+
}).passthrough();
|
|
942
|
+
var DatabaseSecurityItemSchema = z16.object({
|
|
943
|
+
name: z16.string(),
|
|
944
|
+
action: z16.string()
|
|
945
|
+
}).passthrough();
|
|
946
|
+
var DataProtectionSchema = z16.object({
|
|
947
|
+
"data-leak-detection": z16.object({
|
|
948
|
+
member: z16.array(DataLeakDetectionMemberSchema).nullable().optional(),
|
|
949
|
+
action: z16.string(),
|
|
950
|
+
"mask-data-inline": z16.boolean().optional()
|
|
951
|
+
}).passthrough().optional(),
|
|
952
|
+
"database-security": z16.array(DatabaseSecurityItemSchema).nullable().optional()
|
|
953
|
+
}).passthrough();
|
|
954
|
+
var UrlCategorySchema = z16.object({
|
|
955
|
+
member: z16.array(z16.string()).nullable().optional()
|
|
956
|
+
}).passthrough();
|
|
957
|
+
var MaliciousCodeProtectionSchema = z16.object({
|
|
958
|
+
name: z16.string(),
|
|
959
|
+
action: z16.string()
|
|
960
|
+
}).passthrough();
|
|
961
|
+
var PolicyAppProtectionSchema = z16.object({
|
|
962
|
+
"alert-url-category": UrlCategorySchema.optional(),
|
|
963
|
+
"block-url-category": UrlCategorySchema.optional(),
|
|
964
|
+
"allow-url-category": UrlCategorySchema.optional(),
|
|
965
|
+
"default-url-category": UrlCategorySchema.optional(),
|
|
966
|
+
"url-detected-action": z16.string().optional(),
|
|
967
|
+
"malicious-code-protection": MaliciousCodeProtectionSchema.optional()
|
|
968
|
+
}).passthrough();
|
|
969
|
+
var TopicObjectSchema = z16.object({
|
|
970
|
+
topic_name: z16.string(),
|
|
971
|
+
topic_id: z16.string(),
|
|
972
|
+
revision: z16.number()
|
|
973
|
+
}).passthrough();
|
|
974
|
+
var TopicArraySchema = z16.object({
|
|
975
|
+
action: z16.string(),
|
|
976
|
+
topic: z16.array(TopicObjectSchema)
|
|
977
|
+
}).passthrough();
|
|
978
|
+
var ModelProtectionItemSchema = z16.object({
|
|
979
|
+
name: z16.string(),
|
|
980
|
+
action: z16.string(),
|
|
981
|
+
"topic-list": z16.array(TopicArraySchema).optional()
|
|
982
|
+
}).passthrough();
|
|
983
|
+
var AgentProtectionItemSchema = z16.object({
|
|
984
|
+
name: z16.string(),
|
|
985
|
+
action: z16.string()
|
|
986
|
+
}).passthrough();
|
|
987
|
+
var DlpRuleSchema = z16.object({
|
|
988
|
+
action: z16.string().optional()
|
|
989
|
+
}).passthrough();
|
|
990
|
+
var DlpDataProfilePolicySchema = z16.object({
|
|
991
|
+
name: z16.string(),
|
|
992
|
+
uuid: z16.string(),
|
|
993
|
+
id: z16.string().optional(),
|
|
994
|
+
version: z16.string().optional(),
|
|
995
|
+
rule1: DlpRuleSchema.optional(),
|
|
996
|
+
rule2: DlpRuleSchema.optional(),
|
|
997
|
+
"log-severity": z16.string().optional(),
|
|
998
|
+
"non-file-based": z16.string().optional(),
|
|
999
|
+
"file-based": z16.string().optional()
|
|
958
1000
|
}).passthrough();
|
|
959
1001
|
var ModelConfigurationSchema = z16.object({
|
|
960
|
-
|
|
1002
|
+
"mask-data-in-storage": z16.boolean().optional(),
|
|
1003
|
+
latency: PolicyLatencySchema.optional(),
|
|
1004
|
+
"data-protection": DataProtectionSchema.optional(),
|
|
1005
|
+
"app-protection": PolicyAppProtectionSchema.optional(),
|
|
1006
|
+
"model-protection": z16.array(ModelProtectionItemSchema).optional(),
|
|
1007
|
+
"agent-protection": z16.array(AgentProtectionItemSchema).optional()
|
|
1008
|
+
}).passthrough();
|
|
1009
|
+
var AiSecurityProfileSchema = z16.object({
|
|
1010
|
+
"model-type": z16.string().optional(),
|
|
1011
|
+
"content-type": z16.string().optional(),
|
|
1012
|
+
"model-configuration": ModelConfigurationSchema.optional()
|
|
961
1013
|
}).passthrough();
|
|
962
1014
|
var PolicySchema = z16.object({
|
|
963
|
-
"
|
|
964
|
-
"
|
|
965
|
-
"model-protection": ModelProtectionSchema.optional(),
|
|
966
|
-
"agent-protection": AgentProtectionSchema.optional(),
|
|
967
|
-
"model-configuration": ModelConfigurationSchema.optional()
|
|
1015
|
+
"ai-security-profiles": z16.array(AiSecurityProfileSchema).optional(),
|
|
1016
|
+
"dlp-data-profiles": z16.array(DlpDataProfilePolicySchema).optional()
|
|
968
1017
|
}).passthrough();
|
|
969
1018
|
var SecurityProfileSchema = z16.object({
|
|
970
1019
|
profile_id: z16.string().optional(),
|
|
@@ -1154,7 +1203,7 @@ var DeploymentProfilesResponseSchema = z20.object({
|
|
|
1154
1203
|
|
|
1155
1204
|
// src/models/mgmt-dlp-profile.ts
|
|
1156
1205
|
import { z as z21 } from "zod";
|
|
1157
|
-
var
|
|
1206
|
+
var DlpDataProfileSchema = z21.object({
|
|
1158
1207
|
name: z21.string(),
|
|
1159
1208
|
uuid: z21.string(),
|
|
1160
1209
|
id: z21.string().optional(),
|
|
@@ -1166,7 +1215,7 @@ var DlpDataProfileSchema2 = z21.object({
|
|
|
1166
1215
|
"file-based": z21.string().optional()
|
|
1167
1216
|
}).passthrough();
|
|
1168
1217
|
var DlpProfileListResponseSchema = z21.object({
|
|
1169
|
-
dlp_profiles: z21.array(
|
|
1218
|
+
dlp_profiles: z21.array(DlpDataProfileSchema).optional()
|
|
1170
1219
|
}).passthrough();
|
|
1171
1220
|
|
|
1172
1221
|
// src/models/mgmt-scan-log.ts
|
|
@@ -2984,6 +3033,40 @@ var ProfilesClient = class {
|
|
|
2984
3033
|
});
|
|
2985
3034
|
return res.data;
|
|
2986
3035
|
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Get a security profile by UUID.
|
|
3038
|
+
* Fetches all profiles and filters — no dedicated API endpoint exists.
|
|
3039
|
+
* @param profileId - UUID of the profile to retrieve.
|
|
3040
|
+
* @returns The matching security profile.
|
|
3041
|
+
*/
|
|
3042
|
+
async get(profileId) {
|
|
3043
|
+
const { ai_profiles } = await this.list();
|
|
3044
|
+
const profile = ai_profiles.find((p) => p.profile_id === profileId);
|
|
3045
|
+
if (!profile) {
|
|
3046
|
+
throw new AISecSDKException(
|
|
3047
|
+
`Profile not found: ${profileId}`,
|
|
3048
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3049
|
+
);
|
|
3050
|
+
}
|
|
3051
|
+
return profile;
|
|
3052
|
+
}
|
|
3053
|
+
/**
|
|
3054
|
+
* Get a security profile by name.
|
|
3055
|
+
* Returns the highest-revision match (latest version).
|
|
3056
|
+
* @param profileName - Name of the profile to retrieve.
|
|
3057
|
+
* @returns The matching security profile with the highest revision.
|
|
3058
|
+
*/
|
|
3059
|
+
async getByName(profileName) {
|
|
3060
|
+
const { ai_profiles } = await this.list();
|
|
3061
|
+
const matches = ai_profiles.filter((p) => p.profile_name === profileName);
|
|
3062
|
+
if (matches.length === 0) {
|
|
3063
|
+
throw new AISecSDKException(
|
|
3064
|
+
`Profile not found: ${profileName}`,
|
|
3065
|
+
"AISEC_USER_REQUEST_PAYLOAD_ERROR" /* USER_REQUEST_PAYLOAD_ERROR */
|
|
3066
|
+
);
|
|
3067
|
+
}
|
|
3068
|
+
return matches.reduce((best, p) => (p.revision ?? 0) > (best.revision ?? 0) ? p : best);
|
|
3069
|
+
}
|
|
2987
3070
|
/**
|
|
2988
3071
|
* Update an existing security profile.
|
|
2989
3072
|
* @param profileId - UUID of the profile to update.
|
|
@@ -5522,8 +5605,10 @@ export {
|
|
|
5522
5605
|
Action,
|
|
5523
5606
|
AgentEntrySchema,
|
|
5524
5607
|
AgentMetaSchema,
|
|
5608
|
+
AgentProtectionItemSchema,
|
|
5525
5609
|
AgentReportSchema,
|
|
5526
5610
|
AiProfileSchema,
|
|
5611
|
+
AiSecurityProfileSchema,
|
|
5527
5612
|
ApiEndpointType,
|
|
5528
5613
|
ApiKeyCreateRequestSchema,
|
|
5529
5614
|
ApiKeyDPInfoSchema,
|
|
@@ -5599,6 +5684,9 @@ export {
|
|
|
5599
5684
|
DSDetailResultSchema,
|
|
5600
5685
|
DSResultMetadataSchema,
|
|
5601
5686
|
DashboardOverviewResponseSchema,
|
|
5687
|
+
DataLeakDetectionMemberSchema,
|
|
5688
|
+
DataProtectionSchema,
|
|
5689
|
+
DatabaseSecurityItemSchema,
|
|
5602
5690
|
DatabricksConnectionParamsSchema,
|
|
5603
5691
|
DateRangeFilter,
|
|
5604
5692
|
DbsEntrySchema,
|
|
@@ -5612,11 +5700,13 @@ export {
|
|
|
5612
5700
|
DeploymentProfilesResponseSchema,
|
|
5613
5701
|
DetectionServiceName,
|
|
5614
5702
|
DetectionServiceResultSchema,
|
|
5615
|
-
|
|
5703
|
+
DlpDataProfilePolicySchema,
|
|
5704
|
+
DlpDataProfileSchema,
|
|
5616
5705
|
DlpPatternDetectionSchema,
|
|
5617
5706
|
DlpProfileListResponseSchema,
|
|
5618
5707
|
DlpProfilesClient,
|
|
5619
5708
|
DlpReportSchema,
|
|
5709
|
+
DlpRuleSchema,
|
|
5620
5710
|
DynamicJobMetadataSchema,
|
|
5621
5711
|
DynamicJobReportSchema,
|
|
5622
5712
|
DynamicJobReportStatsSchema,
|
|
@@ -5708,12 +5798,15 @@ export {
|
|
|
5708
5798
|
MODEL_SEC_TOKEN_ENDPOINT,
|
|
5709
5799
|
MODEL_SEC_TSG_ID,
|
|
5710
5800
|
MODEL_SEC_VIOLATIONS_PATH,
|
|
5801
|
+
MaliciousCodeProtectionSchema,
|
|
5711
5802
|
MalwareReportSchema,
|
|
5712
5803
|
ManagementClient,
|
|
5713
5804
|
MaskedDataSchema,
|
|
5714
5805
|
McEntrySchema,
|
|
5715
5806
|
McReportSchema,
|
|
5716
5807
|
MetadataSchema,
|
|
5808
|
+
ModelConfigurationSchema,
|
|
5809
|
+
ModelProtectionItemSchema,
|
|
5717
5810
|
ModelScanIssueSchema,
|
|
5718
5811
|
ModelScanStatus,
|
|
5719
5812
|
ModelSecurityClient,
|
|
@@ -5738,6 +5831,8 @@ export {
|
|
|
5738
5831
|
PAYLOAD_HASH,
|
|
5739
5832
|
PaginatedScanResultsSchema,
|
|
5740
5833
|
PatternDetectionSchema,
|
|
5834
|
+
PolicyAppProtectionSchema,
|
|
5835
|
+
PolicyLatencySchema,
|
|
5741
5836
|
PolicySchema,
|
|
5742
5837
|
PolicyType,
|
|
5743
5838
|
PrerequisiteModelSchema,
|
|
@@ -5880,8 +5975,11 @@ export {
|
|
|
5880
5975
|
ToolDetectedSchema,
|
|
5881
5976
|
ToolEventMetadataSchema,
|
|
5882
5977
|
ToolEventSchema,
|
|
5978
|
+
TopicArraySchema,
|
|
5979
|
+
TopicObjectSchema,
|
|
5883
5980
|
TopicsClient,
|
|
5884
5981
|
USER_AGENT,
|
|
5982
|
+
UrlCategorySchema,
|
|
5885
5983
|
UrlfEntrySchema,
|
|
5886
5984
|
ValidationErrorSchema,
|
|
5887
5985
|
Verdict,
|