Skip to content

Instantly share code, notes, and snippets.

View ppmathis's full-sized avatar

Pascal Mathis ppmathis

View GitHub Profile
-std=c++20
package nagopher
import "github.com/markphelps/optional"
type thresholdModule struct{}
type thresholdOpt func(*threshold)
type threshold struct {
inverted bool
lowerBound optional.Float64
upperBound optional.Float64

Intro

This peer-group fuzzer (pgf) was built to check neighbor/peer-specific attribute overrides in the FRRouting BGP daemon, which as of today rarely work or get lost as soon as any configuration change gets done to the peer-group.

Check Method

The following steps are being executed for each attribute that gets checked:

  • Rebuild clean BGP instance from start by clearing all existing configuration
  • Configure an empty peer-group
  • Configure an empty neighbor belonging to that peer-group
  • Execute a command which sets the specific attribute on the peer-group
  • Check if the executed command appears in show running-configuration
defaults d-xmpp
log global
mode tcp
option redispatch
option tcplog
option tcpka
option clitcpka
option srvtcpka
timeout connect 5s
@ppmathis
ppmathis / openssl-san.conf
Created April 5, 2018 15:33
Creates SAN certificate requests with OpenSSL without any file/configuration changes
########################################
# Usage:
#
# SAN Certificate:
# > export OPENSSL_SAN=DNS:a.example.com,DNS:b.example.com,DNS:c.example.com
# > openssl req -reqexts v3_req_san -new -newkey rsa:2048 -out tmp.csr -keyout tmp.key (-subj "<subject>")
#
# Non-SAN Certificate:
# > openssl req -new -newkey rsa:2048 -out tmp.csr -keyout tmp.key (-subj "<subject>")
########################################
function listener.onconnect(conn)
-- Debug code for analyzing stacktraces
if conn:ip() == nil then
module:log("warn", "[ppmathis] conn:ip() returned nil - panic! getpeername(): %s %s", conn:socket():getpeername());
end
-- Check if connection is coming from a trusted proxy
if not is_trusted_proxy(conn) then
conn:close();
module:log("warn", "Dropped connection from untrusted proxy: %s", conn:ip());
module:set_global();
local portmanager = require "core.portmanager";
local set = require "util.set";
local ip = require "util.ip";
local listener = {};
local sessions = {};
local mappings = {};

Keybase proof

I hereby claim:

  • I am ppmathis on github.
  • I am ppmathis (https://keybase.io/ppmathis) on keybase.
  • I have a public key ASBID_oGmh7eoLbxcjsTjWEKDknsWeuOur5u7vqA2MXmqgo

To claim this, I am signing this object:

@ppmathis
ppmathis / _modules\ssx.py
Last active January 25, 2022 12:23
SaltStack: Custom state and execution module for ansible-like 'assemble' function
import os
import salt.loader
import salt.utils
import salt.utils.jinja
import salt.utils.files
from salt.exceptions import SaltInvocationError, CommandExecutionError
def get_assemble_fragments(fragments_path, include_pattern=None, exclude_pattern=None):
@ppmathis
ppmathis / debian-stretch-fde.md
Last active January 30, 2022 15:26
Guide which explains an installation of Debian Stretch with full disk encryption (including "/boot" partition, containing initramfs+kernel) by using Debian Jessie Live.

Debian Stretch - Full Disk Encryption

This documents guides you through the process to install Debian Stretch with Full Disk Encryption. The following requirements exist:

  • Mainboard with UEFI-Support
  • Debian Stretch Live CD booted from UEFI
  • Two unformatted, unpartitioned HDDs/SSDs for Software RAID1 with mdmadm

After following this guide, you will end up with a setup like this:

  • Redundant GRUB Standalone EFI installation on both disks