Trying to integrate CyberArk Identity with Cribl using RESTAPI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Trying to integrate CyberArk Identity with Cribl using RESTAPI

L2 Linker

Error as follows:

error.message == "Http Error, statusCode: 400, details: {"host":">tenant<.my.idaptive.app","port":"","path":"/oauth2/token","method":"post","statusCode":400,"response":"{\"error\":\"invalid_request\",\"error_description\":\"bad url\"}","contentType":"application/json; charset=utf-8","elapsed":122,"startTime":1759228101254}"

 

Documentation here Use the client credentials flow | CyberArk Docs seems to suggest I need to add Application ID, is this correct?

 

21 REPLIES 21

L7 Applicator

Hi @Ian Broughton​ 

 

The error suggest that it’s missing the mandatory /{app_id} at the end of the /oauth2/token path.

 

tenant.my.idaptive.app/oauth2/introspect/appID

 

OR

 

tenant.id.cyberark.cloud/oauth2/introspect/appID

)

 

https://docs.cyberark.com/identity/latest/en/content/coreservices/authenticate/oauth2-client.htm

 

Hope it helps !

L2 Linker

'https://$(audit_integration_endpoint)/api/audits/stream/$(some path)'

 

What is "some path"?

 

L2 Linker

Thanks for your help by the way.

L4 Transporter

Hello @Ian Broughton​ 

 

Please refer to below article which might help you!

 

Cribl OIDC single sign-on (SSO) integration | CyberArk Docs

L4 Transporter

Hello @Ian Broughton​ 

 

Please refer to below article which might help you!

 

Cribl OIDC single sign-on (SSO) integration | CyberArk Docs

Hi @Ian Broughton​ 

 

It’s just a placeholder in the documentation.It represents specific API resource path you want to call.

 

Hope it helps !

Hi Ruhi, this is an API integration, nothing to do with SSO I'm afraid.

Hi Malhar,

 

Yeah, we've tried it with specific path and it does not work. It doesn't help that CyberArk's documentation is pretty awful and all over the place. See:

Identity Audit - How To configure CyberArk Identity SIEM Integration with Microsoft Sentinel

SIEM integration API | CyberArk Docs

Custom OAuth2 Client | CyberArk Docs

Integrate Audit with third-party SIEM applications | CyberArk Docs

 

Be nice if there was one article with clear steps on how to get this to work, rather than a myriad number of conflicting docs.

 

I can see an OAuth request and the relevant access token but I'm completely perplexed as to what is missing.

Hi @Ian Broughton​ 

 

Have you tried this ?

 

grant_type=client_credentials&client_id=<clientid>&client_secret=<secret>

 

 

https://tenant.my.idaptive.app/oauth2/token 

 

Yes, added `grant_type=client_credentials&client_id=<clientid>&client_secret=<secret>&scope=isp.audit.events:read` in the Collect POST body

 

Collect URL is 'https://<tenant>.my.idaptive.app/oauth2/token/<clientid>'

 

Collect headers are:

 

Accept - ''application/json'

Content-Type - 'application/x-www-form-urlencoded'

Hi @Ian Broughton​ 

 

Just out of curiosity have you tried this https://<tenant>.my.idaptive.app/oauth2/token

 

I think OAuth token endpoint is not accepting the client ID in the path.

 

 

I've got this working now with some considerable trial and error. It's a truly horrible API though, and the documentation is awful.

Hi @Ian Broughton​ 

 

Would you be able to share how you were able to fix this issue?

 

I am curious to know for future reference.

 

L2 Linker

