
Explore toml as a documentation standard for elastic detection rules, mapping query, risk score, author, and miter data to a practical ci cd ready format.
Set up your development environment by installing Visual Studio Code, Python, and essential extensions on Windows or macOS, then install packages like requests and toml.
Examine the elastic rule format in toml to identify the required fields for all rules—description, name, risk, score, severity, and type—plus the query or threshold specifics for each rule type.
Explore the elastic detection rules repository, clone and install the tools, and validate, create, and export rules using KQL and toml linting within the elastic ecosystem.
Learn to validate html documents with Tableau from the command line, install via binary releases, and run checks that report line and character errors for precise fixes.
Create an elastic HTML template from the required fields toml to streamline new alerts. Tailor lookback time and optional fields, turning it into a living document with tactics and techniques.
Write a Python script to load a toml file and validate the required alert fields. Iterate data, identify present and missing fields by type (query or threshold), and print errors.
Learn to run a validation script against multiple toml files by walking directories with os.walk, building full paths, and loading alerts for batch validation.
Create a MITRE object in python by parsing the enterprise attack json, extracting techniques and kill chain phases, and filtering data for a reusable validation script.
Learn to validate mitre data in toml by iterating over alert data, filtering for mitre attack, handling techniques, tactics, and sub techniques, and preparing two data containers for validation.
Validate MITRE data in TOML by building a MITRE map, extracting tactic, technique, and sub technique, and performing id validity, name match, and deprecation checks in an app.py script.
Convert detections from three attack scenarios into toml format, validate them with scripts, and map to mitre techniques while preparing threshold alerts in the elastic API for the next sections.
Learn to use the elastic api with Python to create, update, and delete roles and rules, and perform bulk actions. Push sample roles and custom alerts; upload scripts to GitHub.
Organize scripts into folders, log into Elastic to create and secure an api key (base64 encoded and viewable only once), and store it in a password manager.
Push a sample detection rule to Elastic using the security API with token authentication, posting to the detection engine rules endpoint and validating the result.
Develop a toml to json Python script to convert html files into elastic-ready json by iterating over rules, extracting required fields, handling data types, and escaping quotes.
Develop and test a Python script to fetch alerts by rule ID via a get request to the API, highlighting documentation gaps and fixes.
Leverage custom detections by enforcing rule IDs, validating scripts, converting HTML to JSON, and troubleshooting until all detections push correctly to Elastic.
Update custom detections by using the update_alert.py script and the put method to replace alerts, incorporating a role id in the URL and testing changes by adjusting a value.
Explore GitHub actions for automating document workflows, including HTML validation, elastic automation, metrics generation, and a main and dev branch workflow with git commands.
Learn how GitHub actions automate workflows with triggers like push, pull, and cron. Configure a simple yaml workflow, use the checkout action, and run scripts on an Ubuntu runner.
Upload detection documents and scripts to GitHub, organize folders for detections and development, replace hardcoded keys with GitHub secrets, and set up a GitHub action for HTML validation.
Create a GitHub action to validate detection documentation with validation.py and minor.py, implement error handling with exit codes, and run all detections using structured steps.
Enforce validation by protecting the main branch with status checks, ensuring HTML, miter, and detection document validations pass before merging.
Sync detections from the main branch into elastic using two GitHub actions: one ships all detections, the other updates only changed files on push, with API keys stored in secrets.
Sync updated detections to Elastic using a change files action and an updated alert script. The workflow covers branch management, push on main, and 404 handling to insert new alerts.
Explore metrics for detection engineering using Python and GitHub actions, and build three converters—HTML to CSV, Tamil to Markdown—plus a Mightor Navigator JSON data generator via GitHub actions.
This lecture shows building a toml to csv converter that outputs a csv with date, name, author, risk score, severity, and mitre data like tactic, technique, and sub technique.
Build an HTML to markdown script that outputs three markdown tables of detections by current month, last month, and two months ago, using Python date handling for GitHub rendering.
Convert a toml file into an att&ck navigator json by building a dynamic heatmap layer, counting techniques and sub-techniques, and exporting navigator.json for use in attack navigator.
Create a GitHub action to automate running metrics scripts, configure a personal access token and secrets, push results to GitHub, and add optional cron scheduling.
Learn to create status badges for GitHub actions, copy the badge markdown, and embed it in the README to monitor metrics, updates, and validation at a glance.
Explore next steps in detection engineering, including expanding atomic red team tests, enhancing automation with elastic dashboards and Power BI, and using threat intelligence to evolve detections across networks.
Welcome to the Detection Engineering Masterclass: Part 2!
Don't Purchase if you haven't gone through Part 1!
Two Part Course Overview
This course will first teach the theory behind security operations and detection engineering. We’ll then start building out our home lab using VirtualBox and Elastic’s security offering. Then we’ll run through three different attack scenarios, each more complex than the one prior. We’ll make detections off of our attacks, and learn how to document our detections. Next we’ll dive more into coding and Python by writing validation scripts and learning out to interact with Elastic through their API. Wrapping everything up, we’ll host all our detections on GitHub and sync with Elastic through our own GitHub Action automations. As a cherry on top, we’ll have a final section on how to write scripts to gather important metrics and visualizations.
This course takes students from A-Z on the detection engineering lifecycle and technical implementation of a detection engineering architecture.
While this course is marketed as entry level, any prerequisite knowledge will help in the courses learning curve. Familiarity with security operations, searching logs, security analysis, or any related skillset will be helpful (but ultimately not required).
Part Two Overview
This is part two of a two part series on Detection Engineering! This course is meant to kickstart anyone interested in security analysis, detection engineering, and security architecture.
The first part is the meat of the course, where we will go over:
Detection Engineering Theory
Setting Up our Lab
Working with Logging and our SIEM
Running Attack Scenarios to generate logs and create alerts
Learn how to use Atomic Red Team for testing
The second part deals with detection as code philosophies, which will be very Python and GitHub heavy (but don't worry! I'll walk you through everything step by step.)
By the end of this two part course, you'll have a full stack detection engineering architecture. You'll be able to:
Run offensive tests
Review the logs
Make alerts
Save alerts using a standardized template
Enforce template data through code
Programmatically push the alerts to the SIEM
Run periodic metrics off the detection data
The entire course runs ~11 or so hours in length, but should take ~20-40 hours to complete fully. All code written will be available on the course GitHub in case you'd like to skip the Python heavy sections.
Requirements
The ability to run 2-3 VMs on a local machine:
Ubuntu Linux
ParrotOS
Windows 11
Minimum Requirements
CPU Cores: 4
RAM: 8gb
Hard Drive Space: 50GB
Recommended Requirements
CPU Cores: 6+
RAM: 16GB+
Hard Drive Space: 50GB+
You can technically get by with the main host having only a couple cores and 8 gigs of RAM, but any additional resources that can be assigned to your VMs will make the process smoother.
Thanks for stopping by!