[New Rules] Megalodon GitHub Actions supply chain backdoor — Linux endpoint detection (May 2026)#6218
Open
StuLast wants to merge 2 commits into
Open
Conversation
…(May 2026) Five rules detecting the Megalodon campaign that backdoored 5,561 GitHub repositories via stolen PATs pushing malicious workflow files (2026-05-18). GitHub integration rules (logs-github.audit-*): - Megalodon - Known Malicious Workflow Filename Pushed to Repository [critical] - Megalodon - Direct Push to Workflow Directory Without Pull Request [high] - Megalodon - Push to Workflow Directory Requires Content Review for Dangerous Permissions [medium] Linux endpoint rules (logs-endpoint.events.*): - Megalodon - Outbound Connection to Known C2 Server from CI Runner [critical] - Megalodon - Base64-Decoded Shell Execution on CI Runner [high] Intelligence source: SafeDep.io, "Megalodon: Mass GitHub Repository Backdooring via CI Workflows" (2026). Detection rule logic by Spyced Concepts Ltd. (https://spycedconcepts.co.uk). Full rule set with YARA rules and test harness: https://github.com/Spyced-Concepts/detection-rules Note: IoC data (C2 IP 216.126.225.129:8443, workflow filenames, author identities) sourced from SafeDep.io original research, credited in rule references.
Remove three GitHub audit log rules — github.head_commit.added/modified and github.pull_request.id are not available in the logs-github.audit-* integration. File-path-based detection from audit log events is not currently possible. Remaining rules submitted: - rules/linux/command_and_control_megalodon_c2_outbound.toml [critical] - rules/linux/execution_megalodon_base64_exec_ci_runner.toml [high] The GitHub audit log rules are retained in the companion detection-rules repo with notes on the field limitation. An ECS/integration enhancement request is needed to add head_commit file path fields to the GitHub audit log integration.
Author
|
Could a maintainer please add the Rule: New label? I don't have write access to labels as an external contributor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Issue link(s): Closes #6217
Two new Linux endpoint detection rules for the Megalodon GitHub Actions supply chain backdoor
campaign (May 2026), which compromised 5,561 GitHub repositories via stolen Personal Access
Tokens pushing malicious workflow files.
Rules added:
rules/linux/command_and_control_megalodon_c2_outbound.tomlrules/linux/execution_megalodon_base64_exec_ci_runner.tomlIntelligence source: SafeDep.io, "Megalodon: Mass GitHub Repository Backdooring via CI
Workflows" (2026) — https://safedep.io/megalodon-mass-github-repo-backdooring-ci-workflows/
SafeDep.io are the source of all IoC data (C2 IP, workflow filenames). Detection rule logic is
original work by Spyced Concepts Ltd. SafeDep.io have been notified and credited in all rule
references.
Note on AI assistance: Detection rule logic was developed with AI assistance (Claude Sonnet
4.6). IoC intelligence is sourced entirely from SafeDep.io's original research.
Full rule set (YARA + Sigma + test harness with FP/FN scoring):
https://github.com/Spyced-Concepts/detection-rules
Why only Linux endpoint rules: Three GitHub audit log rules were drafted but excluded.
github.head_commit.added,github.head_commit.modified, andgithub.pull_request.idare notpresent in the
logs-github.audit-*field mapping, making file-path-based detection impossiblefrom audit log events. Those rules are retained in the companion repo pending an ECS/integration
enhancement to expose commit-level file path data.
How To Test
C2 outbound rule — query to verify in your stack:
host.os.type:linux and event.category:network and
destination.ip:"216.126.225.129" and destination.port:8443
Base64 exec rule — query to verify in your stack:
host.os.type:linux and event.category:process and
process.command_line:(base64 and ("-d" or "--decode")) and
process.command_line:("| bash" or "| sh" or "|bash" or "|sh") and
not process.parent.executable:(apt or dpkg or snap)
Both rules use standard ECS fields only (
destination.ip,destination.port,process.command_line,process.parent.executable). No custom field mappings required.Checklist
Rule: NewContributor checklist