Skip to content

Commit

Permalink
Added Cloud Onboarding Endpoints. Need Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
strick-j committed Dec 18, 2024
1 parent 1ef219d commit 1dd6b5b
Show file tree
Hide file tree
Showing 19 changed files with 666 additions and 0 deletions.
32 changes: 32 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Add AWS Account.bru
Original file line number Diff line number Diff line change
@@ -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();
}
33 changes: 33 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Add Service.bru
Original file line number Diff line number Diff line change
@@ -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();
}
27 changes: 27 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Delete AWS Account.bru
Original file line number Diff line number Diff line change
@@ -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();
}
36 changes: 36 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Generate CF Link.bru
Original file line number Diff line number Diff line change
@@ -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();
}
27 changes: 27 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Get AWS Account by Id.bru
Original file line number Diff line number Diff line change
@@ -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();
}
23 changes: 23 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Get AWS Accounts.bru
Original file line number Diff line number Diff line change
@@ -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();
}
33 changes: 33 additions & 0 deletions SaaS/Cloud Onboarding/AWS Accounts/Remove Service.bru
Original file line number Diff line number Diff line change
@@ -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();
}
34 changes: 34 additions & 0 deletions SaaS/Cloud Onboarding/AWS Organizations/Add AWS Organization.bru
Original file line number Diff line number Diff line change
@@ -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();
}
60 changes: 60 additions & 0 deletions SaaS/Cloud Onboarding/AWS Organizations/Add Services.bru
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
65 changes: 65 additions & 0 deletions SaaS/Cloud Onboarding/AWS Organizations/Generate CF Link.bru
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Loading

0 comments on commit 1dd6b5b

Please sign in to comment.