Skip to content

Instantly share code, notes, and snippets.

@Nogbit
Nogbit / main.tf
Created May 21, 2022 19:18
SCC Article Full TF
###
# Service account that will be the identity of our GCF
#
resource "google_service_account" "sa_gcf" {
account_id = "gcf-golden-image-scanner"
display_name = "Google Cloud Function that runs the golden image scanner"
}
resource "google_organization_iam_member" "org_scc_findings" {
org_id = var.org_id
@Nogbit
Nogbit / main.py
Last active July 23, 2022 01:10
SCC Article Python
import datetime
import uuid
import functions_framework
import google.cloud.logging
from google.cloud import securitycenter
from google.cloud.securitycenter_v1 import Finding
logging_client = google.cloud.logging.Client()
logging_client.setup_logging()
@Nogbit
Nogbit / main.tf
Created May 21, 2022 19:13
SCC Article - GCF
###
# Cloud Scheduler
#
data "google_compute_default_service_account" "default" {
}
resource "google_cloud_scheduler_job" "job" {
name = "Golden-Image-Scanner"
description = "A job that scans the image family ${var.image_family}"
region = var.region
@Nogbit
Nogbit / main.tf
Created May 21, 2022 19:12
SCC Article 4
###
# Google Cloud Function
#
resource "google_cloudfunctions_function" "scanner" {
name = "Golden-Image-Scanner"
description = "GCF to run daily that scans for disks using out of date golden images"
runtime = "python39"
region = var.region
available_memory_mb = 128
trigger_http = true
@Nogbit
Nogbit / main.tf
Created May 21, 2022 19:11
SCC - Article - 3
###
# Service account that will be the identity of our GCF
#
resource "google_service_account" "sa_gcf" {
account_id = "gcf-golden-image-scanner"
display_name = "Google Cloud Function that runs the golden image scanner"
}
resource "google_organization_iam_member" "org_scc_findings" {
org_id = var.org_id
role = "roles/securitycenter.findingsEditor"
@Nogbit
Nogbit / main.tf
Created May 21, 2022 19:10
SCC - Article - 2
resource "google_scc_source" "custom_source" {
display_name = "Golden Image Scanner"
organization = var.org_id
description = "Creates findings when disks are not using the latest golden image within a family"
}
@Nogbit
Nogbit / variables.tf
Last active May 21, 2022 19:08
SCC - Article - 1
variable "org_id" {
description = "The GCP organization that the SA of the Golden Image Scanner will have access to it's Security Command Center"
type = string
}
variable "project_id" {
description = "The GCP project that your Golden Image Scanner will run in"
type = string
}
variable "region" {
description = "The GCP region where resources will be provisioned"
@Nogbit
Nogbit / bootstrap.sh
Created August 28, 2021 18:08
EMR 6.3 Dask Bootstrap Action
#!/bin/bash
HELP="Usage: bootstrap-dask [OPTIONS]
Example AWS EMR Bootstrap Action to install and configure Dask and Jupyter
By default it does the following things:
- Installs miniconda
- Installs dask, distributed, dask-yarn, pyarrow, and s3fs. This list can be
extended using the --conda-packages flag below.
- Packages this environment for distribution to the workers.
@Nogbit
Nogbit / process.py
Last active August 14, 2023 21:32
Unreal Paragon Asset Consolidation
import unreal
#####
# For Texture2D, Material and TextureCube
# BEFORE - 72.8 GB
# AFTER - 49.0 GB, deleted 6869 duplicate files
# 22GB savings of data in /Game/Content
#
# Regarding MaterialFunctions, there are over 3200 of them, unfortunately the editor crashes when
# processing these, and the crash results in your character no longer having a material
@Nogbit
Nogbit / README.md
Last active August 15, 2019 16:59 — forked from hollemawoolpert/README.md
Simple VRP with Google Developer Resources

Binder

Simple VRP with Google Developer Resources¶

Demonstrates a solution for the simple multi-vehicle routing problem (VRP) using a combination of Google libraries and services. Sample depot and shipment locations randomly chosen in the San Antonio, TX metro area. Distances and times are based on Google's road network.

Getting Started

You will need a Google Maps Platform API Key.

Run on binder