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 | Actor | Proposed mitigation | Residual risk |
|---|---|---|---|
| Stolen credential | Simulated attacker with a leaked token | Session Risk Engine signals plus audit alerts | A stolen token used in normal-looking ways |
| Compromised container | Simulated attacker with a shell in a pod | eBPF sensor flags unexpected process execution | Attacks that only use expected binaries |
| Runaway experiment | The chaos tool itself | Scoped service account, time limits, and a kill switch | Bugs in the scoping logic |
Architecture
- Experiment specHypothesis, attack, stop condition
- Chaos runnerInjects the attack into the cluster
- ScorecardRecords detect and contain times
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.
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