From 1dd6b5bb0ec64e8b93f6e343fcb1e1f0976df710 Mon Sep 17 00:00:00 2001 From: Joe Strickland Date: Wed, 18 Dec 2024 16:29:23 -0500 Subject: [PATCH] Added Cloud Onboarding Endpoints. Need Documentation --- .../AWS Accounts/Add AWS Account.bru | 32 +++++++++ .../AWS Accounts/Add Service.bru | 33 +++++++++ .../AWS Accounts/Delete AWS Account.bru | 27 +++++++ .../AWS Accounts/Generate CF Link.bru | 36 ++++++++++ .../AWS Accounts/Get AWS Account by Id.bru | 27 +++++++ .../AWS Accounts/Get AWS Accounts.bru | 23 ++++++ .../AWS Accounts/Remove Service.bru | 33 +++++++++ .../Add AWS Organization.bru | 34 +++++++++ .../AWS Organizations/Add Services.bru | 60 ++++++++++++++++ .../AWS Organizations/Generate CF Link.bru | 65 +++++++++++++++++ .../Get AWS Org Hierarchy.bru | 23 ++++++ .../AWS Organizations/Get AWS Org by Id.bru | 22 ++++++ .../AWS Organizations/Remove Organization.bru | 33 +++++++++ .../AWS Organizations/Remove Services.bru | 33 +++++++++ .../AWS Organizations/Scan.bru | 33 +++++++++ .../AWS Organizations/Verify Correlation.bru | 72 +++++++++++++++++++ .../AWS/Get AWS Action Items.bru | 23 ++++++ .../AWS/Get AWS Workspaces.bru | 23 ++++++ .../General/Validate Onboarding.bru | 34 +++++++++ 19 files changed, 666 insertions(+) create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Add AWS Account.bru create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Add Service.bru create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Delete AWS Account.bru create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Generate CF Link.bru create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Get AWS Account by Id.bru create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Get AWS Accounts.bru create mode 100644 SaaS/Cloud Onboarding/AWS Accounts/Remove Service.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Add AWS Organization.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Add Services.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Generate CF Link.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org Hierarchy.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org by Id.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Remove Organization.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Remove Services.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Scan.bru create mode 100644 SaaS/Cloud Onboarding/AWS Organizations/Verify Correlation.bru create mode 100644 SaaS/Cloud Onboarding/AWS/Get AWS Action Items.bru create mode 100644 SaaS/Cloud Onboarding/AWS/Get AWS Workspaces.bru create mode 100644 SaaS/Cloud Onboarding/General/Validate Onboarding.bru diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Add AWS Account.bru b/SaaS/Cloud Onboarding/AWS Accounts/Add AWS Account.bru new file mode 100644 index 0000000..4c0f9f4 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Add AWS Account.bru @@ -0,0 +1,32 @@ +meta { + name: Add AWS Account + type: http + seq: 3 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/account + body: json + auth: none +} + +body:json { + { + "accountId": "823467896521", + "services": ["dpa"], + "accountDisplayName": "PIN - TEST", + "description": "Pineapple Test" + } +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Add Service.bru b/SaaS/Cloud Onboarding/AWS Accounts/Add Service.bru new file mode 100644 index 0000000..1a95594 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Add Service.bru @@ -0,0 +1,33 @@ +meta { + name: Add Service + type: http + seq: 6 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/account/{{id}}/services + body: json + auth: none +} + +body:json { + { + "services": ["secrets_hub"] + } +} + +vars:pre-request { + id: 1339d34c9db34a19a601653b9d086f61 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Delete AWS Account.bru b/SaaS/Cloud Onboarding/AWS Accounts/Delete AWS Account.bru new file mode 100644 index 0000000..a4dc7c1 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Delete AWS Account.bru @@ -0,0 +1,27 @@ +meta { + name: Delete AWS Account + type: http + seq: 4 +} + +delete { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/account/{{id}} + body: none + auth: none +} + +vars:pre-request { + id: 1339d34c9db34a19a601653b9d086f61 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Generate CF Link.bru b/SaaS/Cloud Onboarding/AWS Accounts/Generate CF Link.bru new file mode 100644 index 0000000..006c2f6 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Generate CF Link.bru @@ -0,0 +1,36 @@ +meta { + name: Generate CF Link + type: http + seq: 5 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/account/{{id}}/generate-link + body: json + auth: none +} + +body:json { + { + "accountId":"969656756524", + "services":["dpa"], + "accountDisplayName":"PIN - AWS - Root", + "description": "Pineapple AWS Root Account" + } +} + +vars:pre-request { + id: +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Get AWS Account by Id.bru b/SaaS/Cloud Onboarding/AWS Accounts/Get AWS Account by Id.bru new file mode 100644 index 0000000..bd45931 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Get AWS Account by Id.bru @@ -0,0 +1,27 @@ +meta { + name: Get AWS Account by Id + type: http + seq: 2 +} + +get { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/account/{{id}} + body: none + auth: none +} + +vars:pre-request { + id: 1339d34c9db34a19a601653b9d086f61 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Get AWS Accounts.bru b/SaaS/Cloud Onboarding/AWS Accounts/Get AWS Accounts.bru new file mode 100644 index 0000000..9f5b67c --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Get AWS Accounts.bru @@ -0,0 +1,23 @@ +meta { + name: Get AWS Accounts + type: http + seq: 1 +} + +get { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/accounts + body: none + auth: none +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Accounts/Remove Service.bru b/SaaS/Cloud Onboarding/AWS Accounts/Remove Service.bru new file mode 100644 index 0000000..0858bbe --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Accounts/Remove Service.bru @@ -0,0 +1,33 @@ +meta { + name: Remove Service + type: http + seq: 7 +} + +delete { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/account/{{id}}/services + body: json + auth: none +} + +body:json { + { + "services": ["dpa"] + } +} + +vars:pre-request { + id: 1339d34c9db34a19a601653b9d086f61 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Add AWS Organization.bru b/SaaS/Cloud Onboarding/AWS Organizations/Add AWS Organization.bru new file mode 100644 index 0000000..7c4c972 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Add AWS Organization.bru @@ -0,0 +1,34 @@ +meta { + name: Add AWS Organization + type: http + seq: 3 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organization + body: json + auth: none +} + +body:json { + { + "organizationRootId":"r-zjhf", + "organizationId":"o-apl4ofpkaq", + "managementAccountId":"969656756524", + "services":["dpa"], + "accountDisplayName":"PIN - AWS - IC - COB", + "description": "Pineapple AWS via Cloud Onboarding" + } +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Add Services.bru b/SaaS/Cloud Onboarding/AWS Organizations/Add Services.bru new file mode 100644 index 0000000..011f1d9 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Add Services.bru @@ -0,0 +1,60 @@ +meta { + name: Add Services + type: http + seq: 6 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organization/{{id}}/services + body: json + auth: none +} + +body:json { + { + "services":["secrets_hub"] + } +} + +vars:pre-request { + id: 230f9c6b773aexample98892bf3aa7 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + const tools = require('./tools/tools'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); + + // Sets pasSafeMemberName for testing based on environment flag and variables + var flag = bru.getEnvVar('testFlag') + if (flag == 'true') { + tools.log('Setting Variables'); + bru.setVar('id', bru.getEnvVar('testAwsCybrId')); + tools.log('Cybr AWS ID: ' + bru.getEnvVar('testAwsCybrId')) + } +} + +script:post-response { + // Log on error + const tools = require('./tools/tools'); + + // Log on error + if (res.status != 200) { + if (res.body.message) { + tools.log('Message: ' + res.body.message); + } + if (res.body.code) { + tools.log('Code: ' + res.body.code); + } + if (res.body.description) { + tools.log('Description: ' + res.body.description); + } + } +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Generate CF Link.bru b/SaaS/Cloud Onboarding/AWS Organizations/Generate CF Link.bru new file mode 100644 index 0000000..37844a1 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Generate CF Link.bru @@ -0,0 +1,65 @@ +meta { + name: Generate CF Link + type: http + seq: 4 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organization/{{id}}/generate-link + body: none + auth: none +} + +body:json { + { + "organizationRootId":"r-zjhf", + "organizationId":"o-apl4ofpkaq", + "managementAccountId":"969656756524", + "services":["dpa"], + "accountDisplayName":"PIN - AWS - IC - COB", + "description": "Pineapple AWS via Cloud Onboarding" + } +} + +vars:pre-request { + id: 230f9c6b773example2bf3aa7 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + const tools = require('./tools/tools'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); + + // Sets pasSafeMemberName for testing based on environment flag and variables + var flag = bru.getEnvVar('testFlag') + if (flag == 'true') { + tools.log('Setting Variables'); + bru.setVar('id', bru.getEnvVar('testAwsCybrId')); + tools.log('Cybr AWS ID: ' + bru.getEnvVar('testAwsCybrId')) + } +} + +script:post-response { + // Log on error + const tools = require('./tools/tools'); + + // Log on error + if (res.status != 200) { + if (res.body.message) { + tools.log('Message: ' + res.body.message); + } + if (res.body.code) { + tools.log('Code: ' + res.body.code); + } + if (res.body.description) { + tools.log('Description: ' + res.body.description); + } + } +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org Hierarchy.bru b/SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org Hierarchy.bru new file mode 100644 index 0000000..fb16ef2 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org Hierarchy.bru @@ -0,0 +1,23 @@ +meta { + name: Get AWS Org Hierarchy + type: http + seq: 1 +} + +get { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organizations + body: none + auth: none +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org by Id.bru b/SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org by Id.bru new file mode 100644 index 0000000..8e8d2b8 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Get AWS Org by Id.bru @@ -0,0 +1,22 @@ +meta { + name: Get AWS Org by Id + type: http + seq: 2 +} + +get { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organization/{{id}} + body: none + auth: none +} + +vars:pre-request { + id: 230f9c6b773a4baewewd498892bf3aa7 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Remove Organization.bru b/SaaS/Cloud Onboarding/AWS Organizations/Remove Organization.bru new file mode 100644 index 0000000..a1d7f3a --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Remove Organization.bru @@ -0,0 +1,33 @@ +meta { + name: Remove Organization + type: http + seq: 8 +} + +delete { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organization/{{awsOrgId}} + body: none + auth: none +} + +body:json { + { + "services":["secrets_hub"] + } +} + +vars:pre-request { + awsOrgId: +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Remove Services.bru b/SaaS/Cloud Onboarding/AWS Organizations/Remove Services.bru new file mode 100644 index 0000000..322c415 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Remove Services.bru @@ -0,0 +1,33 @@ +meta { + name: Remove Services + type: http + seq: 7 +} + +delete { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organization/{{awsOrgId}}/services + body: json + auth: none +} + +body:json { + { + "services":["secrets_hub"] + } +} + +vars:pre-request { + awsOrgId: 230f9c6b773a4bafbbdd498892bf3aa7 +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Scan.bru b/SaaS/Cloud Onboarding/AWS Organizations/Scan.bru new file mode 100644 index 0000000..5721b16 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Scan.bru @@ -0,0 +1,33 @@ +meta { + name: Scan + type: http + seq: 5 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/organizations/scan + body: none + auth: none +} + +body:json { + { + "organizationRootId":"r-zjhf", + "organizationId":"o-apl4ofpkaq", + "managementAccountId":"969656756524", + "services":["dpa"], + "accountDisplayName":"PIN - AWS - IC - COB", + "description": "Pineapple AWS via Cloud Onboarding" + } +} + +assert { + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS Organizations/Verify Correlation.bru b/SaaS/Cloud Onboarding/AWS Organizations/Verify Correlation.bru new file mode 100644 index 0000000..27c6cbd --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS Organizations/Verify Correlation.bru @@ -0,0 +1,72 @@ +meta { + name: Verify Correlation + type: http + seq: 9 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/validate-onboarding + body: json + auth: none +} + +body:json { + { + "organizationRootId":"r-zjhf", + "organizationId":"o-apl4ofpkaq", + "managementAccountId":"969656756524", + "services":["dpa"], + "accountDisplayName":"PIN - AWS - IC - COB", + "description": "Pineapple AWS via Cloud Onboarding" + } +} + +vars:pre-request { + awsOrgId: o-aps4ofabcd + awsAccountId: 1243456756524 + correlationValue: + tenantId: +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + const tools = require('./tools/tools'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); + + // Sets pasSafeMemberName for testing based on environment flag and variables + var flag = bru.getEnvVar('testFlag') + if (flag == 'true') { + tools.log('Setting Variables'); + bru.setVar('awsOrgId', bru.getEnvVar('testAwsOrgId')); + bru.setVar('awsAccountId', bru.getEnvVar('testAwsAcctId')); + bru.setVar('tenantId', bru.getEnvVar('tenantId')); + tools.log('AWS Org Id: ' + bru.getEnvVar('testAwsOrgId')) + tools.log('AWS Account Id: ' + bru.getEnvVar('testAwsAcctId')) + tools.log('Tenant Id: ' + bru.getEnvVar('tenantId')) + } +} + +script:post-response { + // Log on error + const tools = require('./tools/tools'); + + // Log on error + if (res.status != 200) { + if (res.body.Message) { + tools.log('Message: ' + res.body.Message); + } + if (res.body.code) { + tools.log('Code: ' + res.body.code); + } + if (res.body.description) { + tools.log('Description: ' + res.body.description); + } + } +} diff --git a/SaaS/Cloud Onboarding/AWS/Get AWS Action Items.bru b/SaaS/Cloud Onboarding/AWS/Get AWS Action Items.bru new file mode 100644 index 0000000..1336b5c --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS/Get AWS Action Items.bru @@ -0,0 +1,23 @@ +meta { + name: Get AWS Action Items + type: http + seq: 2 +} + +get { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/aws/action-items + body: none + auth: none +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/AWS/Get AWS Workspaces.bru b/SaaS/Cloud Onboarding/AWS/Get AWS Workspaces.bru new file mode 100644 index 0000000..5bfc532 --- /dev/null +++ b/SaaS/Cloud Onboarding/AWS/Get AWS Workspaces.bru @@ -0,0 +1,23 @@ +meta { + name: Get AWS Workspaces + type: http + seq: 1 +} + +get { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/ui/aws/workspaces + body: none + auth: none +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +} diff --git a/SaaS/Cloud Onboarding/General/Validate Onboarding.bru b/SaaS/Cloud Onboarding/General/Validate Onboarding.bru new file mode 100644 index 0000000..86ae793 --- /dev/null +++ b/SaaS/Cloud Onboarding/General/Validate Onboarding.bru @@ -0,0 +1,34 @@ +meta { + name: Validate Onboarding + type: http + seq: 1 +} + +post { + url: https://{{identityTenantName}}-cloud_onboarding.cyberark.cloud/api/validate-onboarding + body: none + auth: none +} + +body:json { + { + "organizationRootId":"r-zjhf", + "organizationId":"o-apl4ofpkaq", + "managementAccountId":"969656756524", + "services":["dpa"], + "accountDisplayName":"PIN - AWS - IC - COB", + "description": "Pineapple AWS via Cloud Onboarding" + } +} + +assert { + res.body: isJson + res.status: eq 200 +} + +script:pre-request { + const platformTokenAuth = require('./tools/platformTokenAuth'); + + // Perform authentication usings platformToken.js tools + await platformTokenAuth.login(); +}