The goal I set out for this repo is to leverage CyberArk's vaulting capability to store credentials, and retrieve them with Ansible. Utilizing the two products together, I can automate with a better security posture. With CyberArk, I have the ability to audit and security manage priveleged credentials throughout my organization. CyberArk also has capabilities that allows you to extend the vault usage to applications such as Ansible.
NOTE: At the time of this initial discussion, there are some setup tasks that assume you are a WWT employee/contractor.
- Log into the WWT platform, and launch the CyberArk Privileged Account Management Lab.
- Jump into the lab provided to you.
- RDP from the jumphost over to
components.iam.com
usingAdministrator
and the standard WWT password. - Download the required CyberArk packages from
\\10.255.16.16\atcdata\cyberark\Central Credential Provider-Rls-v10.10.3.zip
- Extract the ZIP somewhere, and open that in Windows Explorer.
- Install the Central Credential Provider for Windows
- From your extracted file, launch the setup for CCP for Windows
.\Central Credential Provider-Rls-v10.10.3\Central Credential Provider\Central Credential Provider For Windows\setup.exe
- As you run through the installation wizard, leave the defaults except:
- Vault's Connection Details:
- Address: 192.168.2.102
- Port: 1858
- Vault's Username and Password details:
- Username: Administrator
- Password: The WWT Standard
- Vault's Connection Details:
- From your extracted file, launch the setup for CCP for Windows
- Install .NET Framework 3.5 from Server Manager
- Install Central Credential Provider Web Service
- From your extracted file, launch the setup for CCP Web Service
.\Central Credential Provider-Rls-v10.10.3\Central Credential Provider\Central Credential Provider Web Service\setup.exe
- Keep all the defaults
- From your extracted file, launch the setup for CCP Web Service
- From the
jumpbox
, open Chrome and go to https://components.iam.com/PasswordVault/. Log in ascharles.xavier
. - Setup Permissions
- Navigate to
Applications
, and add two applications.- AIMWebService, and allow it based on the user
IIS APPPOOL\DefaultAppPool
and path ofC:\inetpub\wwwroot\AIMWebService\bin\AIMWebService.dll
- This will allow the AIMWebService we setup to talk with the Password Vault
- Ansible, and allow it based on host address of
linuxserver.iam.com
- This will be the Application we use in Ansible to be able to authenticate and grab credentials
- AIMWebService, and allow it based on the user
- Naviage to
Policies
->Access Control (Safes)
- Click on
Linux
, and over on the right chooseMembers
to update the members. - Add Three new members:
- Prov_COMPONENTS
- AIMWebService
- Ansible
- NOTE: When you add these new members to the Safe, you should include
Use Accounts
,Retrieve Accounts
, andList Accounts
- Navigate to
- Setup the Linux host:
-
ssh as
root
tolinuxserver
utilizing the standard WWT password. -
Run the following to install some of the pre-req's for our automation:
yum install -y epel-release yum install -y ansible git python2-pip pip install requests ansible-galaxy collection install cyberark.pas
-
We should no longer need root, so let's jump out of it, and move to our normal user. Saved in the putty configuration is our pre-setup session to authenticate as
demo_linux_01
-
Let's Clone this repo down.
git clone https://github.com/coreywan/ansible-cyberark-testing.git cd ansible-cyberark-testing
-
Execute the Ansible Playbook
ansible-playbook ./pb_cyberark_query.yml
-
- Install Ansible Tower
- Patch the Server and Download Tower install files
yum update -y curl https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz --output ansible-tower-setup-latest.tar.gz tar xvzf ansible-tower-setup-latest.tar.gz reboot now
- Update the Inventory file to needs:
cd ansible-towder-setup-* vim inventory #Once Saved executed the setup script ./setup.sh
- Patch the Server and Download Tower install files
- Setup Tower for need
- Project
- Name: Cyberark testing
- SCM URL: https://github.com/coreywan/ansible-cyberark-testing.git
- Inventory:
- Name: Main
- Source from Project:
- Cyberark Testing
- ./inventory
- Credentials:
- Cyberark
- Kind: CyberArk AIM Central Credential Provider Lookup
- CyberArk AIM URL: https://components.iam.com
- Application ID: Ansible
- Linux Root
- Kind: Machine
- Username: Root
- Password:
- Lookup: Cyberark
- Object Query: Safe=Linux;UserName=root
- Reason: automation
- Cyberark
- Job Template:
- Name: Ping Test
- Job Type: Run
- Inventory: Main
- Project Cyberark testing
- Playbook: pb_cyberark_query_tower.yml
- Credentials: Linux Root
- Project
- Execute Ansible Tower Job