Skip to content

Instantly share code, notes, and snippets.

View Dapacruz's full-sized avatar

David Cruz Dapacruz

View GitHub Profile
@Dapacruz
Dapacruz / validate-security-policies.py
Created July 25, 2022 22:34
Validates recently created/modified Palo Alto Networks security policies
#!/usr/bin/env python3
'''Validates recently created/modified security policies
validate-security-policies.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.9
Required Python packages:
None
Features:
Checks for duplicate address objects
@Dapacruz
Dapacruz / citrix_ctrl_alt_win.json
Last active March 10, 2021 01:00 — forked from jdleslie/citrix_ctrl_alt_win.json
Map Apple modifiers (Ctrl, Option, Command) to Windows modifiers (Ctrl, Win, Alt) in Citrix Workspace using Karabiner Elements, with working Alt+Tab and Windows key shortcuts
{
"title": "Citrix Receiver/Workspace modifiers for Ctrl, Alt, Windows order",
"rules": [
{
"description": "In Citrix, add fn modifier to tab so it is forwarded",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": { "optional": [ "any" ] }
@Dapacruz
Dapacruz / generate-ip-addresses.py
Created February 8, 2021 18:02
Generate a list of IP addresses
#!/usr/bin/env python3
'''Generate a list of IP addresses
generate-ip-addresses.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@Dapacruz
Dapacruz / panorama-dynamic-inventory.py
Created August 7, 2020 01:20
Panorama Dynamic Inventory for Ansible Tower
#!/usr/bin/env python2.7
import argparse
import json
import os
import sys
import urllib
import urllib2
import xml.etree.ElementTree as ET
@Dapacruz
Dapacruz / panw-remove-tags.py
Last active January 27, 2021 16:25
Removes tags from Panorama
#!/usr/bin/env python3
'''Removes tags from Panorama
panw-remove-tags.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@Dapacruz
Dapacruz / get-wan-circuit-info.py
Created July 20, 2020 18:30
Exports WAN circuit details to an Excel spreadsheet and sends to recipients via email
#!/usr/bin/env python3
'''Parse WAN circuit details from router configurations
get-wan-circuit-info.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@Dapacruz
Dapacruz / pan-group-sort.py
Created July 9, 2020 16:24
Sorts PAN-OS address/service group object members in XML formatted configurations
#!/usr/bin/env python3
'''PAN-OS Group Object Sorter
pan-group-sort.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@Dapacruz
Dapacruz / .env
Last active April 6, 2020 03:58
Docker TIG Stack
TELEGRAF_HOST=telegraf
INFLUXDB_HOST=influxdb
INFLUXDB_PORT=8086
INFLUXDB_DATABASE=metrics
INFLUXDB_ADMIN_USER=grafana
INFLUXDB_ADMIN_PASSWORD=password
GRAFANA_PORT=3000
GRAFANA_USER=admin
@Dapacruz
Dapacruz / Build-GoSource.ps1
Last active August 19, 2021 16:47
Compile Go Apps for Multiple Platforms
<#
.Synopsis
Compile Go Apps for Multiple Platforms
.Parameter Platform
Platforms to compile for
.Notes
Developed by David Cruz
.Example
$ Build-GoSource.ps1 -Platform Windows-AMD64, Darwin-AMD64, Linux-AMD64
#>
@Dapacruz
Dapacruz / Watch-DomainControllers.ps1
Last active August 13, 2020 19:22
Watch Active Directory Domain Controllers for Adds and Removes
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$path = $PSScriptRoot
$reference_path = "$path\Domain_Controllers-Last.csv"
$difference_path = "$path\Domain_Controllers-Latest.csv"
$report_path = "$path\AD-DC-Changes-$(Get-Date -UFormat %m%d%Y).csv"
Start-Transcript -Path "$path\log.txt" | Out-Null
$domain_controllers_reference = Import-Csv -Path "$reference_path"