Skip to content

Instantly share code, notes, and snippets.

@Miladbr
Miladbr / log-forwarding-with-etw.ps1
Created June 14, 2021 06:28 — forked from ajpc500/log-forwarding-with-etw.ps1
Quick-and-dirty PowerShell script to install Sysmon (SwiftOnSecurity config), SilkService and Winlogbeat, and forward logs to HELK based on IP set in environment variable "HELK_IP" (see Line 224).
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$wc = New-Object System.Net.WebClient
if (!(Test-Path "C:\Tools")) {
New-Item -Path "C:\" -Name "Tools" -ItemType "directory"
}
# SYSMON
# Download Sysmon
$SysmonDirectory = "C:\Tools\Sysmon\"
clusterName=$1
server=$2
namespace=$3
serviceAccount=$4
set -o errexit
secretName=$(kubectl --namespace $namespace get serviceAccount $serviceAccount -o jsonpath='{.secrets[0].name}')
token=$(kubectl --namespace $namespace get secret/$secretName -o jsonpath='{.data.token}' | base64 --decode)
@Miladbr
Miladbr / local.sh
Created July 31, 2022 11:28
Persist an esxi firewall rule for outgoing syslog traffic
# Append below lines in /etc/rc.local.d/local.sh.
# Change host_address and host_port according to your syslog server configuartion.
/bin/cat > /etc/vmware/firewall/persistsyslog.xml << EOF
<!-- remote syslog configuration -->
<ConfigRoot>
<service>
<id>persistsyslog</id>
<rule id='0000'>
<direction>outbound</direction>

Keybase proof

I hereby claim:

  • I am miladbr on github.
  • I am miladbr (https://keybase.io/miladbr) on keybase.
  • I have a public key whose fingerprint is 4A95 4251 256F F700 D6F5 65FF 0EC2 61C0 A5E2 3257

To claim this, I am signing this object: