Last active
March 22, 2024 10:20
-
-
Save nyrahul/871bba33b9cbdee901175fe65091c101 to your computer and use it in GitHub Desktop.
KubeArmor policy template for preventing crypto miners execution
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
apiVersion: security.kubearmor.com/v1 | |
kind: KubeArmorPolicy | |
metadata: | |
name: prevent-crypto-miners | |
spec: | |
selector: | |
matchLabels: | |
app: wordpress | |
action: Block | |
process: | |
matchDirectories: | |
- 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 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 | |
message: cryptominer detected and blocked | |
severity: 10 | |
tags: | |
- cryptominer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.githubusercontent.com/achrefbensaad/98d1512a2860bc54e393d9a9c8d00abc/raw/4c64ce76a42899b3e3b6ca3a7b42d4dff842009f/xmrig-downloader.php