Skip to content

Instantly share code, notes, and snippets.

View alekonko's full-sized avatar

alekonko alekonko

  • Private
  • Italy
View GitHub Profile
@alekonko
alekonko / Dockerfile
Created June 22, 2023 09:49 — forked from mateothegreat/Dockerfile
Mounting Google Cloud Storage Bucket inside of Kubernetes Pod
# __ __
# __ ______ ____ ___ ____ _/ /____ ____ ____/ /
# / / / / __ \/ __ `__ \/ __ `/ __/ _ \/ __ \/ __ /
# / /_/ / /_/ / / / / / / /_/ / /_/ __/ /_/ / /_/ /
# \__, /\____/_/ /_/ /_/\__,_/\__/\___/\____/\__,_/
# /____ matthewdavis.io, holla!
#
FROM node:9.2-alpine
ENV GOPATH /go
@alekonko
alekonko / Terraform-looping-lists-and-maps.tf
Created May 26, 2023 10:10 — forked from devops-school/Terraform-looping-lists-and-maps.tf
Terraform looping using lists-and-maps-with-for with example
terraform {
required_version = ">= 0.12.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "my_vpc" {
cidr_block = "172.16.0.0/16"
https://cloud.google.com/storage/docs/encryption/
BUCKET_NAME=YOUR_NAME_enron_corpus
gsutil mb gs://${BUCKET_NAME}
gsutil cp gs://enron_corpus/allen-p/inbox/1. .
tail 1.
Enable API/Create keyring
gcloud services enable cloudkms.googleapis.com

Purpose

*Most pentesting and gcp privilege escalation stuff out there for GCP assumes what I'm finding to be an absurd level of access handed to you.(i.e Human 2fa protected accounts, organization-wide read only IAM perms, etc that is not suitable for use in black box testing of mature environments.
There's a lot of data you need to use the gcp api only available behind mandatory 2fa protected human accounts that service accounts and low tier project accounts simply do not have access to enumerating if you find yourself having popped an application or shelled a instance somehow and have console-only access.

Intent of this is to break down various categories of escalation that will be available to service accounts, as well as point out various showstoppers.

@alekonko
alekonko / gcp-shared-vpc-multi-env.sh
Created April 9, 2022 12:46 — forked from mikesparr/gcp-shared-vpc-multi-env.sh
Example multi-env secure setup with Argo CD and Argo Rollouts
#!/usr/bin/env bash
# REF: https://cloud.google.com/docs/enterprise/best-practices-for-enterprise-organizations
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-west4" # CHANGEME (OPT)
@alekonko
alekonko / openshift-cheatsheet.md
Created November 12, 2021 15:01 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@alekonko
alekonko / curl.md
Created October 6, 2021 12:59 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@alekonko
alekonko / ocp4-download-clients
Created November 7, 2020 00:10 — forked from ryran/ocp4-download-clients
OCP4: Validate release available and download oc/openshift-install clients
#!/bin/bash
# ocp4-download-clients v0.2.0 last mod 2020/01/23
# Copyright 2020 Ryan Sawhill Aroha <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@alekonko
alekonko / ocpv4-expired-cert-recovery.sh
Created November 7, 2020 00:10 — forked from ryran/ocpv4-expired-cert-recovery.sh
OCPv4: recover from expired control plane certificates
#!/bin/bash
#
# This extremely rough nonsense is an attempt to automate the disaster recovery
# expired certs documentation published at
# https://docs.openshift.com/container-platform/4.1/disaster_recovery/scenario-3-expired-certs.html
# ... Which was last reviewed on 2019/06/10
#
# Please contact [email protected] with suggestions or corrections
# CUSTOMIZE THESE: