Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crypto miner policy #1061

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
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
88 changes: 42 additions & 46 deletions generic/system/ksp-prevent-crypto-miners.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KubeArmor is an open source software that enables you to protect your cloud workload at run-time.
# To learn more about KubeArmor visit:
# https://www.accuknox.com/kubearmor/
# To learn more about KubeArmor visit:
# https://www.accuknox.com/kubearmor/

apiVersion: security.kubearmor.com/v1
kind: KubeArmorPolicy
Expand All @@ -10,60 +10,56 @@ spec:
selector:
matchLabels:
app: wordpress

action: Block
process:
matchDirectories:
- dir: /tmp/
recursive: true
- dir: /tmp/
recursive: true

matchPaths:
# do not allow execution of xmrig (xmrig.com)
- execname: xmrig

# prevent execution of Dero miner
- execname: dero
- execname: dero-miner-linux-amd64
- execname: dero-wallet-cli-linux-amd64
- execname: derod-linux-amd64
# do not allow execution of xmrig (xmrig.com)
- execname: xmrig

# prevent execution of Dero miner
- execname: dero
- execname: dero-miner-linux-amd64
- execname: dero-wallet-cli-linux-amd64
- execname: derod-linux-amd64

# do not allow execution of masscan/zgrab2/nmap used for recon
- execname: zgrab2
- execname: masscan
- execname: nmap

# time sync is important for miners. typically ntpdate is used.
- execname: ntpdate

# do not allow execution of masscan/zgrab2/nmap used for recon
- execname: zgrab2
- execname: masscan
- execname: nmap

# do not allow package management tools execution
- execname: apt
- execname: apk

# time sync is important for miners. typically ntpdate is used.
- execname: ntpdate

# Do not allow overwriting system binaries
file:
matchDirectories:
- dir: /usr/local/bin/
readOnly: true
recursive: true
- dir: /sbin/
readOnly: true
recursive: true
- dir: /bin/
readOnly: true
recursive: true
- dir: /usr/bin/
readOnly: true
recursive: true
- dir: /var/local/bin/
readOnly: true
recursive: true
- dir: /boot/
readOnly: true
recursive: true
- dir: /usr/local/bin/
readOnly: true
recursive: true
- dir: /sbin/
readOnly: true
recursive: true
- dir: /bin/
readOnly: true
recursive: true
- dir: /usr/bin/
readOnly: true
recursive: true
- dir: /var/local/bin/
readOnly: true
recursive: true
- dir: /boot/
readOnly: true
recursive: true

message: cryptominer detected and blocked
severity: 10
tags:
tags:
- cryptominer
- MITRE_T1496_resource_hijacking
- MITRE