Skip to content

Instantly share code, notes, and snippets.

View danifr's full-sized avatar
🐧

Daniel Fernández danifr

🐧
View GitHub Profile
@drmalex07
drmalex07 / README-fail2ban-keycloak.md
Last active March 1, 2024 17:14
Use fail2ban to block brute-force attacks to keycloak server. #keycloak #fail2ban #brute-force-attack

Add regular-expression filter under /etc/fail2ban/filter.d/keycloak.conf:

[INCLUDES]

before = common.conf

[Definition]

_threadName = [a-z][-_0-9a-z]*(\s[a-z][-_0-9a-z]*)*
_userId = (null|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})
pm uninstall -k --user 0 com.google.android.apps.tachyon &&
pm uninstall -k --user 0 com.google.android.music &&
pm uninstall -k --user 0 com.google.android.apps.docs.editors.sheets &&
pm uninstall -k --user 0 com.google.android.apps.docs.editors.slides &&
pm uninstall -k --user 0 com.google.android.apps.docs.editors.docs &&
pm uninstall -k --user 0 com.google.android.videos &&
pm uninstall -k --user 0 com.android.gallery3d &&
pm uninstall -k --user 0 com.android.calendar &&
pm uninstall -k --user 0 com.evernote &&
pm uninstall -k --user 0 com.evernote.promohelper &&
@int128
int128 / README.md
Created June 22, 2018 06:57
GitLab SAML SSO with Keycloak

GitLab SAML SSO with Keycloak

Keycloak

  1. Open your Keycloak realm.
  2. Import keycloak-gitlab.json.
  3. Fix URLs of the client.

GitLab

@pkirkovsky
pkirkovsky / yubikey-reset.sh
Last active October 20, 2023 21:57
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
# Adapted from https://developers.yubico.com/ykneo-openpgp/ResetApplet.html
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@paoloantinori
paoloantinori / keycloak.sh
Created January 26, 2016 15:59
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@gschueler
gschueler / basic-app.json
Last active November 5, 2020 18:46
Basic Rundeck aclpolicy, allows access to one project for one group
{
"description": "MyGroup allowed access to MyProject only",
"context": {
"application": "rundeck"
},
"for": {
"project": [
{
"match": {
"name": "MyProject"