This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| NVD Vulnerability Scanner for Homelab | |
| Scans installed packages against National Vulnerability Database | |
| """ | |
| import requests | |
| import json | |
| import subprocess | |
| from packaging import version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "dashboard": { | |
| "title": "PromSketch Optimized Metrics", | |
| "panels": [ | |
| { | |
| "title": "P99 Request Latency (Optimized)", | |
| "targets": [ | |
| { | |
| "expr": "histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))", | |
| "datasource": "PromSketch" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # PromSketch benchmark script - compare query performance | |
| PROMETHEUS_URL="http://localhost:9090" | |
| PROMSKETCH_URL="http://localhost:8080" | |
| QUERY='histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))' | |
| echo "=== PromSketch Benchmark ===" | |
| echo "Query: ${QUERY}" | |
| echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.8' | |
| services: | |
| prometheus: | |
| image: prom/prometheus:v2.48.0 | |
| container_name: homelab_prometheus | |
| restart: unless-stopped | |
| command: | |
| - '--config.file=/etc/prometheus/prometheus.yml' | |
| - '--storage.tsdb.path=/prometheus' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| pytest Test Suite for AuthREST Scanner | |
| Tests authentication pattern detection | |
| """ | |
| import pytest | |
| import requests | |
| from authrest_scanner import AuthRestScanner, AuthTest | |
| @pytest.fixture |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| AuthREST-style API Authentication Scanner | |
| Parses OpenAPI specs and tests authentication patterns | |
| """ | |
| import json | |
| import requests | |
| from typing import Dict, List, Optional | |
| from dataclasses import dataclass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # KubeFence K3s Cluster Configuration | |
| # Deploys K3s with embedded etcd + KubeFence DaemonSet | |
| # Tested on Ubuntu 24.04, K3s 1.28.6 | |
| --- | |
| # K3s server configuration (master node) | |
| # Deploy with: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server" sh -s - --config k3s-server.yaml | |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| KubeFence Policy Generator | |
| Analyzes K3s audit logs and generates fine-grained API policies | |
| Usage: | |
| python3 kubefence-policy-generator.py --namespace default --output policies/ | |
| """ | |
| import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # KubeFence Helm Installation Script | |
| # Deploys KubeFence as DaemonSet on K3s control plane nodes | |
| # Tested on K3s 1.28.6, Ubuntu 24.04 | |
| set -euo pipefail | |
| NAMESPACE="kubefence-system" | |
| RELEASE_NAME="kubefence" | |
| CHART_VERSION="0.1.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # NodeShield CBOM Generation Workflow | |
| # Automates SBOM → CBOM conversion with manual review prompts | |
| # | |
| # Dependencies: | |
| # - Syft (SBOM generator): https://github.com/anchore/syft | |
| # - NodeShield CLI: npm install -g @nodeshield/cli | |
| # | |
| # Usage: | |
| # ./generate-cbom.sh /path/to/nodejs/project |