P-04 · Design doc

Security Chaos Lab

A proposed capstone that runs the other three projects on Kubernetes, injects attacks and failures, and measures whether each one is detected and contained.

Problem

Most teams believe their detections work because someone reviewed them, not because anyone tested them. Chaos engineering proved resilience by breaking systems on purpose. Applying the same discipline to security turns "we should catch that" into a measured time to detect.

Goals and non-goals

Goals

  • Run repeatable attack experiments, each with a written hypothesis and a stop condition.
  • Detect process and network behavior with an eBPF sensor.
  • Report time to detect and time to contain for every experiment.

Non-goals

  • Attack anything I do not own.
  • Replace a professional red team assessment.

Threat model

Experiments run only in a lab cluster I own. The lab itself is a risk: an experiment must never leave the cluster or run without a kill switch.

Threat model
ThreatActorProposed mitigationResidual risk
Stolen credentialSimulated attacker with a leaked tokenSession Risk Engine signals plus audit alertsA stolen token used in normal-looking ways
Compromised containerSimulated attacker with a shell in a podeBPF sensor flags unexpected process executionAttacks that only use expected binaries
Runaway experimentThe chaos tool itselfScoped service account, time limits, and a kill switchBugs in the scoping logic

Architecture

Proposed request flow
  1. Experiment specHypothesis, attack, stop condition
  2. Chaos runnerInjects the attack into the cluster
  3. ScorecardRecords detect and contain times
Detections are scored like tests. An experiment fails if no alert fires before its stop condition.

Alternatives considered

Tabletop exercises

Good for practicing the response process, but nothing is actually tested.

Commercial breach simulation

Mature, but a black box I cannot learn from or explain in an interview.

Hypothesis-driven chaos runner

More to build, but every result is reproducible and explainable.

Implementation

Simplified experiment loop. The timeout is the stop condition, and an experiment with no alert before it counts as a miss.

runner/experiment.goIllustrative
func Run(ctx context.Context, e Experiment, alerts AlertSource) Result {
    ctx, cancel := context.WithTimeout(ctx, e.StopAfter)
    defer cancel()

    start := time.Now()
    if err := e.Attack.Inject(ctx); err != nil {
        return Result{Name: e.Name, Err: err}
    }
    alert, ok := alerts.WaitFor(ctx, e.ExpectedAlert)
    if !ok {
        return Result{Name: e.Name, Detected: false}
    }
    return Result{Name: e.Name, Detected: true, TimeToDetect: alert.At.Sub(start)}
}

Postmortem

No prototype failure has been recorded yet. This is the first failure scenario to test.

Failure to test
An attack is "detected" by coincidence, through an unrelated alert.
Next test
Require each experiment to name its expected alert, then disable that detection on purpose and verify the run is scored as a miss.

Results

No measurements yet. These are the proposed metrics.

  • Detection rate across experimentsNot yet measured
  • Median time to detectNot yet measured
  • Time to containNot yet measured