Wazuh SIEM integration with CyberArk ISPSS Audit issue : the client credentials token call returns 400 access_denied "invalid client creds or client not allowed"

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

Wazuh SIEM integration with CyberArk ISPSS Audit issue : the client credentials token call returns 400 access_denied "invalid client creds or client not allowed"

L0 Member

I was trying to integrate Wazuh SIEM with ISPSS Audit to be able to monitor system activities and receive other logs. I followed the official guide step by step. But now, when i generate the access token via the client-credentials flow, it fails every time with error 400 access_denied "invalid client creds or client not allowed"

 

I already ruled out the obvious causes: the web app ID is correct (a wrong ID returns "unknown app"), the app is configured per the guide (jwtRS256, Client Creds enabled, isp.audit.events:read scope, the service user exists and is linked to the OAuth2 server web app).

 

I used this python script for reference :

import base64 import json import os import sys import requests   CLIENT_ID = os.getenv("CYBERARK_CLIENT_ID", "") CLIENT_SECRET = os.getenv("CYBERARK_CLIENT_SECRET", "") IDENTITY_HOST = os.getenv("CYBERARK_IDENTITY_HOST", "") # no https:// WEBAPP_ID = os.getenv("CYBERARK_WEBAPP_ID", "") API_HOST = os.getenv("CYBERARK_API_HOST", "") # no https:// API_KEY = os.getenv("CYBERARK_API_KEY", "")   SCOPE = "isp.audit.events:read"     def get_token(): url = f"https://{IDENTITY_HOST}/oauth2/token/{WEBAPP_ID}" print(f"POST {url}") print(f" client_id : {CLIENT_ID}") print(f" scope : {SCOPE}")   # CyberArk Identity confidential clients authenticate with HTTP Basic. basic = base64.b64encode(f"{CLIENT_ID}:{CLIENT_SECRET}".encode()).decode() resp = requests.post( url, headers={ "Content-Type": "application/x-www-form-urlencoded", "Authorization": f"Basic {basic}", }, data={"grant_type": "client_credentials", "scope": SCOPE}, timeout=30, ) print(f" -> HTTP {resp.status_code}")   if resp.status_code != 200: print(f" body: {resp.text[:500]}") return None   token = resp.json().get("access_token") print(" access_token acquired.")   # Decode the (unverified) JWT payload to check aud/scope/tenant claims. try: payload = token.split(".")[1] payload += "=" * (-len(payload) % 4) claims = json.loads(base64.urlsafe_b64decode(payload)) print(f" aud : {claims.get('aud')} (expect cyberark.isp.audit)") print(f" scope : {claims.get('scope')}") print(f" tenant_id : {claims.get('tenant_id')}") except Exception: pass return token     def test_create_query(token): if not API_KEY: print("\n(Skipping createQuery: no API key set.)") return url = f"https://{API_HOST}/api/audits/stream/createQuery" print(f"\nPOST {url}") payload = { "query": { "pageSize": 1, "selectedFields": ["uuid", "timestamp", "action"], "filterModel": { "date": { "dateFrom": "2025-01-01 00:00:00", "dateTo": "2025-01-02 00:00:00", } }, } } resp = requests.post( url, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {token}", "x-api-key": API_KEY, }, json=payload, timeout=30, ) print(f" -> HTTP {resp.status_code}") if resp.status_code == 200: print(f" cursorRef received: {'cursorRef' in resp.json()}") print(" SUCCESS: token + API key both work.") else: print(f" body: {resp.text[:500]}") if resp.status_code in (401, 403): print(" Token was issued but the Audit API rejected it -> check the " "Advanced-tab claim script (aud must be cyberark.isp.audit).")     def main(): if not CLIENT_SECRET: sys.exit("Set CLIENT_SECRET (or the CYBERARK_CLIENT_SECRET env var) first.") token = get_token() if token: test_create_query(token)     if __name__ == "__main__": main()

 

 

2 REPLIES 2

L1 Bithead

At initial glance this script looks pretty solid. My recommendation would be to reach out to support to create a case for this one. There's some logs we can take a look at that will help identifying why the specific token request failed.

 

When you open the case they may ask for response headers, or testing outside the script in Postman or similar utility. Typically custom scripting is handled by our Professional Services team, but we can troubleshoot the specific calls being made to make sure there's no issues with the endpoints on your tenant.

L0 Member

It turns out the exact same credentials (all 6 params identical) are already in use by a QRadar SIEM integration, and QRadar authenticates and receives audits logs fine. So the service user, the OAuth confidential-client flag, permissions and secret are all definitely valid.

That makes me think the 400 "invalid client creds or client not allowed" on my side is because I'm the second consumer using the same client credentials. The OAuth app has RevokeActiveTokensOnReuseDetection = true, so two SIEMs using the same client_id/secret from different IPs probably looks like token reuse/theft to CyberArk, and my requests get denied while QRadar keeps working.

I have two questions:

  1. Is that the right read? For two SIEMs (QRadar + Wazuh) pulling audit events, is the expected setup a separate OAuth service user + separate SIEM integration for each, rather than sharing one? I assume sharing one set of credentials across two consumers isn't supported here.
  2. If I create a second dedicated service user for the Wazuh integration, does that consume an additional PAM / Privilege Cloud license, or does an OAuth service user for a SIEM integration fall outside the licensed-user count?

Thanks !

  • 85 Views
  • 2 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!