Skip to content

Instantly share code, notes, and snippets.

View JAORMX's full-sized avatar
🍼
parental leave

Juan Antonio Osorio JAORMX

🍼
parental leave
View GitHub Profile
@JAORMX
JAORMX / eks-token-refresh.sh
Created June 5, 2025 05:41
Refresh EKS tokens into a kubeconfig
#!/bin/bash
# EKS Token Refresh Script
#
# This script automates the process of refreshing AWS EKS authentication tokens in your kubeconfig file.
# It replaces AWS CLI authentication with a token-based authentication that is periodically refreshed.
#
# Usage:
# ./eks-token-refresh.sh
#
@JAORMX
JAORMX / nist-nerc-mapping.json
Created July 13, 2021 14:37
NERC CIP automation
{
"AC-1": [
"CIP-003-3 R1",
"CIP-003-3 R1.1",
"CIP-003-3 R1.2",
"CIP-003-3 R1.3",
"CIP-003-3 R2",
"CIP-003-3 R2.1",
"CIP-003-3 R2.2",
"CIP-003-3 R2.3",
@JAORMX
JAORMX / install-operator.yaml
Created October 22, 2020 13:20
Install the compliance operator through a RHACM policy
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: policy-comp-operator
namespace: default
annotations:
policy.open-cluster-management.io/standards: NIST-CSF
policy.open-cluster-management.io/categories: DE.CM Security Continuous Monitoring
policy.open-cluster-management.io/controls: DE.CM-8 Vulnerability scans
spec:
@JAORMX
JAORMX / happy-path.yaml
Created June 10, 2020 14:50
New CRs for compliance-operator
apiVersion: compliance.openshift.io/v1alpha1
kind: Profile
metadata:
name: ocp4-e8
annotations:
compliance.openshift.io/platform-type: platform
compliance.openshift.io/platform: ocp4
spec:
title: e8 profile
---
@JAORMX
JAORMX / install.yml
Created May 20, 2020 12:43
Deploying the compliance operator to all openshift clusters in rhacm
apiVersion: policy.mcm.ibm.com/v1alpha1
kind: Policy
metadata:
name: install-compliance-operator
namespace: default
annotations:
policy.mcm.ibm.com/standards: NIST-CSF
policy.mcm.ibm.com/categories: DE.CM Security Continuous Monitoring, PR.PT Protective Technology
policy.mcm.ibm.com/controls: DE.CM-8 Vulnerability scans, PR.PT-3 Least Functionality
spec:
@JAORMX
JAORMX / compile-ebpf-fedora.sh
Created March 6, 2019 14:13
Clang invocation to compile an eBFP program in Fedora
#!/bin/bash
#
# Note that this requires installing the kernel-devel package:
# sudo dnf install -y kernel-devel
#
# ns.c is the C code that contains our eBPF program.
clang -D__KERNEL__ -D__ASM_SYSREG_H \
-Wunused \
-Wall \
@JAORMX
JAORMX / tripleorelease.sh
Last active October 24, 2018 12:54
Make releases for tripleo projects
#!/bin/bash
set -e
RELEASE=$1
TYPE=$2
if [[ -z "$RELEASE" ]]; then
echo "Please provide the release as the first argument"
exit 1
fi
@JAORMX
JAORMX / tripleoprojects.py
Last active October 24, 2018 12:19
Print projects under TripleO
#!/bin/python
"""
This script is meant to print all of the projects belonging to the TripleO
project.
"""
import requests
import yaml
resp = requests.get('https://git.openstack.org/cgit/openstack/governance/plain/reference/projects.yaml')
#!/usr/bin/env python
from __future__ import print_function
import argparse
import lazr.restfulclient.errors
import os
import sys
# import sqlite3
from launchpadlib import launchpad
@JAORMX
JAORMX / barbican-policy.json
Created June 7, 2018 12:50
Barbican's policy.json file
{
"admin": "role:admin",
"observer": "role:observer",
"creator": "role:creator",
"audit": "role:audit",
"service_admin": "role:key-manager:service-admin",
"admin_or_user_does_not_work": "project_id:%(project_id)s",
"admin_or_user": "rule:admin or project_id:%(project_id)s",
"admin_or_creator": "rule:admin or rule:creator",
"all_but_audit": "rule:admin or rule:observer or rule:creator",