Skip to content

Instantly share code, notes, and snippets.

View nilayparikh's full-sized avatar

Nilay Parikh nilayparikh

View GitHub Profile
from __future__ import annotations
import argparse
import datetime as dt
import json
import math
import re
import statistics
from dataclasses import dataclass
from pathlib import Path
@nilayparikh
nilayparikh / check_repo_compromise.py
Last active April 28, 2026 21:19
Audit a git repository for compromise indicators after GHES incidents. This script is defensive. It cannot prove a repository or server is clean. It flags suspicious signals in a local clone and optional exported log files.
"""Audit a git repository for compromise indicators after GHES incidents.
This script is defensive. It cannot prove a repository or server is clean.
It flags suspicious signals in a local clone and optional exported log files.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,