Cyber defence

Find intrusions in the force's own network traffic and logs, and stop phishing and data leaks, with a person confirming every response.

Updated CompTech Team

The force's network already records the evidence of most intrusions: authentication events, DNS lookups, proxy requests, flow logs and the OpenShift audit log. The gap is that the evidence sits in five tools, and the alert that matters looks like the thousand that do not. This lab builds a defensive path over logs the force already collects. It summarises an alert with the lines it came from, and it prepares a response a defender confirms. It is not a guide to breaking into a system, and it contains no exploit content. Offensive work is outside this platform in the same way weapons employment is, under the principles.

One store for the logs you already have

Ship the sources you operate into the cluster log store, or into Kafka and then the store, using the data pipeline:

  • Identity provider and VPN authentication, success and failure.
  • DNS and web proxy, including the destination host and the bytes transferred.
  • Flow records from the segments you are allowed to monitor.
  • OpenShift audit logs, which already describe who called which API.
  • Mail gateway verdicts: who received a message that the gateway marked suspicious.

Keep the raw event. Detections are views on top of it. A detection that stores only its own summary cannot be checked at 02:00.

Access to the store is a security role. Reading the full proxy log is as sensitive as reading the traffic. Apply the same audit — who queried which hour of logs — that the principles page requires for documents.

Detections that name their evidence

Write a small set of rules the defensive team already believes, and make each rule return the events, not a score alone. Examples that belong in a first deployment:

Rule Evidence it must show
Many authentication failures, then a success, for one account The failures, the success, the source addresses
A new binding that grants cluster-admin The audit event, the subject, the actor
A service account token used from a namespace that has never used it The two audit events
A destination host that one user sent far more data to than their baseline The proxy rows and the baseline window
A mail verdict of "suspicious" followed by a click on the proxy The verdict and the proxy line

Implement the OpenShift ones as saved queries against the audit log. Review them as code, in Git, the same way you review any other detector. A rule that pages the team every night will be muted, so tune it on a fortnight of your own logs before you route it to a phone.

oc adm node-logs --role=master --path=kube-apiserver/audit.log | tail -n 20

On a managed audit pipeline the path differs; the content you need is the same user, verb, objectRef and sourceIPs fields. Confirm the field names against a real event from your cluster before you freeze the query.

A model enters after the rule fires. It writes a short summary for the defender: what happened, which identities, which systems, what the rule thought, and the event ids. It may only state facts present in those events. This is the RAG pattern with log lines as the corpus. The summary is a draft incident note. It does not close the incident and it does not run a response.

Phishing

The mail gateway remains the control that blocks known-bad mail. The lab adds the loop around it.

  1. A user reports a message, or the gateway marks one.
  2. The defender's queue shows the sender, the recipients, the links and attachments as inert text, and whether any recipient's account then authenticated from a new address.
  3. Links are opened, if they are opened at all, in an isolated browser the defender already operates for this purpose. The platform does not fetch arbitrary links into the model context.
  4. If the defender confirms the report, they block the sender domain and reset the affected sessions in the identity system. Those two actions are button presses in those systems, by the defender, and both are logged.

The model may group ten reports that share a sender or a link host so the defender handles them once. It does not decide that a message is safe to click.

Data leaks

Documents that carry the access labels from the records lab should not leave by a side door. Watch the proxy and the mail gateway for transfers of files whose labels are above the channel's allowed clearance, and for bulk downloads of the archive by one identity. Raise a flag with the file ids and the destination. A defender confirms before any account is disabled. False positives on this rule are career-damaging, so start with a report the security officer reads each morning, and only then consider paging.

A drill on your own audit log

Use the cluster you administer. Do not point this at a network you do not operate.

  1. Capture an hour of API audit events to a file or the log store.
  2. As a test user, create and then remove a ClusterRoleBinding that grants cluster-admin. You are reproducing a defender's detection, on a lab cluster, with an action you are allowed to take.
  3. The rule returns that audit event: actor, subject, verb, time. The model writes a five-line note that cites the event id and adds no other fact.
  4. A defender marks the note expected (it was the drill) or investigate. The mark is stored. Nothing in the pipeline deletes the binding. You delete it yourself, and that delete is another audit event.
  5. Run the negative test the next day: the same rule on a quiet hour returns no note. A rule that fires on a quiet hour is not ready to page anyone.

Phishing and leak flags stay on the morning report until a fortnight of your own mail and proxy data shows the defender agrees with them. Promotion from report to page is a decision you record, with the rule version.

The summary prompt is the RAG prompt: only the events in the request, cite the ids, say when the events do not show what the question assumes. A summary that invents an attacker technique you did not log is a failed summary.

Response, after a person agrees

The pipeline stops at a note and a recommendation. The defender acts in the existing tools.

  • Disable a session or reset a credential in the identity provider. Log it.
  • Block a sender domain on the mail gateway. Log it.
  • If a labelled file moved past its allowed channel, follow the data-handling procedure the security officer already has. The model does not delete the file.
  • Record the rule version and the event ids on the incident. A later review should be able to rerun the query.

Nothing in this lab scans a network you do not operate, sends a payload, or exploits a finding. A detection that only works if you attack the cluster to demonstrate it is the wrong detection for this page. Use the drill on the audit log instead.

What's next

  1. Principles and safeguards: why the log of queries is itself a protected system.
  2. Identity Server: the directory that records the suspicious sign-in and the session the defender revokes.
  3. API Manager: rate limits and subscriptions on the APIs the detectors call.