Skip to content

Instantly share code, notes, and snippets.

View pschakravarthi's full-sized avatar

pschakravarthi

View GitHub Profile
@pschakravarthi
pschakravarthi / kamailio.cfg
Created June 17, 2024 05:17 — forked from ZionDials/kamailio.cfg
Hardening Your Kamailio Configuration with secfilter and GeoIP2
#!KAMAILIO
#!define WITH_MYSQL
#!define WITH_GEOIP2
#!define WITH_SECFILTER
#!define WITH_ANTIFLOOD
#!define WITH_AUTH
#!define WITH_IPAUTH
#!define WITH_USRLOCDB
#
# Kamailio SIP Server v5.6 - default configuration script
@pschakravarthi
pschakravarthi / .gitconfig
Created July 23, 2022 17:29 — forked from peterkappus/.gitconfig
Handy git aliases from betandr.
[http]
proxy = http://some-proxy:80
[https]
proxy = http://some-proxy:80
[alias]
#co = checkout
#br = branch
ci = commit
st = status
co = !git checkout
@pschakravarthi
pschakravarthi / README.md
Created April 6, 2022 09:48 — forked from lcrilly/README.md
NGINX OAuth 2.0 Token Introspection

OAuth 2.0 Token Introspection with NGINX and njs

This configuration enables NGINX to validate an authentication token against an authorization server by using OAuth 2.0 Token Introspection (RFC 7662). This solution uses the auth_request module and the NGINX JavaScript module to require authentication and perform the token introspection request.

By default, the client's authentication token is expected as a bearer token supplied in the Authorization header. If supplied elsewhere in the HTTP request, the $access_token variable must be configured to specify where to obtain the token.

Token introspection requests are authenticated. By default, the $oauth_client_id and $oauth_client_secret variables are used to perform HTTP Basic authentication with the Authorization Server. If only the $oauth_client_secret variable is specified then that value is used

@pschakravarthi
pschakravarthi / rsa.go
Created February 7, 2022 13:42 — forked from sohamkamani/rsa.go
Example of RSA encryption, decryption, signing, and verification in Go
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"fmt"
)
@pschakravarthi
pschakravarthi / README-2.md
Last active December 25, 2021 06:26 — forked from jjenkins70/README.md
HashiCorp Vault TLS Certificate Auth Samples

Simple Vault TLS Certificate validation & testing

Set of scripts to deploy locally, vault and configure TLS server and user certificates for testing TLS AUTH.

credit to @reard3n (https://github.com/reard3n) and @v6 (https://github.com/v6) for the gist this grew from

Notes

This was tested using Vagrant and Ubuntu

Getting Setup

  • On the OS of your choice copy VaultCASetup.sh script locally and update any variables that would be specific to your environment and/or
@pschakravarthi
pschakravarthi / CentOS-Docker
Created September 25, 2020 09:50 — forked from silveraid/CentOS-Docker
Creating minimal CentOS docker image from scratch
# Create a folder for our new root structure
$ export centos_root='/centos_image/rootfs'
$ mkdir -p $centos_root
# initialize rpm database
$ rpm --root $centos_root --initdb
# download and install the centos-release package, it contains our repository sources
$ yum reinstall --downloadonly --downloaddir . centos-release
$ rpm --root $centos_root -ivh centos-release*.rpm
$ rpm --root $centos_root --import $centos_root/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# install yum without docs and install only the english language files during the process