{

 "type": "collection",

 "ttl": "4h",

 "ignoreGroupJobsLimit": false,

 "removeFields": [],

 "resumeOnBoot": false,

 "schedule": {

  "cronSchedule": "*/5 * * * *",

  "maxConcurrentRuns": 1,

  "skippable": true,

  "run": {

   "rescheduleDroppedTasks": true,

   "maxTaskReschedule": 1,

   "logLevel": "info",

   "jobTimeout": "60m",

   "mode": "run",

   "timeRangeType": "relative",

   "timeWarning": {},

   "expression": "true",

   "minTaskSize": "1MB",

   "maxTaskSize": "10MB",

   "stateTracking": {

    "stateUpdateExpression": "__timestampExtracted !== false && {latestTime: (state.latestTime || 0) > _time ? state.latestTime : _time}",

    "stateMergeExpression": "(prevState.latestTime || 0) > newState.latestTime ? prevState : newState",

    "enabled": false

   },

   "earliest": "-5m",

   "latest": "now"

  },

  "enabled": true

 },

 "streamtags": [],

 "workerAffinity": false,

 "collector": {

  "conf": {

   "discovery": {

    "discoverType": "http",

    "discoverMethod": "post_with_body",

    "pagination": {

     "type": "response_body",

     "maxPages": 100,

     "attribute": [

      "cursorRef"

     ],

     "lastPageExpr": "!__e || !__e.cursorRef"

    },

    "enableStrictDiscoverParsing": false,

    "enableDiscoverCode": false,

    "discoverUrl": "'https://<tenant>/api/audits/stream/createQuery'",

    "discoverBody": "`{\"query\": {\"pageSize\": 500,\"selectedFields\": [\"tenant_id\",\"custom_data\",\"arrival_timestamp\",\"checksum\",\"application_code\",\"audit_code\",\"timestamp\",\"user_id\",\"session_id\",\"source\",\"action_type\",\"audit_type\",\"component\",\"target\",\"command\",\"message\",\"username\",\"action\",\"uuid\",\"service_name\",\"cloud_roles\",\"cloud_workspaces\",\"cloud_workspaces_and_roles\",\"cloud_assets\",\"cloud_identities\",\"vaulted_accounts\",\"cloud_provider\",\"account_name\",\"target_platform\",\"safe\",\"target_account\",\"identity_type\",\"access_method\",\"account_id\",\"correlation_id\"],\"filterModel\": {\"date\": {\"dateFrom\": \"${C.Time.strftime(state.latestTime || earliest || 0, '%Y-%m-%d %H:%M:%S')}\",\"dateTo\": \"${C.Time.strftime(latest || 0, '%Y-%m-%d %H:%M:%S')}\"}},\"sortModel\": [{\"field_name\": \"string\",\"direction\": \"asc\"}]}}`",

    "discoverRequestHeaders": [

     {

      "name": "x-api-key",

      "value": "'REDACTED'"

     }

    ]

   },

   "collectMethod": "post_with_body",

   "pagination": {

    "type": "response_body",

    "maxPages": 100,

    "attribute": [

     "cursorRef"

    ],

    "lastPageExpr": "!_e || !_e.cursorRef || _e.cursorRef === ''"

   },

   "authentication": "oauth",

   "timeout": 0,

   "useRoundRobinDns": false,

   "disableTimeFilter": false,

   "decodeUrl": false,

   "rejectUnauthorized": true,

   "captureHeaders": true,

   "safeHeaders": [],

   "retryRules": {

    "type": "backoff",

    "interval": 1000,

    "limit": 5,

    "multiplier": 2,

    "maxIntervalMs": 20000,

    "codes": [

     429,

     503

    ],

    "enableHeader": true,

    "retryConnectTimeout": false,

    "retryConnectReset": false,

    "retryHeaderName": "retry-after"

   },

   "__scheduling": {

    "stateTracking": {}

   },

   "loginUrl":"loginUrl": "'https://<tenant>my.idaptive.app/oauth2/token/<value>'",

   "authHeaderKey": "Authorization",

   "authHeaderExpr": "`Bearer ${token}`",

   "clientSecretParamName": "grant_type",

   "loginBody": "`grant_type=client_credentials&client_id=username@cybarlocal&client_secret=REDACTED&scope=isp.audit.events:read`",

   "clientSecretParamValue": "client_credentials",

   "collectUrl":"`https://<tenant>/api/audits/stream/results`",

   "authRequestHeaders": [

    {

     "name": "Authorization",

     "value": "\"Basic \" + C.Encode.base64(\"username@cybarlocal:REDACTED")"

    }

   ],

   "authRequestParams": [

    {

     "name": "scope",

     "value": "'isp.audit.events:read'"

    }

   ],

   "tokenRespAttribute": "access_token",

   "collectRequestParams": [],

   "collectRequestHeaders": [

    {

     "name": "x-api-key",

     "value": "'REDACTED'"

    }

   ],

   "username": "REDACTED",

   "password": "REDACTED",

   "collectBody": "`{\\\"cursorRef\\\": \\\"${cursorRef}\\\"}`"

  },

  "destructive": false,

  "encoding": "utf8",

  "type": "rest"

 },

 "input": {

  "type": "collection",

  "staleChannelFlushMs": 10000,

  "sendToRoutes": true,

  "preprocess": {

   "disabled": true

  },

  "throttleRatePerSec": "0",

  "metadata": [

   {

    "name": "__datasource",

    "value": "'cyberarkidentity'"

   }

  ],

  "breakerRulesets": [

   "CyberArk"

  ]

 },

 "description": "CyberArk Identity REST API",

 "savedState": {},

 "id": "CyberArk_Identity"

}

  • 532 Views
  • 21 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!