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 / ccp.py
Created December 6, 2021 14:20
Python CCP REST Call Example - No 3rd Party Modules - Thanks @JimmyJamCABD
""""Example classes to use CCP in python"""
import ssl
import http
class CertificateHandler:
"""This class handles the certificates for you.
In python its pretty easy but here it is"""
def __init__(self,cafile=None):
self.root = None
@infamousjoeg
infamousjoeg / k8s-deploy-follower.yaml
Last active January 28, 2022 15:37
Kubernetes Manifest for Conjur Follower
---
apiVersion: v1
kind: Namespace
metadata:
name: conjur
---
apiVersion: v1
kind: ServiceAccount
metadata:
@infamousjoeg
infamousjoeg / flan.md
Created September 25, 2021 16:41
Flan Recipe

Ingredients

  • 2 cans evaporated milk
  • 1 can sweetened condensed milk
  • 6 eggs
  • 2 cap fulls pure vanilla extract
  • 1 cup sugar
  • water

Steps

@infamousjoeg
infamousjoeg / package-vagrant-box.sh
Last active January 28, 2022 17:31 — forked from srijanshetty/package-vagrant-box.md
Clean up a vagrant box before packaging
#!/bin/bash
# We’re now going to clean up disk space on the VM so when we package it into a new Vagrant box, it’s as clean as possible. First, remove APT cache
sudo apt-get clean
# Then, “zero out” the drive (this is for Ubuntu):
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
# Lastly, let’s clear the Bash History and exit the VM:
@infamousjoeg
infamousjoeg / Conjur_Session_Init.yml
Created June 23, 2021 16:26
Conjur Session Init for RunDeck using API Key in Key Storage (use CCP for greater security)
- defaultTab: nodes
description: Initializes an authenticated REST API session with CyberArk Conjur
Secrets Manager.
executionEnabled: true
id: 0a038f82-ead3-4afe-bb1c-4138d456056c
loglevel: INFO
name: Conjur Session Init
nodeFilterEditable: false
options:
- description: The URL to the Conjur service. (https://conjur.example.com)
@infamousjoeg
infamousjoeg / samlAuthn.ps1
Last active December 3, 2020 18:53
SAML Authentication to CyberArk PAS REST API using IDaptive as SAML Idp
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = "{`"type`": `"saml`",`"secureMode`": true}"
$webresp = Invoke-RestMethod "https://cyberark.joegarcia.dev/PasswordVault/api/auth/saml/logon" -Method POST -Headers $headers -Body $body
Write-Output "====== `$webresp Value ======"
Write-Output $webresp
$samlresp = Invoke-WebRequest $webresp -MaximumRedirection 4
@infamousjoeg
infamousjoeg / aws.java
Last active October 15, 2020 13:47
Full Java source code for examples given in AWS IAM Authenticator Tutorial for Conjur Open Source (https://www.conjur.org/blog/aws-iam-authenticator-tutorial-for-conjur-open-source/)
package authn-iam_test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import org.json.JSONObject;
import com.cyberark.conjur.api.Conjur;
public class authn-iam_test {
@infamousjoeg
infamousjoeg / conjurAPISchema.json
Created September 17, 2020 23:35
Conjur/DAP API Schema for API Gateway Import
{
"info": {
"_postman_id": "676230f3-7895-4a35-a20f-57bd846e1a92",
"name": "CyberArk REST API [PUBLIC]",
"description": "All available requests in CyberArk Privileged Account Security Web Services for All Versions\n\n**Last Updated Version:** v11.6\n\n# THIS IS UNOFFICIAL DOCUMENTATION\n\n## New Features & Additions\n\n* Initial documentation of CyberArk's IDaptive Identity Platform API is available within the \"IDaptive Identity Platform\" folder.\n\nHappy automating!\n\n## Getting Started Guide\n\n[Getting Started with REST Using Postman](https://github.com/infamousjoeg/CyberArk-RESTAPI/blob/master/Getting%20Started%20with%20REST%20Using%20Postman.pdf) (PDF)\n\n## Community Tools\n\n* [psPAS](https://github.com/pspete/psPAS) - PowerShell Module for CyberArk's REST API\n* [CredentialRetriever](https://github.com/pspete/CredentialRetriever) - PowerShell Module for CyberArk's Application Access Manager (AAM)\n* [pyAIM](https://github.com/infamousjoeg/pyAIM) - Python Client Library for CyberArk's Applica
@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 / enableTLS.ps1
Created April 14, 2020 20:32
Force PowerShell to permanently use TLS and not SSL by "Enabling Strong Cryptography"
# Open PowerShell as Administrator and check the current enabled protocols
[Net.ServicePointManager]::SecurityProtocol
# When I ran this, my output was:
# sslv2, tls
# Set strong cryptography on 64 bit .Net Framework (version 4 and above)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
# Set strong cryptography on 32 bit .Net Framework (version 4 and above)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord