Part 2 of 12 · 2 min read
A generator covers a grid of attacks; a list only covers what you thought of
Crossing goals with carriers and phrasings produces every combination automatically, instead of relying on memory to think of them one at a time.
Think of a friendly burglar hired to break into your own house. A red team is exactly that. It is people or programs paid to attack a system on purpose, repeatedly. A blue team can then fix what they find before someone hostile does.
A red team attacks the system to find weaknesses and a blue team defends, monitors and fixes it, and the way to make an attack set thorough rather than a handful of famous examples is to generate it as every combination of attacker goals, carriers (direct message, a web page, a tool result) and phrasing families. That means coverage comes from the grid's structure rather than from what anyone happened to think of.
A worked example. Crossing 5 attacker goals with 3 carriers, 6 phrasing families and 3 obfuscations produces 270 distinct attacks -- far more than a person would hand-write, and systematic enough that a whole category (say, every attack using the "authority" phrasing against the "read another customer's record" goal) is guaranteed to be represented rather than possibly missing by accident.
The key lines. From code/mini-redteam/redteam.py:
# from code/mini-redteam/redteam.py
def generate_attacks():
out = []
for (g, (gtext, action, sev)), c, (f, (tpl, s)), o in itertools.product(GOALS.items(), CARRIERS, FAMILIES.items(), OBF):
out.append({"id": f"{g}-{c}-{f}-{o}", "goal": g, "carrier": c, "family": f, "obf": o,
"text": obfuscate(tpl.format(goal=gtext), o), "action": action, "severity": sev})
return out
Read it as: itertools.product takes the Cartesian product of all four dimensions at once. Every goal appears with every carrier, every phrasing and every obfuscation. That is the mechanical guarantee that nothing in the grid's four dimensions gets left untested just because a human reviewing the list forgot a combination.
Red team, blue team
A red team is people (or programs) that attack the system to find weaknesses. A blue team defends, monitors and fixes it.
Example: the 270-attack grid is what a red team produces before a single attack is ever run -- the blue team's job starts only once this generated set exists to measure a defence against.