Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions examples/policies/lotl_prevention_policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# lotl_prevention_policy.yaml
metadata:
name: "Blue Team LotL Shield"
version: "1.1"
description: "Detects and blocks Living off the Land (LotL) commands and unauthorized sensitive file access."

rules:
- id: "block-unauthorized-download-pipe"
action: "shell_exec"
condition:
parameter: "command"
# Improved Regex to reduce false positives and catch obfuscation
operator: "regex_match"
value: "(curl|wget|powershell)\\s+.*(-s|-fsSL|-enc|DownloadString).*\\|.*(bash|sh|python|iex)"
effect: "DENY"
message: "Security Violation: Potential remote code execution via piped shell script detected."

- id: "block-sensitive-system-read"
action: "file_read"
condition:
parameter: "path"
# Expanded list based on Blue Team best practices
operator: "in"
value: [
"/etc/shadow", "/etc/passwd", "/etc/hostname",
"~/.ssh/id_rsa", "~/.aws/credentials",
"/var/run/docker.sock", "/etc/kubernetes/admin.conf"
]
effect: "DENY"
message: "Security Violation: Unauthorized access to critical system credentials or configuration."
Loading