Skip to content

Instantly share code, notes, and snippets.

View com30n's full-sized avatar

Evgeniy Shubin com30n

View GitHub Profile
-- 1. To authorize via Touch ID you must apply this script: https://gist.github.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70
-- 2. Create a new password entry in Keychain Access called "LDAP" with your ldap password
-- 3. Create a new password entry in Keychain Access called "2Factor" with your 2factor token
-- 4. Install oath-toolkit. (brew install oath-toolkit)
-- 5. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
-- 6. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
-- 7. Enable the above .app so it can access Accessibility
-- 8. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
-- 9. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text.
@com30n
com30n / vpn.sh
Last active September 15, 2020 14:55
Cisco AnyConnect Automatic connection script
#!/bin/bash
if [[ -n $DEBUG ]]; then
set -xe
fi
ldap_password_keychain_name=LDAP
second_factor_secret_keychain_name=2Factor
vpn_server=$2
vpn_group_index=$3
#!/bin/bash
# Tanks to: https://gist.github.com/ogrrd/5831371
# Update your homebrew installation
brew up
# Install dnsmasq
brew install dnsmasq
mkdir -pv $(brew --prefix)/etc/
#!/bin/bash
# Thanks to https://gist.github.com/soderlind/6a440cd3c8e017444097cf2c89cc301d
# Update your homebrew installation
brew up
# Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
@com30n
com30n / fix-dns.sh
Last active September 30, 2020 09:44
#!/bin/bash
# Fix DNS recornds after Cisco AnyConnect connection
sudo scutil << EOF
open
get State:/Network/Service/com.cisco.anyconnect/DNS
d.add ServerAddresses * 127.0.0.1
set State:/Network/Service/com.cisco.anyconnect/DNS
quit
@com30n
com30n / VPNConnect.scpt
Created April 1, 2021 09:29
Automatically connect to the Tunnelblick with MFA password
-- First of all: you have to connect to the vpn with Tunnelblick without,
-- paste your username, set a checkbox "Save in Keychain" for username,
-- paste your password and DO NOT set "Save in Keychain" for the password.
-- Then click "OK" button, connect to the vpn and since this moment you can use the script.
-- 1. To authorize via Touch ID you must apply this script: https://gist.github.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70
-- 2. Create a new password entry in Keychain Access called "tunnelblick-vpn-2f" with your MFA base32 token
-- 3. Add your a new connection name entry in Keychain Access called "tunnelblick-connection-name" with your name of the tunnelblick connection
-- 4. Install oath-toolkit. (brew install oath-toolkit)
-- 5. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.

Необходимые поля, которые хочется иметь во всех случаях логирования:

  • timestamp: Время в UTC

    • Время в UTC для синхронизации всех записей в логах
  • app_name: Имя приложения

    • Нужен для идентификакции и возможности фильтрации по имени приложения