[FR] [DAC] Initial Yaml Support#5821
Merged
eric-forte-elastic merged 14 commits intomainfrom Apr 10, 2026
Merged
Conversation
Contributor
Enhancement - GuidelinesThese guidelines serve as a reminder set of considerations when addressing adding a feature to the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
Contributor
Author
|
Based on testing done by Marc-Antoine Leclercq this PR is ready for review. The yaml format output is compatible for use in custom tooling around https://github.com/elastic/terraform-provider-elasticstack. |
Mikaayenson
approved these changes
Apr 9, 2026
Contributor
Mikaayenson
left a comment
There was a problem hiding this comment.
a couple nits. otherwise lgtm
CLI Testing
detection_dev) ➜ detection-rules git:(yaml_support) ✗ uv run python -m detection_rules export-rules-from-repo -f rules/linux/defense_evasion_base64_decoding_activity.toml --save-yaml-dir ./mikas_folder/yaml_export_test && ls -la ./mikas_folder/yaml_export_test && wc -c ./mikas_folder/yaml_export_test/*.yaml && head -n 30 ./mikas_folder/yaml_export_test/unusual_base64_encoding_decoding_activity.yaml
█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄ ▄ █▀▀▄ ▄ ▄ ▄ ▄▄▄ ▄▄▄
█ █ █▄▄ █ █▄▄ █ █ █ █ █ █▀▄ █ █▄▄▀ █ █ █ █▄▄ █▄▄
█▄▄▀ █▄▄ █ █▄▄ █▄▄ █ ▄█▄ █▄█ █ ▀▄█ █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█
WARNING: Rule path does not match required path: defense_evasion_base64_decoding_activity.toml != defense_evasion_unusual_base64_encoding_decoding_activity.toml
Exported 1 rules into mikas_folder/yaml_export_test
total 24
drwxr-xr-x@ 3 stryker staff 96 Apr 9 13:11 .
drwxr-xr-x 11 stryker staff 352 Apr 9 13:11 ..
-rw-r--r--@ 1 stryker staff 11355 Apr 9 13:11 unusual_base64_encoding_decoding_activity.yaml
11355 ./mikas_folder/yaml_export_test/unusual_base64_encoding_decoding_activity.yaml
author:
- Elastic
description: This rule leverages ESQL to detect unusual base64 encoding/decoding activity
on Linux systems. Attackers may use base64 encoding/decoding to obfuscate data,
such as command and control traffic or payloads, to evade detection by host- or
network-based security controls. ESQL rules have limited fields available in its
alert documents. Make sure to review the original documents to aid in the investigation
of this alert.
from: now-61m
interval: 1h
language: esql
license: Elastic License v2
name: Unusual Base64 Encoding/Decoding Activity
note: '## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been
reviewed to improve its accuracy and relevance. While every effort has been made
to ensure its quality, we recommend validating the content and adapting it to suit
your specific environment and operational needs.
### Investigating Unusual Base64 Encoding/Decoding Activity
Base64 encoding is a method to convert binary data into ASCII text, often used for
data transmission. Adversaries exploit this to obfuscate malicious payloads or commands,
bypassing security controls. The detection rule identifies suspicious Base64 activity
on Linux by monitoring specific processes and command patterns, flagging anomalies
(detection_dev) ➜ detection-rules git:(yaml_support) ✗
Contributor
Author
|
Additional testing for new flag changes: |
shashank-elastic
approved these changes
Apr 10, 2026
Contributor
shashank-elastic
left a comment
There was a problem hiding this comment.
Post code optimisations, this looks much cleaner 👍
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):
Summary - What I changed
Exploring adding yaml output support when exporting rules either from repo or form Kibana. This may be useful in supporting Terraform as it cannot directly pull detection contents from a stack. In a DaC implementation, Terraform will have a major gap in this way. However, adding this means that Terraform can be used in full CI/CD sync workflows enabling customers/community members who use Terraform to also use it for bidirectional DaC.
How To Test
Test Example Commands:
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist