Skip to content

Instantly share code, notes, and snippets.

View aschmidt75's full-sized avatar

Andreas Schmidt aschmidt75

View GitHub Profile

Pattern: Enforce Proper Access Control & Least Privilege in CI/CD Pipelines

This pattern, when properly implemented, ensures that CI/CD pipelines operate with the minimal necessary privileges, guarding against unauthorized actions and reducing the overall risk to software delivery workflows.

Context

Modern software delivery relies on Continuous Integration and Continuous Delivery (CI/CD) pipelines, often spanning multiple services, build agents, and cloud infrastructures. These pipelines must handle sensitive operations such as code compilation, artifact storage, secrets management, and deployment to production systems. As a result, rigorous Identity and Access Management (IAM) policies and Role-Based Access Control (RBAC) are critical to safeguard these processes.

Problem

Without proper access controls, unauthorized parties or processes can gain elevated privileges, manipulate the pipeline, access sensitive secrets, or compromise production environments. Inadequate RBAC and violation of the [Princ

@aschmidt75
aschmidt75 / PSIPCalc.ps1
Created November 22, 2023 08:13
Powershell ipcalc cidrsubnet helper
Function Convert-IpAddressStringToBinString {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$IpAddress
)
$IpAddressFullBin = ""
foreach ($octet in $IPAddress.Split(".")) {
@aschmidt75
aschmidt75 / t1-2.ps1
Created November 5, 2023 14:46
drawio
[CmdletBinding()]
class DrawIOStyle {
[Hashtable]$elems
[bool]$IsImage
DrawIOStyle() {
$this.elems = New-Object -TypeName Hashtable
}
I am attesting that this GitHub handle aschmidt75 is linked to the Tezos account tz1UbsLVDYYbc5itm5B7RgQjkXDqs3qdoS3T for tzprofiles
sig:edsigtumt29e7bT68gYrJhf5xNWGmsF6z6GEo4zLWdt5nU88sWyuVuzQbwfVGaD5c3YCMMfVrFzYdpQrgtjCj2AsKZ23ZuRtTna
@aschmidt75
aschmidt75 / README.md
Created June 21, 2021 13:54
Example of c11 anonymous struct / Introduction of abstract interfaces

Example of c11 anonymous struct / Introduction of abstract interfaces

$  gcc -Wno-missing-declarations -std=c11 -fms-extensions -Wno-microsoft-anon-tag -o ex *.c && ./ex
@aschmidt75
aschmidt75 / nginx-configmap.yaml
Created November 5, 2019 16:16
k8s-sample-nginx-conf-deployment
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {
Instantiating chaincode.
enter Init
enter Invoke
requested function=registerIndividualParticipant, with args=[]string{"{ \"name\": \"Andreas\", \"address\": \"Some where 17, 50735 Cologne, DE\" }"}
enter registerIndividualParticipantInvocation.checkParseArguments
enter registerIndividualParticipant.process
arg=main.registerIndividualParticipantArg{Name:"Andreas", Address:"Some where 17, 50735 Cologne, DE"}
newId: PutState to key=sample.PreciousCargoChaincode.IndividualParticipant.index, index=1
key=sample.PreciousCargoChaincode.IndividualParticipant#0000000001
PutState to key=sample.PreciousCargoChaincode.IndividualParticipant#0000000001, data=main.IndividualParticipant{Participant:main.Participant{ID:main.ID{ID:"0000000001"}, Name:"Andreas"}, Address:"Some where 17, 50735 Cologne, DE"}
@aschmidt75
aschmidt75 / invoke.sh
Last active May 10, 2019 13:29
Invoke chaincode transactions on Hyperledger Fabric "First-network" example
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo 'Usage: cat inputdata.json | ./invoke.sh FUNCTIONNAME'
exit 1
fi
FUNCTION="$1"
INPUTDATA0=`cat`
INPUTDATA=$(echo $INPUTDATA0 | sed 's/\"/\\"/g')
func (r registry) create(stub shim.ChaincodeStubInterface, item interface{}) (string, error) {
idStr, err := newID(stub, r.typeStr)
if err != nil {
return "", errors.New("internal error generating index key")
}
ck, err := getShipmentKey(stub, idStr)
if err != nil {
return "", errors.New("internal error generating composite key")
}