@cdot65/prisma-airs-sdk 0.6.0 → 0.6.1
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 +44 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -6
- package/dist/index.d.ts +45 -6
- package/dist/index.js +44 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -371,7 +371,7 @@ var MAX_NUMBER_OF_BATCH_SCAN_OBJECTS = 5;
|
|
|
371
371
|
var MAX_CONNECTION_POOL_SIZE = 100;
|
|
372
372
|
var MAX_NUMBER_OF_RETRIES = 5;
|
|
373
373
|
var HTTP_FORCE_RETRY_STATUS_CODES = [500, 502, 503, 504];
|
|
374
|
-
var SDK_VERSION = "0.6.
|
|
374
|
+
var SDK_VERSION = "0.6.1";
|
|
375
375
|
var USER_AGENT = `PAN-AIRS/${SDK_VERSION}-typescript-sdk`;
|
|
376
376
|
var DEFAULT_MGMT_ENDPOINT = "https://api.sase.paloaltonetworks.com/aisec";
|
|
377
377
|
var DEFAULT_TOKEN_ENDPOINT = "https://auth.apps.paloaltonetworks.com/oauth2/access_token";
|
|
@@ -2838,7 +2838,13 @@ async function managementHttpRequest(opts) {
|
|
|
2838
2838
|
const url = new URL(`${stripped}${path}`);
|
|
2839
2839
|
if (params) {
|
|
2840
2840
|
for (const [key, value] of Object.entries(params)) {
|
|
2841
|
-
|
|
2841
|
+
if (Array.isArray(value)) {
|
|
2842
|
+
for (const v of value) {
|
|
2843
|
+
url.searchParams.append(key, v);
|
|
2844
|
+
}
|
|
2845
|
+
} else {
|
|
2846
|
+
url.searchParams.set(key, value);
|
|
2847
|
+
}
|
|
2842
2848
|
}
|
|
2843
2849
|
}
|
|
2844
2850
|
const headers = {
|
|
@@ -3426,13 +3432,23 @@ var ModelSecurityScansClient = class {
|
|
|
3426
3432
|
};
|
|
3427
3433
|
|
|
3428
3434
|
// src/model-security/security-groups-client.ts
|
|
3429
|
-
function
|
|
3435
|
+
function buildGroupListParams(opts) {
|
|
3430
3436
|
const params = {};
|
|
3431
3437
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3432
3438
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3433
|
-
if (opts?.
|
|
3434
|
-
if (opts?.
|
|
3435
|
-
if (opts?.
|
|
3439
|
+
if (opts?.sort_field !== void 0) params.sort_field = opts.sort_field;
|
|
3440
|
+
if (opts?.sort_dir !== void 0) params.sort_dir = opts.sort_dir;
|
|
3441
|
+
if (opts?.source_types !== void 0) params.source_types = opts.source_types;
|
|
3442
|
+
if (opts?.search_query !== void 0) params.search_query = opts.search_query;
|
|
3443
|
+
if (opts?.enabled_rules !== void 0) params.enabled_rules = opts.enabled_rules;
|
|
3444
|
+
return params;
|
|
3445
|
+
}
|
|
3446
|
+
function buildRuleInstanceListParams(opts) {
|
|
3447
|
+
const params = {};
|
|
3448
|
+
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3449
|
+
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3450
|
+
if (opts?.security_rule_uuid !== void 0) params.security_rule_uuid = opts.security_rule_uuid;
|
|
3451
|
+
if (opts?.state !== void 0) params.state = opts.state;
|
|
3436
3452
|
return params;
|
|
3437
3453
|
}
|
|
3438
3454
|
var ModelSecurityGroupsClient = class {
|
|
@@ -3470,7 +3486,7 @@ var ModelSecurityGroupsClient = class {
|
|
|
3470
3486
|
method: "GET",
|
|
3471
3487
|
baseUrl: this.baseUrl,
|
|
3472
3488
|
path: MODEL_SEC_SECURITY_GROUPS_PATH,
|
|
3473
|
-
params:
|
|
3489
|
+
params: buildGroupListParams(opts),
|
|
3474
3490
|
oauthClient: this.oauthClient,
|
|
3475
3491
|
numRetries: this.numRetries
|
|
3476
3492
|
});
|
|
@@ -3556,7 +3572,7 @@ var ModelSecurityGroupsClient = class {
|
|
|
3556
3572
|
method: "GET",
|
|
3557
3573
|
baseUrl: this.baseUrl,
|
|
3558
3574
|
path: `${MODEL_SEC_SECURITY_GROUPS_PATH}/${securityGroupUuid}/rule-instances`,
|
|
3559
|
-
params:
|
|
3575
|
+
params: buildRuleInstanceListParams(opts),
|
|
3560
3576
|
oauthClient: this.oauthClient,
|
|
3561
3577
|
numRetries: this.numRetries
|
|
3562
3578
|
});
|
|
@@ -3623,13 +3639,12 @@ var ModelSecurityGroupsClient = class {
|
|
|
3623
3639
|
};
|
|
3624
3640
|
|
|
3625
3641
|
// src/model-security/security-rules-client.ts
|
|
3626
|
-
function
|
|
3642
|
+
function buildRuleListParams(opts) {
|
|
3627
3643
|
const params = {};
|
|
3628
3644
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3629
3645
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
3630
|
-
if (opts?.
|
|
3631
|
-
if (opts?.
|
|
3632
|
-
if (opts?.search !== void 0) params.search = opts.search;
|
|
3646
|
+
if (opts?.source_type !== void 0) params.source_type = opts.source_type;
|
|
3647
|
+
if (opts?.search_query !== void 0) params.search_query = opts.search_query;
|
|
3633
3648
|
return params;
|
|
3634
3649
|
}
|
|
3635
3650
|
var ModelSecurityRulesClient = class {
|
|
@@ -3651,7 +3666,7 @@ var ModelSecurityRulesClient = class {
|
|
|
3651
3666
|
method: "GET",
|
|
3652
3667
|
baseUrl: this.baseUrl,
|
|
3653
3668
|
path: MODEL_SEC_SECURITY_RULES_PATH,
|
|
3654
|
-
params:
|
|
3669
|
+
params: buildRuleListParams(opts),
|
|
3655
3670
|
oauthClient: this.oauthClient,
|
|
3656
3671
|
numRetries: this.numRetries
|
|
3657
3672
|
});
|
|
@@ -3761,7 +3776,7 @@ var ModelSecurityClient = class {
|
|
|
3761
3776
|
};
|
|
3762
3777
|
|
|
3763
3778
|
// src/red-team/scans-client.ts
|
|
3764
|
-
function
|
|
3779
|
+
function buildListParams2(opts) {
|
|
3765
3780
|
const params = {};
|
|
3766
3781
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3767
3782
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
@@ -3793,7 +3808,7 @@ var RedTeamScansClient = class {
|
|
|
3793
3808
|
}
|
|
3794
3809
|
/** List red team scan jobs with optional filters. */
|
|
3795
3810
|
async list(opts) {
|
|
3796
|
-
const params =
|
|
3811
|
+
const params = buildListParams2(opts);
|
|
3797
3812
|
if (opts?.status !== void 0) params.status = opts.status;
|
|
3798
3813
|
if (opts?.job_type !== void 0) params.job_type = opts.job_type;
|
|
3799
3814
|
if (opts?.target_id !== void 0) params.target_id = opts.target_id;
|
|
@@ -3849,7 +3864,7 @@ var RedTeamScansClient = class {
|
|
|
3849
3864
|
};
|
|
3850
3865
|
|
|
3851
3866
|
// src/red-team/reports-client.ts
|
|
3852
|
-
function
|
|
3867
|
+
function buildListParams3(opts) {
|
|
3853
3868
|
const params = {};
|
|
3854
3869
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
3855
3870
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
@@ -3878,7 +3893,7 @@ var RedTeamReportsClient = class {
|
|
|
3878
3893
|
/** List attacks for a static scan. */
|
|
3879
3894
|
async listAttacks(jobId, opts) {
|
|
3880
3895
|
validateJobId(jobId);
|
|
3881
|
-
const params =
|
|
3896
|
+
const params = buildListParams3(opts);
|
|
3882
3897
|
if (opts?.status !== void 0) params.status = opts.status;
|
|
3883
3898
|
if (opts?.severity !== void 0) params.severity = opts.severity;
|
|
3884
3899
|
if (opts?.category !== void 0) params.category = opts.category;
|
|
@@ -4007,7 +4022,7 @@ var RedTeamReportsClient = class {
|
|
|
4007
4022
|
/** List goals for a dynamic scan. */
|
|
4008
4023
|
async listGoals(jobId, opts) {
|
|
4009
4024
|
validateJobId(jobId);
|
|
4010
|
-
const params =
|
|
4025
|
+
const params = buildListParams3(opts);
|
|
4011
4026
|
if (opts?.goal_type !== void 0) params.goal_type = opts.goal_type;
|
|
4012
4027
|
const res = await managementHttpRequest({
|
|
4013
4028
|
method: "GET",
|
|
@@ -4032,7 +4047,7 @@ var RedTeamReportsClient = class {
|
|
|
4032
4047
|
method: "GET",
|
|
4033
4048
|
baseUrl: this.baseUrl,
|
|
4034
4049
|
path: `${RED_TEAM_REPORT_DYNAMIC_PATH}/${jobId}/goal/${goalId}/list-streams`,
|
|
4035
|
-
params:
|
|
4050
|
+
params: buildListParams3(opts),
|
|
4036
4051
|
oauthClient: this.oauthClient,
|
|
4037
4052
|
numRetries: this.numRetries
|
|
4038
4053
|
});
|
|
@@ -4088,7 +4103,7 @@ var RedTeamReportsClient = class {
|
|
|
4088
4103
|
};
|
|
4089
4104
|
|
|
4090
4105
|
// src/red-team/custom-attack-reports-client.ts
|
|
4091
|
-
function
|
|
4106
|
+
function buildListParams4(opts) {
|
|
4092
4107
|
const params = {};
|
|
4093
4108
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4094
4109
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
@@ -4148,7 +4163,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
4148
4163
|
method: "GET",
|
|
4149
4164
|
baseUrl: this.baseUrl,
|
|
4150
4165
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/report/${jobId}/prompt-set/${promptSetId}/prompts`,
|
|
4151
|
-
params:
|
|
4166
|
+
params: buildListParams4(opts),
|
|
4152
4167
|
oauthClient: this.oauthClient,
|
|
4153
4168
|
numRetries: this.numRetries
|
|
4154
4169
|
});
|
|
@@ -4179,7 +4194,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
4179
4194
|
method: "GET",
|
|
4180
4195
|
baseUrl: this.baseUrl,
|
|
4181
4196
|
path: `${RED_TEAM_CUSTOM_ATTACKS_REPORT_PATH}/job/${jobId}/list-custom-attacks`,
|
|
4182
|
-
params:
|
|
4197
|
+
params: buildListParams4(opts),
|
|
4183
4198
|
oauthClient: this.oauthClient,
|
|
4184
4199
|
numRetries: this.numRetries
|
|
4185
4200
|
});
|
|
@@ -4218,7 +4233,7 @@ var RedTeamCustomAttackReportsClient = class {
|
|
|
4218
4233
|
};
|
|
4219
4234
|
|
|
4220
4235
|
// src/red-team/targets-client.ts
|
|
4221
|
-
function
|
|
4236
|
+
function buildListParams5(opts) {
|
|
4222
4237
|
const params = {};
|
|
4223
4238
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4224
4239
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
@@ -4253,7 +4268,7 @@ var RedTeamTargetsClient = class {
|
|
|
4253
4268
|
}
|
|
4254
4269
|
/** List targets with optional filters. */
|
|
4255
4270
|
async list(opts) {
|
|
4256
|
-
const params =
|
|
4271
|
+
const params = buildListParams5(opts);
|
|
4257
4272
|
if (opts?.target_type !== void 0) params.target_type = opts.target_type;
|
|
4258
4273
|
if (opts?.status !== void 0) params.status = opts.status;
|
|
4259
4274
|
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
@@ -4372,7 +4387,7 @@ var RedTeamTargetsClient = class {
|
|
|
4372
4387
|
};
|
|
4373
4388
|
|
|
4374
4389
|
// src/red-team/custom-attacks-client.ts
|
|
4375
|
-
function
|
|
4390
|
+
function buildListParams6(opts) {
|
|
4376
4391
|
const params = {};
|
|
4377
4392
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4378
4393
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
@@ -4412,7 +4427,7 @@ var RedTeamCustomAttacksClient = class {
|
|
|
4412
4427
|
}
|
|
4413
4428
|
/** List custom prompt sets. */
|
|
4414
4429
|
async listPromptSets(opts) {
|
|
4415
|
-
const params =
|
|
4430
|
+
const params = buildListParams6(opts);
|
|
4416
4431
|
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4417
4432
|
if (opts?.archive !== void 0) params.archive = String(opts.archive);
|
|
4418
4433
|
const res = await managementHttpRequest({
|
|
@@ -4555,7 +4570,7 @@ var RedTeamCustomAttacksClient = class {
|
|
|
4555
4570
|
/** List prompts in a prompt set. */
|
|
4556
4571
|
async listPrompts(promptSetUuid, opts) {
|
|
4557
4572
|
validateUuid(promptSetUuid, "prompt set uuid");
|
|
4558
|
-
const params =
|
|
4573
|
+
const params = buildListParams6(opts);
|
|
4559
4574
|
if (opts?.active !== void 0) params.active = String(opts.active);
|
|
4560
4575
|
const res = await managementHttpRequest({
|
|
4561
4576
|
method: "GET",
|
|
@@ -4676,7 +4691,7 @@ var RedTeamCustomAttacksClient = class {
|
|
|
4676
4691
|
};
|
|
4677
4692
|
|
|
4678
4693
|
// src/red-team/client.ts
|
|
4679
|
-
function
|
|
4694
|
+
function buildListParams7(opts) {
|
|
4680
4695
|
const params = {};
|
|
4681
4696
|
if (opts?.skip !== void 0) params.skip = String(opts.skip);
|
|
4682
4697
|
if (opts?.limit !== void 0) params.limit = String(opts.limit);
|
|
@@ -4815,7 +4830,7 @@ var RedTeamClient = class {
|
|
|
4815
4830
|
method: "GET",
|
|
4816
4831
|
baseUrl: this.dataEndpoint,
|
|
4817
4832
|
path: `${RED_TEAM_ERROR_LOG_PATH}/${jobId}`,
|
|
4818
|
-
params:
|
|
4833
|
+
params: buildListParams7(opts),
|
|
4819
4834
|
oauthClient: this.oauthClient,
|
|
4820
4835
|
numRetries: this.numRetries
|
|
4821
4836
|
});
|