Skip to content

Instantly share code, notes, and snippets.

View infamousjoeg's full-sized avatar
🙊
I'm really good at keeping secrets.

Joe Garcia infamousjoeg

🙊
I'm really good at keeping secrets.
View GitHub Profile
@infamousjoeg
infamousjoeg / Get-CPDetails.ps1
Created April 24, 2023 18:50
Get Credential Provider Details from System Health via PVWA REST API
# Get User Input
$pvwaURL = $(Read-Host "PVWA Base URL (eg. https://pvwa.example.com)").TrimEnd("/")
do {
$authType = Read-Host "Authentication Type [cyberark], ldap, radius"
if ($authType -eq "") { $authType = "cyberark" }
else { $authType = $authType.ToLower() }
} until ($authType -eq "cyberark" -or $authType -eq "ldap" -or $authType -eq "radius")
$credentials = Get-Credential
# Logon to PVWA REST API
@infamousjoeg
infamousjoeg / 1-install_module.sh
Created March 28, 2023 14:45
Retrieve password from Central Credential Provider in Puppet Manifest and store in Hiera
puppet module install dwerder-hiera_set
@infamousjoeg
infamousjoeg / CacheMFAforSSHviaPSMP.ps1
Created January 24, 2023 16:34
Cache MFA for SSH Connections via PSM for SSH Proxy
############
# This PowerShell script was translated using OpenAI's code-davinci-002 model
# against the original Python source code. https://beta.openai.com/playground?model=code-davinci-002
#
# https://github.com/vinceblake/cyberark-mfa-no-gui-example/blob/master/SAML-Get-MFA-Caching-Key.py
############
# SET THESE VARIABLES
$ispss_subdomain = "example"
$username = "user@example.com"
@infamousjoeg
infamousjoeg / BradleyMastersCallOfDuty.md
Created March 18, 2023 03:04
"Bradley masters Call of Duty" by ChatGPT (GPT-4 Model)

Bradley Masters Call of Duty

By: ChatGPT
Using the GPT-4 Model
2023-03-17

In the land of Gamerton, where controllers do play, Lived a young lad named Bradley, who practiced all day. He wanted to be the best at the game, The kind of player who'd rise up in fame.

@infamousjoeg
infamousjoeg / exportSafeMembers.ps1
Created February 28, 2023 15:57
Export Safe Members for all Safes in CyberArk PAM using psPAS PowerShell Module
# Before running this script, make sure psPAS is installed by running:
# Install-Module psPAS
Import-Module psPAS
$BaseURI = Read-Host "Enter the Base URL (e.g. https://pvwa.example.com)"
$Type = Read-Host "Enter the Authentication Type [cyberark], ldap, radius"
if (!$Type) {
$Type = "cyberark"
}
@infamousjoeg
infamousjoeg / create_testusers.ps1
Last active January 31, 2023 19:21
Create & Delete 100 Test User Accounts in a Test Safe for CyberArk PAM
# Import PowerShell module psPAS, if it doesn't exist, install it
Import-Module psPAS -ErrorAction SilentlyContinue
if ($LASTEXITCODE -ne 0) {
Install-Module psPAS -Force
Import-Module psPAS
}
$baseURL = Read-Host "Enter the base URL of your CyberArk instance"
$authType = Read-Host "Enter the authentication type (CyberArk, LDAP)"
$credential = Get-Credential
@infamousjoeg
infamousjoeg / samlAuthn.ps1
Last active November 15, 2022 15:13
An example of how to authenticate CyberArk PAS REST API using SAML **CUSTOMER CONTRIBUTED & UNTESTED**
try {
$webresp = Invoke-WebRequest "https://pvwa.example.com/PasswordVault/auth/saml/" -MaximumRedirection 0 -ErrorAction SilentlyContinue -UseBasicParsing
} catch {
$_.Exception.Response.StatusCode.Value__
}
try {
$samlresp = Invoke-WebRequest -Uri ($webresp.links.href) -MaximumRedirection 1 -UseDefaultCredentials -UseBasicParsing
} catch {
$_.Exception.Response.StatusCode.Value__
}
@infamousjoeg
infamousjoeg / jenkins-freestyle.sh
Created November 9, 2022 20:10
How to use Conjur Secrets provided SSH Private Key to clone Git repository in Jenkins
set +x
echo "$CONJUR_SECRET" > "$WORKSPACE"/private.key
set -x
chmod 0600 "$WORKSPACE"/private.key
sed -i 's/\r$//g' "$WORKSPACE"/private.key
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $WORKSPACE/private.key -F /dev/null"
git clone git@github.com:infamousjoeg/epa-poc.git
@infamousjoeg
infamousjoeg / DeployRDSSecret.yml
Created October 12, 2022 00:15
An AWS CloudFormation template that uses AWS Secrets Manager to provide the admin password for a provisioned RDS database
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an empty SQL Server RDS database as an example for automated deployments.
Parameters:
SqlServerInstanceName:
NoEcho: 'false'
Description: RDS SQL Server Instance Name
Type: String
Default: SqlRdsDB
MinLength: '1'
MaxLength: '63'
@infamousjoeg
infamousjoeg / docker-compose.yml
Created July 6, 2018 22:03
Bluedream Cinema Docker Compose
version: '2.1'
services:
plex:
container_name: plex
image: plexinc/pms-docker:plexpass
restart: unless-stopped
network_mode: host
environment:
- TZ=America/New_York