Skip to content

Instantly share code, notes, and snippets.

View davidlu1001's full-sized avatar

David Lu davidlu1001

View GitHub Profile
@davidlu1001
davidlu1001 / dashboard.tf
Last active November 4, 2025 02:52
dashboard.tf
# dashboard.tf
# Azure Monitor Dashboard for AKS Platform & Application Overview
resource "azurerm_portal_dashboard" "aks_monitoring" {
count = var.enable_dashboard ? 1 : 0
name = "${local.base_suffix}-monitoring-dashboard"
resource_group_name = var.resource_group_name
location = var.location
tags = merge(local.alert_tags, { dashboard_version = "1.2", managed_by = "terraform" })
@davidlu1001
davidlu1001 / file-combiner.txt
Created September 21, 2025 19:38
file-combiner.txt
# Enhanced Combined Files Archive
# Generated by file-combiner v2.0.1
# Date: 2025-09-21 19:36:59 UTC
# Source: /tmp/file_combiner_github_o9p690ea
# Total files: 19
# Total size: 180.5KB
#
# Format:
# === FILE_SEPARATOR ===
# FILE_METADATA: <json_metadata>
@davidlu1001
davidlu1001 / terraform-aks-monitoring.txt
Created September 21, 2025 19:35
terraform-aks-monitoring.txt
# Enhanced Combined Files Archive
# Generated by file-combiner v2.0.1
# Date: 2025-09-21 19:30:35 UTC
# Source: /tmp/file_combiner_github_00gln5c_
# Total files: 14
# Total size: 109.7KB
#
# Format:
# === FILE_SEPARATOR ===
# FILE_METADATA: <json_metadata>
@davidlu1001
davidlu1001 / Kubernetes YAML Analyzer.md
Last active September 8, 2025 22:32
k8s_yaml_analyzer.py

Kubernetes YAML Analyzer

A powerful Python script to analyze multi-document Kubernetes YAML files and provide guidance for creating kustomization.yaml files with security context patches.

Features

  • Container Analysis: Accurately counts containers and initContainers for all Kubernetes workload types
  • Security Context Checking: Analyzes existing securityContext configurations
  • Kustomization Guidance: Provides detailed recommendations for creating kustomization.yaml patches
  • Flexible Search: Supports custom search rules via configuration files
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- all.yaml
patches:
# ================================
# UNIVERSAL POD-LEVEL SECURITY CONTEXT
# ================================
@davidlu1001
davidlu1001 / aks_vul_report_duckdb.py
Created July 15, 2025 05:50
aks_vul_report_duckdb.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
AKS Vulnerability Reporting Tool
Description:
This script queries Azure KQL for AKS cluster vulnerabilities, performs historical trend
analysis using a local DuckDB database, and sends a formatted HTML email summary
with a full CSV report as an attachment.
# Enterprise Immuta Column Tag Removal Tool
## πŸ“‹ Overview
The **Enterprise Immuta Column Tag Removal Tool** (`column_tag_del.py`) is a high-performance, production-ready Python script designed to remove tags from Immuta columns based on CSV input. This tool is the reverse operation of `column_tag_add.py` and features enterprise-grade reliability, comprehensive error handling, and advanced monitoring capabilities.
### 🎯 Key Features
- **🏒 Enterprise-Grade**: Circuit breaker, retry logic, adaptive rate limiting
- **πŸ“Š Progress Tracking**: SQLite-based persistence with resume functionality
@davidlu1001
davidlu1001 / column-tag-add.py
Last active May 26, 2025 11:33
column-tag-add.py
#!/usr/bin/env python3
import csv
import json
import logging
import sys
import os
from pathlib import Path
import requests
import argparse
@davidlu1001
davidlu1001 / Combined_Files_Archive.txt
Last active May 25, 2025 10:40
Combined Files Archive for repo file-combiner
# Enhanced Combined Files Archive
# Generated by file-combiner v2.0.1
# Date: 2025-05-25 10:39:59 UTC
# Source: /tmp/file_combiner_github_83t4ttow
# Total files: 15
# Total size: 128.0KB
#
# Format:
# === FILE_SEPARATOR ===
# FILE_METADATA: <json_metadata>
@davidlu1001
davidlu1001 / SOP_Immuta_Operations.md
Created May 21, 2025 04:49
SOP - Immuta Operations

Immuta Operations SOP - BAU / Change Management / Incident Learnings (with Snowflake Integration)


Quick Reference Table

Task API Endpoint Script Example Section
User Staging /api/v2/user/status stage_users.py 3.1
Tag Migration /api/v2/tag migrate_tags.py 2.4