This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests_negotiate import HTTPNegotiateAuth | |
import urllib3 | |
import urllib.parse | |
import os | |
import re | |
import subprocess | |
urllib3.disable_warnings() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set your personal access token here | |
personalAccessToken="<personal-access-token>" | |
# Get the list of project IDs for owned projects with last activity before 2020-01-01 | |
project_ids=$(curl --header "PRIVATE-TOKEN: $personalAccessToken" "https://gitlab.com/api/v4/projects?simple=true&per_page=100&owned=true&last_activity_before=2020-01-01T00:00:00Z" | jq -r '.[] | select(.last_activity_at < "2020-01-01T00:00:00Z") | .id') | |
# Loop through each project ID and delete the project | |
for project_id in $project_ids; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if the psPAS module is already installed | |
if (-not (Get-Module -ListAvailable -Name psPAS)) { | |
# If not, install the module | |
Install-Module -Name psPAS -Repository PSGallery -Force -Scope CurrentUser | |
# Check if the module was successfully installed before importing | |
if (-not (Get-Module -ListAvailable -Name psPAS)) { | |
Write-Output "ERROR: Failed to install the psPAS module. Please install manually from https://pspas.pspete.dev/docs/install." | |
return | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Global Variables | |
$baseUrl = "https://cyberark.joegarcia.dev" # CHANGE ME | |
$authType = "ldap" # CHANGE ME | |
$portToSearchFor = 3306 # CHANGE ME | |
$newPortValue = 3307 # CHANGE ME | |
# Logon Variables | |
$credentials = Get-Credential | |
$logonRequestUri = "${baseUrl}/PasswordVault/api/auth/${authType}/logon" | |
$logoffRequestUri = "${baseUrl}/PasswordVault/api/auth/logoff" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set request variables | |
$baseURL = "https://cyberark.joegarcia.dev" | |
$appID = "Ansible" | |
$safe = "D-Win-SvcAccts" | |
$object = "Operating System-WinDomain-joegarcia.dev-Svc_SSIS" | |
# Define the certificate thumbprint | |
$thumbprint = "INSERT_CERTIFICATE_THUMBPRINT_HERE" | |
# Retrieve the certificate from Current User's Personal certificate store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Please note that this script uses a C# helper class for HMAC-SHA256 calculations. | |
# This is because PowerShell does not natively support this kind of operations. | |
# Also, this script assumes that you are calling Get-SignedHeaders with the proper | |
# parameters to generate your signed headers. | |
# Create a C# class for HMACSHA256 Helper which is used to compute HMACSHA256 hash | |
Add-Type -TypeDefinition @" | |
using System; | |
using System.Text; | |
using System.Security.Cryptography; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN CERTIFICATE----- | |
MIIGaTCCBVGgAwIBAgIMLE46kHnIkjumcKGzMA0GCSqGSIb3DQEBCwUAMFAxCzAJ | |
BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSYwJAYDVQQDEx1H | |
bG9iYWxTaWduIFJTQSBPViBTU0wgQ0EgMjAxODAeFw0yMzAzMDcxODIxMDNaFw0y | |
NDA0MDcxODIxMDJaMHQxCzAJBgNVBAYTAklMMRAwDgYDVQQIEwdDZW50cmFsMRQw | |
EgYDVQQHEwtQZXRhaCBUaWt2YTEfMB0GA1UEChMWQ1lCRVJBUksgU09GVFdBUkUg | |
TFRELjEcMBoGA1UEAwwTKi5pZC5jeWJlcmFyay5jbG91ZDCCASIwDQYJKoZIhvcN | |
AQEBBQADggEPADCCAQoCggEBALMsbfmGh5jHr2BvzR5fWvbbdhRgLo8hyHcyjkhy | |
OeFAGEL/r8dIyUyKl0iqbdC4/aSxytjdUqn4pGTb5wpMUfS2qdRy+531OPLi7Ls4 | |
hKELheugWNCY99IDGxdwxTAm/EtnK3PX6KEzCQukGQVg/r4H41pY0YSbepAwcZRj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load into root branch | |
- !grant | |
role: !group SyncVault/LOB_POC/SafeName/delegation/consumers | |
member: !host data/cd/kubernetes/dev-team-1/applications/k8s-secrets-app1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puppet module install dwerder-hiera_set |