security1 Min Read

Cyberark Rest API Certificate based Authentication - Curl Command to Fetch Credentials

Gorav Singal

January 30, 2022

TL;DR

Use curl with --cert and --key flags to call CyberArk's AIMWebService REST API for certificate-based credential retrieval, passing AppID, Safe, and Object parameters.

Cyberark Rest API Certificate based Authentication - Curl Command to Fetch Credentials

Introduction

Cyberark kind of tools are a must for security in your infrastructure and app deployments. Cyberark helps storing credentials in their system, and provide some parameters like safe/app/obj, and some form of authentication so that caller can fetch the credentials. It eliminates the need to put credentials in files or in envirnoment.

When I started using Cyberark, they provided some AIM agent, which gets installed in the host, and they whitelisted the IPs of the machines.

Now, they have also introduced the REST APIs to fetch the credentials, and they have certificate based authentication. The setup I use, takes serial number of the certificate and IPs of the machines from where I want to fetch the credentials.

Curl Command to fetch the Credentials from Cyberark

curl -v --cert '<path to certificate.cer file' --key 'path to private key file' --url 'https://YOUR_HOST/AIMWebService/api/Accounts?AppID=<AppID>&Safe=<Safe_Name>&object=<Cyberark-Object-Name>'

Thanks for reading.

Share

Related Posts

SQL Injection: The Complete Guide to Understanding, Preventing, and Detecting SQLi Attacks

SQL Injection: The Complete Guide to Understanding, Preventing, and Detecting SQLi Attacks

SQL injection has been on the OWASP Top 10 since the list was created in 200…

Software Security in the AI Era: How to Write Secure Code When AI Writes Code Too

Software Security in the AI Era: How to Write Secure Code When AI Writes Code Too

In 2025, 72% of professional developers used AI-assisted coding tools daily. By…

Building a Vulnerability Detection System That Developers Actually Use

Building a Vulnerability Detection System That Developers Actually Use

Here’s a stat that should concern every security team: 73% of developers say…

Understanding Zero-day Exploit of Log4j Security Vulnerability and Solution (CVE-2021-44228, CVE-2021-45046)

Understanding Zero-day Exploit of Log4j Security Vulnerability and Solution (CVE-2021-44228, CVE-2021-45046)

Introduction On 9th December 2021, an industry-wide vulnerability was discovered…

Dockerfile for building Python 3.9.2 and Openssl for FIPS

Dockerfile for building Python 3.9.2 and Openssl for FIPS

Introduction In previous posts, we saw how to build FIPS enabled Openssl, and…

How to Patch and Build Python 3.9.x for FIPS enabled Openssl

How to Patch and Build Python 3.9.x for FIPS enabled Openssl

Introduction In this post, we will see Python 3.9.x patch for FIPS enabled…

Latest Posts

AI Video Generation in 2025 — Models, Costs, and How to Build a Cost-Effective Pipeline

AI Video Generation in 2025 — Models, Costs, and How to Build a Cost-Effective Pipeline

AI video generation went from “cool demo” to “usable in production” in 2024-202…

AI Models in 2025 — Cost, Capabilities, and Which One to Use

AI Models in 2025 — Cost, Capabilities, and Which One to Use

Choosing the right AI model is one of the most impactful decisions you’ll make…

AI Image Generation in 2025 — Models, Costs, and How to Optimize Spend

AI Image Generation in 2025 — Models, Costs, and How to Optimize Spend

Generating one image with AI costs between $0.002 and $0.12. That might sound…

AI Coding Assistants in 2025 — Every Tool Compared, and Which One to Actually Use

AI Coding Assistants in 2025 — Every Tool Compared, and Which One to Actually Use

Two years ago, AI coding meant one thing: GitHub Copilot autocompleting your…

AI Agents Demystified — It's Just Automation With a Better Brain

AI Agents Demystified — It's Just Automation With a Better Brain

Let’s cut through the noise. If you read Twitter or LinkedIn, you’d think “AI…

Supply Chain Security — Protecting Your Software Pipeline

Supply Chain Security — Protecting Your Software Pipeline

In 2024, a single malicious contributor nearly compromised every Linux system on…