Who may read this report?
Northgate CERT warns you that Copper Lantern hit your office. You want to warn other colleges too. The indicators would help them. The fact that your office was hit is your own business.
A label on every piece says who may receive it, so you can share the useful part and keep the rest. Everything here is made up, and you work in your own lab copy.
By the end of this lesson
Note
I can decide what part of a threat report may go to each audience under TLP 2.0.
Key words
| Word | What it means | Example |
|---|---|---|
| TLP | labels saying how far information may be shared | |
| Audience | the people a piece of intelligence goes to | |
| Marking | a label attached to a STIX object | object_marking_refs |
| Sanitise | to remove details that identify a victim or person | |
| Sharing community | a group of organisations that agree to share |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsThe one rule
Important
Practise on the made-up bundle in your own lab copy. A real report shared with you is not yours to pass on beyond its label. An address or an email address can be personal data, so data protection law applies to sharing it too.
Five labels, from anyone to named people
The Traffic Light Protocol, version 2.0 (FIRST, 2022), has five labels. The sender chooses one, and every recipient keeps to it.
TLP:CLEAR may go to anyone. TLP:GREEN stays in the recipient's community, never in public. TLP:AMBER stays in the recipient's organisation and its clients, on a need to know. TLP:AMBER+STRICT stays in the organisation. TLP:RED is for the named recipients alone.
Worked example: the report's pieces and their labels
| Piece | Label | Why |
|---|---|---|
| Copper Lantern, updater, Web Protocols | TLP:CLEAR | Helps anyone defend |
| The five indicators | TLP:GREEN | Useful to peers, would warn the group if public |
| Riverside office and the sighting | TLP:AMBER+STRICT | Says who was hit |
| Copper Lantern targets Riverside office | TLP:AMBER+STRICT | A link takes the stricter of its two ends |
The cells students fill in are left blank in this preview.
Check
Have a go
Check
3 questionsCut a bundle down for each audience
In STIX, a label is a marking: a marking-definition object, referred to from each object's object_marking_refs. The Runs write the bundle again, in case you start here, and then a script that labels every object.
Given an audience, it prints each object's label and keeps only what that audience may receive.
Move into the lab's folder
cd ~/detectShown here, not run. Press Start lab to type it into your own lab’s terminal.
Make sure the intelligence folder exists
mkdir -p intelShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write lesson 4's bundle script, part 1
printf '%s\n' 'import json, uuid' 'NS, T, Q = uuid.UUID("6f6e3a5c-1d2b-4c8e-9a7f-3b5d0c2e1a90"), "2026-11-03T10:00:00.000Z", chr(39)' 'objs = []' 'def add(kind, key, **more):' ' obj = {"type": kind, "spec_version": "2.1", "id": kind + "--" + str(uuid.uuid5(NS, kind + key)), "created": T, "modified": T}' ' obj.update(more)' ' objs.append(obj)' ' return obj["id"]' 'def ind(name, path, until=None):' ' more = {"valid_until": until} if until else {}' ' return add("indicator", name, name=name, pattern="[" + path + " = " + Q + name + Q + "]", pattern_type="stix", valid_from="2026-09-01T00:00:00Z", **more)' 'cert = add("identity", "Northgate CERT", name="Northgate CERT", identity_class="organization")' 'office = add("identity", "Riverside office", name="Riverside office", identity_class="organization")' 'actor = add("threat-actor", "Copper Lantern", name="Copper Lantern")' 'implant = add("malware", "updater", name="updater", is_family=True)' > intel/bundle.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write lesson 4's bundle script, part 2
printf '%s\n' 'web = add("attack-pattern", "Web Protocols", name="Web Protocols", external_references=[{"source_name": "mitre-attack", "external_id": "T1071.001"}])' 'dom = ind("cdn-update.example", "domain-name:value")' 'ips = [ind("198.51.100.23", "ipv4-addr:value"), ind("203.0.113.99", "ipv4-addr:value", "2026-10-31T00:00:00Z")]' 'ua = ind("updater/1.4", "network-traffic:extensions." + Q + "http-request-ext" + Q + ".request_header." + Q + "User-Agent" + Q)' 'doc = ind("60065055603b91d13dc69c589f08730dd503f0d86f354d0b07ce3a9607814e3d", "file:hashes." + Q + "SHA-256" + Q)' 'for src, rel, dst in [[actor, "uses", implant], [actor, "targets", office], [implant, "uses", web], [dom, "indicates", implant], [ips[0], "indicates", implant], [ips[1], "indicates", implant], [ua, "indicates", implant], [doc, "indicates", actor]]:' ' add("relationship", src + rel + dst, relationship_type=rel, source_ref=src, target_ref=dst)' >> intel/bundle.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write lesson 4's bundle script, part 3
printf '%s\n' 'add("sighting", "sighting" + dom, sighting_of_ref=dom, where_sighted_refs=[office], count=5)' 'bundle = {"type": "bundle", "id": "bundle--" + str(uuid.uuid5(NS, "bundle")), "objects": objs}' 'json.dump(bundle, open("intel/bundle.json", "w"), indent=2)' 'kinds = [o["type"] for o in objs]' 'for kind in sorted(set(kinds)):' ' print(kinds.count(kind), kind)' 'print(len(objs), "objects in the bundle")' >> intel/bundle.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Build the bundle
python3 intel/bundle.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write the sharing script, part 1
printf '%s\n' 'import json, sys, uuid' 'B = json.load(open("intel/bundle.json"))' 'LABELS = ["TLP:CLEAR", "TLP:GREEN", "TLP:AMBER", "TLP:AMBER+STRICT", "TLP:RED"]' 'MAY = {"public": 0, "community": 1, "clients": 2, "org": 3, "named": 4}' 'POLICY = {"identity": 0, "threat-actor": 0, "malware": 0, "attack-pattern": 0, "indicator": 1, "sighting": 3}' 'byid = {o["id"]: o for o in B["objects"]}' 'def level(o):' ' if o["type"] == "relationship":' ' return max(level(byid[o["source_ref"]]), level(byid[o["target_ref"]]))' ' return 3 if o.get("name") == "Riverside office" else POLICY[o["type"]]' 'def name(o):' ' if o["type"] == "relationship":' ' return name(byid[o["source_ref"]])[:18] + " " + o["relationship_type"] + " " + name(byid[o["target_ref"]])[:18]' ' return o.get("name") or "sighting " + name(byid[o["sighting_of_ref"]])' 'who = sys.argv[1] if len(sys.argv) > 1 else ""' 'if who not in MAY:' ' sys.exit("Give one audience: " + " ".join(MAY))' > intel/share.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Write the sharing script, part 2
printf '%s\n' 'marks = {}' 'for at, label in enumerate(LABELS):' ' mid = "marking-definition--" + str(uuid.uuid5(uuid.NAMESPACE_URL, label))' ' marks[at] = {"type": "marking-definition", "spec_version": "2.1", "id": mid, "created": "2026-11-03T10:00:00.000Z", "name": label, "definition_type": "statement", "definition": {"statement": label + " (TLP 2.0)"}}' 'kept, used = [], set()' 'for o in B["objects"]:' ' at = level(o)' ' print(LABELS[at].ljust(17), o["type"].ljust(15), name(o)[:44].ljust(45), "kept" if at <= MAY[who] else "WITHHELD")' ' if at <= MAY[who]:' ' kept.append(dict(o, object_marking_refs=[marks[at]["id"]]))' ' used.add(at)' 'out = "intel/share-" + who + ".json"' 'json.dump({"type": "bundle", "id": B["id"], "objects": [marks[at] for at in sorted(used)] + kept}, open(out, "w"), indent=2)' 'print(len(kept), "of", len(B["objects"]), "objects kept, written to", out)' >> intel/share.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Cut the bundle for the community
python3 intel/share.py communityShown here, not run. Press Start lab to type it into your own lab’s terminal.
Cut it for your own organisation
python3 intel/share.py orgShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsA common mistake
Warning
Many people think a TLP label protects the data, like a password. It is only an agreement: nothing stops a recipient forwarding a TLP:RED email. So label honestly, share with people who keep agreements, and remove what you cannot afford to leak before you send it.
Share what helps, keep what identifies
Before sharing, sanitise: remove victim names, internal addresses and people's accounts unless the audience needs them. Here 10.20.1.15 and amira never leave the office.
A sharing community, such as a sector's information sharing group, agrees the rules in advance. Feedback from recipients, such as sightings, makes the next report better.
Try it: check a label and an audience
LABELS = ["TLP:CLEAR", "TLP:GREEN", "TLP:AMBER", "TLP:AMBER+STRICT", "TLP:RED"]
AUDIENCES = ["public", "community", "clients", "org", "named"]
label = "TLP:AMBER"
audience = "community"
ok = LABELS.index(label) <= AUDIENCES.index(audience)
print(label, "to", audience, ":", ok)
# Try TLP:GREEN to community, then TLP:RED to org.
Make a free account to save your work and track your progress.
Assignment: decide what may be shared
The labels, from least to most strict, are TLP:CLEAR, TLP:GREEN, TLP:AMBER, TLP:AMBER+STRICT and TLP:RED. The audiences, from widest to narrowest, are public, community, clients, org and named. Each label may go to the audience in the same place on its list, and to any narrower one.
may_share(label, audience) returns True or False. An unknown label or audience is never shared.
strictest(labels) returns the strictest label in the list, and TLP:CLEAR for an empty list. An unknown label counts as TLP:RED.
shareable(objects, audience): each object is a dictionary with id and labels, a list. Return the ids of the objects whose strictest label may go to the audience, in order.
def may_share(label, audience):
return True
def strictest(labels):
return "TLP:CLEAR"
def shareable(objects, audience):
return []
Make a free account to save your work and track your progress.
Exit quiz
Have a go