Lion Cipher Lab

Detect log anomalies with an autoencoder

Why it matters

A huge amount of defensive work is really one question: is this thing NORMAL, or is it weird enough to look at? You almost never have a clean list of every attack you might face -- attackers invent new ones -- but you usually have a mountain of examples of normal: normal logins, normal network connections, normal process behavior. That asymmetry is the opening. If you can teach a model what normal looks like, then anything it struggles to recognize is, by definition, unusual and worth a human's attention. An AUTOENCODER is a neural network built exactly for that job. You train it only on…

What you'll learn

Steps in this lab

  1. The problem: you can describe normal, but you cannot list every attack
  2. The words you need: neural network, autoencoder, encoder, decoder, latent space, reconstruction error
  3. Install TensorFlow/Keras and the helpers
  4. Generate the data: mostly-normal connections plus a few planted attacks
  5. Split normal-only, and scale on the normal rows alone
  6. Build the tiny autoencoder
  7. Train on normal, score every connection, and set a threshold
  8. Read the plot and score it: precision and recall
  9. The honest limits: mostly-normal data, a tuned threshold, and unusual is not malicious
  10. What you can now do that most people can't, and where to go next

Open the full interactive lab →