Skip to content

Instantly share code, notes, and snippets.

View joostd's full-sized avatar

Joost van Dijk joostd

  • Utrecht, the Netherlands
View GitHub Profile
@joostd
joostd / Makefile
Last active July 3, 2023 21:12
Use xmllint to validate SAML 2.0 metadata (or similarly, any other SAML document) using an XML Catalog file
all: saml-2.0-os xsd/xenc-schema.xsd xsd/xmldsig-core-schema.xsd xcatalog/saml-metadata.xml
saml-2.0-os:
mkdir -p saml-2.0-os
wget http://docs.oasis-open.org/security/saml/v2.0/saml-2.0-os.zip
unzip -d saml-2.0-os saml-2.0-os.zip *.xsd
xcatalog/saml-metadata.xml:
mkdir -p xcatalog
xmlcatalog --noout --create xcatalog/saml-metadata.xml

Keybase proof

I hereby claim:

  • I am joostd on github.
  • I am joost (https://keybase.io/joost) on keybase.
  • I have a public key whose fingerprint is 2221 3B0B 74FE 7AAD 1F3F 3F45 5928 0105 5F59 47EA

To claim this, I am signing this object:

@joostd
joostd / msol-surfconext-powershell.xslt
Created November 9, 2015 16:09
XSLT transformation to generate powershell configuration scripts for federated Microsoft Azure AD domains using the SAML 2.0 protocol.
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
>
<!--
Convert SAML 2.0 IdP Metadata into Microsoft Azure Powershell commands for Office 365 federated domain configuration
example usage:
@joostd
joostd / blockchain-id
Created November 22, 2015 21:20
Verifying that +joostd is my blockchain ID. https://onename.com/joostd
Verifying that +joostd is my blockchain ID. https://onename.com/joostd
@joostd
joostd / jmrtd.jsh
Created July 26, 2018 16:09
Simple JShell script to read personal ID number from ICAO passport using jmrtd and scuba
//usr/bin/env jshell "$0" "$@"; exit $?
// install dependencies:
// wget https://repo1.maven.org/maven2/org/jmrtd/jmrtd/0.7.2/jmrtd-0.7.2.jar
// wget http://bouncycastle.org/download/bcprov-jdk15on-160.jar
// wget https://repo1.maven.org/maven2/net/sf/scuba/scuba-sc-j2se/0.0.18/scuba-sc-j2se-0.0.18.jar
// wget https://repo1.maven.org/maven2/net/sf/scuba/scuba-smartcards/0.0.18/scuba-smartcards-0.0.18.jar
/env --class-path scuba-sc-j2se-0.0.18.jar:scuba-smartcards-0.0.18.jar:jmrtd-0.7.2.jar:bcprov-jdk15on-160.jar
/env --add-modules java.smartcardio,java.xml.bind
@joostd
joostd / gist:dae6cb00a6201c782a96c5cf53d0f160
Created August 1, 2019 11:53
fix a python virtualenv after upgrading python
# src: https://stackoverflow.com/questions/23233252/broken-references-in-virtualenvs
brew install findutils # macos find doesn't have xtype
gfind venv/ -type l -xtype l -delete
virtualenv venv -p python3
@joostd
joostd / install-openssh-sk.sh
Last active January 23, 2023 09:59
How to build openssh with support for FIDO Security keys on Ubuntu 18.04
sudo apt update
sudo apt install -y cmake cmake-data pkgconf autoconf
sudo apt install -y libssl-dev libudev-dev libcbor-dev libz-dev
git clone https://github.com/Yubico/libfido2.git
cd libfido2/
mkdir build
(cd build && cmake ..)
make -C build
sudo make -C build install
@joostd
joostd / Makefile
Created April 14, 2020 17:37
Sectigo REST API example
EMAIL=you@example.edu
CN=www.example.edu
ssl-types.json:
curl -s https://cert-manager.com/api/ssl/v1/types -H @headers > ssl-types.json
key.pem:
openssl genrsa -out key.pem 2048
csr.pem: key.pem
@joostd
joostd / openid-configuration
Last active June 12, 2020 06:55
Modified openid connect configuration for including email claim
{
"issuer": "https://connect.test.surfconext.nl",
"authorization_endpoint": "https://connect.test.surfconext.nl/oidc/authorize?response_mode=query&claims=%7B%22id_token%22%3A%7B%22email%22%3Anull%7D%7D",
"token_endpoint": "https://connect.test.surfconext.nl/oidc/token",
"userinfo_endpoint": "https://connect.test.surfconext.nl/oidc/userinfo",
"introspect_endpoint": "https://connect.test.surfconext.nl/oidc/introspect",
"jwks_uri": "https://connect.test.surfconext.nl/oidc/certs",
"response_types_supported": [
"code",
"token",
@joostd
joostd / u2f_fido2_dissector.lua
Last active November 5, 2020 16:36 — forked from z4yx/u2f_fido2_dissector.lua
Wireshark protocol decoder for FIDO(U2F) and FIDO2(WebAuthn) over USB HID
cbor = Dissector.get("cbor")
iso7816 = Dissector.get("iso7816")
ctap_proto = Proto("ctaphid","ctap hid")
-- Field Extractor
direction_fe = Field.new("usb.endpoint_address.direction")
udp_srcport_fe = Field.new("udp.srcport")
CTAPHID_COMMAND_CODE = {
[0x03]='CTAPHID_MSG',
[0x10]='CTAPHID_CBOR',