Skip to content

Instantly share code, notes, and snippets.

@jscheunemann
jscheunemann / freeipa-openvpn.md
Created July 9, 2022 05:19 — forked from rechner/freeipa-openvpn.md
FreeIPA setup for OpenVPN logins

This article proved to be a decent starting point, but I was particularly interested in allowing password-based logins to OpenVPN using a username/password backed by FreeIPA (opposed to client certificates) as the identity provider.

  • IPA join your VPN machine: ipa-client-install --mkhomedir
  • Get a kerberos ticket: kinit
  • Create a Kerberos service principle and HBAC rule for openvpn access:
ipa service-add openvpn/`hostname`
  • Create new hbacrule in console, mark host as the VPN host, and whatever group you want to restrict access to:
@jscheunemann
jscheunemann / custom_ssl_unifi_controller.md
Last active July 7, 2022 14:26 — forked from hdml/custom_ssl_unifi_controller.md
Installing a custom SSL cert on a Unifi Controller

Installing a custom SSL cert on Unifi Controller

Requirements:

  • Domain certificate (*.crt)
  • Certificate key (*.key)
  • Intermediate certificate from CA (*.crt, *.pem)
  • Permissions to restart the unifi service
  • Debian or Ubuntu Unifi Controller installation
@jscheunemann
jscheunemann / firewall-rules.sh
Last active March 29, 2021 18:41
Firewall Rules for Wireguard
#!/usr/bin/env bash
IP_TABLES="iptables"
NETWORK_INTERFACE="eth0"
WIREGUARD_INTERFACE="wg"
### Accept all traffic first to avoid ssh lockdown via iptables firewall rules ###
${IP_TABLES} -P INPUT ACCEPT
${IP_TABLES} -P FORWARD ACCEPT
${IP_TABLES} -P OUTPUT ACCEPT
@jscheunemann
jscheunemann / aws-ova-import.md
Last active March 24, 2021 12:41
AWS OVA Import

Import commands

container.json

[{
  "Description": "<Name of OVA>",
  "Format": "ova",
  "UserBucket": {
    "S3Bucket": "<S3 bucket name>",
 "S3Key": ""
@jscheunemann
jscheunemann / aws-nitro-support.md
Last active March 21, 2021 23:56
Enable AWS Nitro support in RHEL

Enable AWS Nitro Support in RHEL 7.9

Note: RHEL 7.9 includes all required drivers, but they must be added to the initramfs.

Steps

  1. Install dracuts-generic
yum install dracut-config-generic
@jscheunemann
jscheunemann / rhel-cockpit-cert-gen.md
Last active March 7, 2021 18:44
Generate certificate for RHEL's Cockpit Service

Generate certificate for RHEL's Cockpit Service

NOTE: All commands on the RHEL server should be completed in the /etc/cockpit/ws-certs.d directory. The cockpit service will fail to start if there are multiple certifcate files in the /etc/cockpit/ws-certs.d directory. More details about generating certificate files for the cockpit service can be found at https://access.redhat.com/solutions/4165361.

Create a CA and generate a set of web certificates

Follow the directions at https://gist.github.com/jscheunemann/8c08b8a9a72928ffb46869e6fe61ac22

Convert the webserver's encryption key into a PKCS8 file

@jscheunemann
jscheunemann / lab-ca.md
Last active March 7, 2021 14:39
Lab CA

Lab CA Configuration

Create a CA

Generate the encryption key

user@ca:$ openssl genrsa -des3 -out lab.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
.........................................................................+++++
.....................+++++
@jscheunemann
jscheunemann / selinux.md
Last active January 31, 2021 21:36
Setting SELinux in RHEL/CENTOS 7+

/etc/selinux/config

selinux=enforcing|permissive|disabled

/etc/default/grub

GRUB_CMDLINE_LINUX=... quiet selinux=0|1
@jscheunemann
jscheunemann / nmap_recon.md
Last active January 23, 2021 19:49
NMap For recon

A word of caution:

NMap is considered an offensive scanning technique, make sure you have the network/devices owners permission before scanning with NMap.

Always get permission before scanning a system you do not own. The permission must be in writing and signed by both parties – the scanner and the system owner.

Notest about NMap

NMap is a port and network scanner used to enumerate devices and ports. NMap uses various techniques to identify network endpoints. Be default NMap scans for IPv4 networks, supplying the -6 instructs NMap to use IPv6.

@jscheunemann
jscheunemann / add-airprint-to-linux.md
Last active September 10, 2020 15:10
Adding Airprint printer to Linux

Install the following:

  • cups
  • cups-filters
  • cups-ipptool

Add printer to cups using the following:

# lpadmin -p "HP-LaserJet-m15W" -m everywhere -v ipp://10.100.253.100/ -E