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

Xmr mining all options #388

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified .github/ISSUE_TEMPLATE/bug_report.md
100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/feature_request.md
100644 → 100755
Empty file.
Empty file modified .github/PULL_REQUEST_TEMPLATE.md
100644 → 100755
Empty file.
Empty file modified .github/workflows/component-tests.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/pr-created.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/pr-merged.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/scorecard.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified MAINTAINERS.md
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified SECURITY-INSIGHTS.yml
100644 → 100755
Empty file.
Empty file modified SECURITY.md
100644 → 100755
Empty file.
67 changes: 67 additions & 0 deletions alertbindings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: kubescape.io/v1
kind: RuntimeRuleAlertBinding
metadata:
annotations:
meta.helm.sh/release-name: kubescape
meta.helm.sh/release-namespace: kubescape
creationTimestamp: "2024-11-26T11:07:08Z"
generation: 1
labels:
app: node-agent
app.kubernetes.io/component: node-agent
app.kubernetes.io/instance: kubescape
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kubescape-operator
app.kubernetes.io/version: 1.23.2
helm.sh/chart: kubescape-operator-1.23.2
kubescape.io/ignore: "true"
tier: ks-control-plane
name: all-rules-all-pods
resourceVersion: "516"
uid: 78bc578c-6374-4641-adc3-a5f067d5a748
spec:
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values:
- kubescape
- kube-system
- kube-public
- kube-node-lease
- kubeconfig
- gmp-system
- gmp-public
rules:
- ruleName: Unexpected process launched
- parameters:
ignoreMounts: true
ignorePrefixes:
- /proc
- /run/secrets/kubernetes.io/serviceaccount
- /var/run/secrets/kubernetes.io/serviceaccount
- /tmp
ruleName: Unexpected file access
- ruleName: Unexpected system call
- ruleName: Unexpected capability used
- ruleName: Unexpected domain request
- ruleName: Unexpected Service Account Token Access
- ruleName: Kubernetes Client Executed
- ruleName: Exec from malicious source
- ruleName: Kernel Module Load
- ruleName: Exec Binary Not In Base Image
- ruleName: Malicious SSH Connection
- ruleName: Fileless Execution
- ruleName: Exec from mount
- ruleName: Crypto Mining Related Port Communication
- ruleName: Crypto Mining Domain Communication
- ruleName: Read Environment Variables from procfs
- ruleName: eBPF Program Load
- ruleName: Symlink Created Over Sensitive File
- ruleName: Unexpected Sensitive File Access
- ruleName: Hardlink Created Over Sensitive File
- ruleName: Exec to pod
- ruleName: Port forward
- ruleName: Unexpected Egress Network Traffic
- ruleName: Malicious Ptrace Usage
- ruleName: Crypto Miner detected
Empty file modified build/Dockerfile
100644 → 100755
Empty file.
Empty file modified build/README.md
100644 → 100755
Empty file.
Empty file modified clamav/Dockerfile
100644 → 100755
Empty file.
Empty file modified clamav/Makefile
100644 → 100755
Empty file.
Empty file modified clamav/README.md
100644 → 100755
Empty file.
Empty file modified configuration/clusterData.json
100644 → 100755
Empty file.
Empty file modified configuration/config.json
100644 → 100755
Empty file.
Empty file modified demo/README.md
100644 → 100755
Empty file.
Empty file modified demo/assets/alertmanager.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/fileless-malware.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/kubectl.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/ls.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/malwares.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/ping.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/pods.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/service-account-token.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/assets/webapp.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/fileless_exec/kubernetes-manifest.yaml
100644 → 100755
Empty file.
Empty file modified demo/fileless_exec/kubernetes-manifests.yaml
100644 → 100755
Empty file.
Empty file modified demo/general_attack/commands.md
100644 → 100755
Empty file.
Empty file modified demo/general_attack/webapp/Containerfile
100644 → 100755
Empty file.
Empty file modified demo/general_attack/webapp/index.html
100644 → 100755
Empty file.
Empty file modified demo/general_attack/webapp/ping-app.yaml
100644 → 100755
Empty file.
Empty file modified demo/general_attack/webapp/ping.php
100644 → 100755
Empty file.
Empty file modified demo/malwares_image/Containerfile
100644 → 100755
Empty file.
Empty file modified demo/miner/Containerfile
100644 → 100755
Empty file.
Empty file modified demo/miner/miner-pod.yaml
100644 → 100755
Empty file.
Empty file modified go.mod
100644 → 100755
Empty file.
2 changes: 0 additions & 2 deletions go.sum
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,6 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/moby v27.0.2+incompatible h1:iYtGEjFi9lkX2m/Bop2H/peXzx3VtzmPlE9r0JHyH0s=
github.com/moby/moby v27.0.2+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc=
github.com/moby/moby v27.1.2+incompatible h1:vqOs4c7YktTdEBnPQNm0Q+M+IOuxxTCkrYJLBAVsEHQ=
github.com/moby/moby v27.1.2+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc=
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
Expand Down
Binary file added go1.23.0.linux-amd64.tar.gz
Binary file not shown.
Empty file modified internal/validator/ebpf/verifier.go
100644 → 100755
Empty file.
Empty file modified internal/validator/validator.go
100644 → 100755
Empty file.
Empty file modified internal/validator/validator_test.go
100644 → 100755
Empty file.
Empty file modified main.go
100644 → 100755
Empty file.
Empty file modified mocks/readfiles.go
100644 → 100755
Empty file.
Empty file modified mocks/readfiles_test.go
100644 → 100755
Empty file.
Empty file modified mocks/testdata/collection_applicationactivities.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/collection_applicationprofiles.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/collection_deploy.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/collection_networkneighborhood.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/collection_pod.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/collection_rs.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/kubevuln_seccomp_config.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_applicationactivities.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_applicationprofiles.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_deploy.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_networkneighborhood.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_pod.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_rs.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_seccomp_config.json
100644 → 100755
Empty file.
Empty file modified mocks/testdata/nginx_seccompprofiles.json
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified pkg/applicationprofilemanager/v1/applicationprofile_manager.go
100644 → 100755
Empty file.
Empty file.
Empty file modified pkg/config/config.go
100644 → 100755
Empty file.
Empty file modified pkg/config/config_test.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/container_watcher_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/container_watcher_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/capabilities.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/common.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/container_watcher.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/container_watcher_private.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/container_watcher_private_test.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/dns.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/exec.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/hardlink.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/ig_k8sclient.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/network.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/open.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/open_test.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/randomx.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/ssh.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/symlink.go
100644 → 100755
Empty file.
Empty file modified pkg/containerwatcher/v1/syscall.go
100644 → 100755
Empty file.
Empty file modified pkg/dnsmanager/dns_manager.go
100644 → 100755
Empty file.
Empty file modified pkg/dnsmanager/dns_manager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/dnsmanager/dns_manager_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/dnsmanager/dns_manager_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/tracer/bpf/hardlink.bpf.c
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/tracer/bpf/hardlink.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/tracer/gadget.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/tracer/hardlink_bpfel.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/tracer/hardlink_bpfel.o
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/tracer/tracer.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/hardlink/types/types.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/tracer/bpf/randomx.bpf.c
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/tracer/bpf/randomx.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/tracer/gadget.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/tracer/randomx_bpf.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/tracer/randomx_bpf.o
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/tracer/tracer.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/randomx/types/types.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/ssh/tracer/bpf/ssh.bpf.c
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/ssh/tracer/bpf/ssh.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/ssh/tracer/ssh_bpfel.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/ssh/tracer/ssh_bpfel.o
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/ssh/tracer/tracer.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/ssh/types/types.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/bpf/symlink.bpf.c
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/bpf/symlink.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/gadget.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/symlink_bpfel.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/symlink_bpfel.o
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/test/program.c
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/tracer/tracer.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/gadgets/symlink/types/types.go
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/amd64/vmlinux.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/arm64/vmlinux.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/buffer.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/filesystem.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/macros.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/mntns.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/mntns_filter.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/sockets-map.h
100644 → 100755
Empty file.
Empty file modified pkg/ebpf/include/types.h
100644 → 100755
Empty file.
Empty file modified pkg/exporters/README.md
100644 → 100755
Empty file.
Empty file modified pkg/exporters/alert_manager.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/alert_manager_test.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/csv_exporter.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/csv_exporter_test.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/exporter.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/exporters_bus.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/http_exporter.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/http_exporter_test.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/stdout_exporter.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/stdout_exporter_test.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/syslog_exporter.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/syslog_exporter_test.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/utils.go
100644 → 100755
Empty file.
Empty file modified pkg/exporters/utils_test.go
100644 → 100755
Empty file.
Empty file modified pkg/filehandler/filehandler_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/filehandler/v1/filehandler_test.go
100644 → 100755
Empty file.
Empty file modified pkg/filehandler/v1/inmemory.go
100644 → 100755
Empty file.
Empty file modified pkg/healthmanager/health_manager.go
100644 → 100755
Empty file.
Empty file modified pkg/k8sclient/k8sclient_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/k8sclient/k8sclient_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/malware_manager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/malwaremanager_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/v1/clamav/clamav.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/v1/clamav/exec.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/v1/clamav/open.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/v1/malware_manager.go
100644 → 100755
Empty file.
Empty file modified pkg/malwaremanager/v1/types/malwareresult.go
100644 → 100755
Empty file.
Empty file modified pkg/metricsmanager/metrics_manager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/metricsmanager/metrics_manager_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/metricsmanager/prometheus/prometheus.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/network_event.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/network_event_test.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/network_manager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/network_manager_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/network_neighbors.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/network_neighbors_test.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/testdata/cronjob.json
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/testdata/daemonset.json
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/testdata/deployment.json
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/testdata/pod.json
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/testdata/testdata.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/v2/network_manager.go
100644 → 100755
Empty file.
Empty file modified pkg/networkmanager/v2/network_manager_test.go
100644 → 100755
Empty file.
Empty file modified pkg/nodeprofilemanager/nodeprofile_manager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/nodeprofilemanager/nodeprofile_manager_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/nodeprofilemanager/v1/nodeprofile_manager.go
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified pkg/objectcache/applicationprofilecache_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/helpers.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/helpers_test.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/k8scache/k8scache.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/k8scache/k8scache_test.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/k8scache_interface.go
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified pkg/objectcache/networkneighborhoodcache_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/objectcache_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/v1/objectcache.go
100644 → 100755
Empty file.
Empty file modified pkg/objectcache/v1/objectcache_test.go
100644 → 100755
Empty file.
Empty file modified pkg/relevancymanager/relevancy_manager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/relevancymanager/relevancy_manager_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/relevancymanager/v1/relevancy_manager.go
100644 → 100755
Empty file.
Empty file modified pkg/relevancymanager/v1/relevancy_manager_test.go
100644 → 100755
Empty file.
Empty file modified pkg/relevancymanager/v1/testdata/nginx-syft-crd.json
100644 → 100755
Empty file.
Empty file modified pkg/relevancymanager/v1/testdata/nginx-syft-filtered.json
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/README.md
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/cache/cache.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/cache/cache_test.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/cache/helpers.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/cache/helpers_test.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/notifier.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/rulebindingmanager_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/rulebindingmanager_mock.go
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified pkg/rulebindingmanager/types/api.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/types/v1/README.md
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/types/v1/api.go
100644 → 100755
Empty file.
Empty file modified pkg/rulebindingmanager/types/v1/types.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/ruleengine_interface.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/ruleengine_mock.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/types/types.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/README.md
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/_factory_test.go
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions pkg/ruleengine/v1/factory.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func NewRuleCreator() *RuleCreatorImpl {
R1010SymlinkCreatedOverSensitiveFileRuleDescriptor,
R1011LdPreloadHookRuleDescriptor,
R1012HardlinkCreatedOverSensitiveFileRuleDescriptor,
R1013CryptoMiningFilesAccessRuleDescriptor,
R1014CryptoMinerDetectedRuleDescriptor,
},
}
}
Expand Down
Empty file modified pkg/ruleengine/v1/failureobj.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/helpers.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/mock.go
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions pkg/ruleengine/v1/r0001_unexpected_process_launched.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func (rule *R0001UnexpectedProcessLaunched) generatePatchCommand(event *tracerex
}

func (rule *R0001UnexpectedProcessLaunched) ProcessEvent(eventType utils.EventType, event interface{}, objectCache objectcache.ObjectCache) ruleengine.RuleFailure {

if eventType != utils.ExecveEventType {
return nil
}
Expand Down
Empty file modified pkg/ruleengine/v1/r0001_unexpected_process_launched_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0002_unexpected_file_access.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0002_unexpected_file_access_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0003_unexpected_system_call.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0003_unexpected_system_call_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0004_unexpected_capability_used.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0004_unexpected_capability_used_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0005_unexpected_domain_request.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0005_unexpected_domain_request_test.go
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified pkg/ruleengine/v1/r0007_kubernetes_client_executed.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0007_kubernetes_client_executed_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0008_read_env_variables_procfs.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0008_read_env_variables_procfs_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0009_ebpf_program_load.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0009_ebpf_program_load_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r0010_unexpected_sensitive_file_access.go
100644 → 100755
Empty file.
Empty file.
Empty file modified pkg/ruleengine/v1/r1000_exec_from_malicious_source.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1000_exec_from_malicious_source_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1001_exec_binary_not_in_base_image.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1001_exec_binary_not_in_base_image_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1002_load_kernel_module.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1002_load_kernel_module_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1003_malicious_ssh_connection.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1003_malicious_ssh_connection_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1004_exec_from_mount.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1004_exec_from_mount_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1005_fileless_execution.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1005_fileless_execution_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1006_unshare_system_call.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1006_unshare_system_call_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1007_xmr_crypto_mining.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1007_xmr_crypto_mining_test.go
100644 → 100755
Empty file.
112 changes: 3 additions & 109 deletions ...leengine/v1/r1008_crypto_mining_domain.go → ...eengine/v1/r1008_crypto_mining_domains.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,114 +17,6 @@ const (
R1008Name = "Crypto Mining Domain Communication"
)

var commonlyUsedCryptoMinersDomains = []string{
"2cryptocalc.com.",
"2miners.com.",
"antpool.com.",
"asia1.ethpool.org.",
"bohemianpool.com.",
"botbox.dev.",
"btm.antpool.com.",
"c3pool.com.",
"c4pool.org.",
"ca.minexmr.com.",
"cn.stratum.slushpool.com.",
"dash.antpool.com.",
"data.miningpoolstats.stream.",
"de.minexmr.com.",
"eth-ar.dwarfpool.com.",
"eth-asia.dwarfpool.com.",
"eth-asia1.nanopool.org.",
"eth-au.dwarfpool.com.",
"eth-au1.nanopool.org.",
"eth-br.dwarfpool.com.",
"eth-cn.dwarfpool.com.",
"eth-cn2.dwarfpool.com.",
"eth-eu.dwarfpool.com.",
"eth-eu1.nanopool.org.",
"eth-eu2.nanopool.org.",
"eth-hk.dwarfpool.com.",
"eth-jp1.nanopool.org.",
"eth-ru.dwarfpool.com.",
"eth-ru2.dwarfpool.com.",
"eth-sg.dwarfpool.com.",
"eth-us-east1.nanopool.org.",
"eth-us-west1.nanopool.org.",
"eth-us.dwarfpool.com.",
"eth-us2.dwarfpool.com.",
"eth.antpool.com.",
"eu.stratum.slushpool.com.",
"eu1.ethermine.org.",
"eu1.ethpool.org.",
"fastpool.xyz.",
"fr.minexmr.com.",
"kriptokyng.com.",
"mine.moneropool.com.",
"mine.xmrpool.net.",
"miningmadness.com.",
"monero.cedric-crispin.com.",
"monero.crypto-pool.fr.",
"monero.fairhash.org.",
"monero.hashvault.pro.",
"monero.herominers.com.",
"monerod.org.",
"monerohash.com.",
"moneroocean.stream.",
"monerop.com.",
"multi-pools.com.",
"p2pool.io.",
"pool.kryptex.com.",
"pool.minexmr.com.",
"pool.monero.hashvault.pro.",
"pool.rplant.xyz.",
"pool.supportxmr.com.",
"pool.xmr.pt.",
"prohashing.com.",
"rx.unmineable.com.",
"sg.minexmr.com.",
"sg.stratum.slushpool.com.",
"skypool.org.",
"solo-xmr.2miners.com.",
"ss.antpool.com.",
"stratum-btm.antpool.com.",
"stratum-dash.antpool.com.",
"stratum-eth.antpool.com.",
"stratum-ltc.antpool.com.",
"stratum-xmc.antpool.com.",
"stratum-zec.antpool.com.",
"stratum.antpool.com.",
"supportxmr.com.",
"trustpool.cc.",
"us-east.stratum.slushpool.com.",
"us1.ethermine.org.",
"us1.ethpool.org.",
"us2.ethermine.org.",
"us2.ethpool.org.",
"web.xmrpool.eu.",
"www.domajorpool.com.",
"www.dxpool.com.",
"www.mining-dutch.nl.",
"xmc.antpool.com.",
"xmr-asia1.nanopool.org.",
"xmr-au1.nanopool.org.",
"xmr-eu1.nanopool.org.",
"xmr-eu2.nanopool.org.",
"xmr-jp1.nanopool.org.",
"xmr-us-east1.nanopool.org.",
"xmr-us-west1.nanopool.org.",
"xmr.2miners.com.",
"xmr.crypto-pool.fr.",
"xmr.gntl.uk.",
"xmr.nanopool.org.",
"xmr.pool-pay.com.",
"xmr.pool.minergate.com.",
"xmr.solopool.org.",
"xmr.volt-mine.com.",
"xmr.zeropool.io.",
"zec.antpool.com.",
"zergpool.com.",
}

var R1008CryptoMiningDomainCommunicationRuleDescriptor = RuleDescriptor{
ID: R1008ID,
Name: R1008Name,
Expand Down Expand Up @@ -163,12 +55,14 @@ func (rule *R1008CryptoMiningDomainCommunication) DeleteRule() {
}

func (rule *R1008CryptoMiningDomainCommunication) ProcessEvent(eventType utils.EventType, event interface{}, _ objectcache.ObjectCache) ruleengine.RuleFailure {

if eventType != utils.DnsEventType {
return nil
}

if dnsEvent, ok := event.(*tracerdnstype.Event); ok {
if slices.Contains(commonlyUsedCryptoMinersDomains, dnsEvent.DNSName) {

if slices.Contains(utils.CommonlyUsedCryptoMinersDomains, dnsEvent.DNSName) {
ruleFailure := GenericRuleFailure{
BaseRuntimeAlert: apitypes.BaseRuntimeAlert{
AlertName: rule.Name(),
Expand Down
File renamed without changes.
Empty file modified pkg/ruleengine/v1/r1009_crypto_mining_port.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1009_crypto_mining_port_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1010_symlink_created_over_sensitive_file.go
100644 → 100755
Empty file.
Empty file.
Empty file modified pkg/ruleengine/v1/r1011_ld_preload_hook.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1011_ld_preload_hook_test.go
100644 → 100755
Empty file.
Empty file modified pkg/ruleengine/v1/r1012_hardlink_created_over_sensitive_file.go
100644 → 100755
Empty file.
Empty file.
103 changes: 103 additions & 0 deletions pkg/ruleengine/v1/r1013_crypto_mining_files.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package ruleengine

import (
"fmt"
"strings"
"slices"

traceropentype "github.com/inspektor-gadget/inspektor-gadget/pkg/gadgets/trace/open/types"
"github.com/kubescape/node-agent/pkg/objectcache"
"github.com/kubescape/node-agent/pkg/ruleengine"
"github.com/kubescape/node-agent/pkg/utils"

apitypes "github.com/armosec/armoapi-go/armotypes"
)

const (
R1013ID = "R1013"
R1013Name = "Crypto Mining files access"
)

var R1013CryptoMiningFilesAccessRuleDescriptor = RuleDescriptor{
ID: R1013ID,
Name: R1013Name,
Description: "Detecting Crypto miners communication by files access",
Tags: []string{"crypto", "miners", "malicious", "whitelisted"},
Priority: RulePriorityHigh,
Requirements: &RuleRequirements{
EventTypes: []utils.EventType{
utils.OpenEventType,
},
},
RuleCreationFunc: func() ruleengine.RuleEvaluator {
return CreateRuleR1013CryptoMiningFilesAccess()
},
}
var _ ruleengine.RuleEvaluator = (*R1013CryptoMiningFilesAccess)(nil)

type R1013CryptoMiningFilesAccess struct {
BaseRule
}

func CreateRuleR1013CryptoMiningFilesAccess() *R1013CryptoMiningFilesAccess {
return &R1013CryptoMiningFilesAccess{}
}
func (rule *R1013CryptoMiningFilesAccess) Name() string {
return R1013Name
}

func (rule *R1013CryptoMiningFilesAccess) ID() string {
return R1013ID
}

func (rule *R1013CryptoMiningFilesAccess) DeleteRule() {
}

func (rule *R1013CryptoMiningFilesAccess) ProcessEvent(eventType utils.EventType, event interface{}, objCache objectcache.ObjectCache) ruleengine.RuleFailure {
if eventType != utils.OpenEventType {
return nil
}

openEvent, ok := event.(*traceropentype.Event)
if !ok {
return nil
}

if slices.Contains(utils.CryptoMiningFilesAccessPathsPrefix, openEvent.FullPath) {

ruleFailure := GenericRuleFailure{
BaseRuntimeAlert: apitypes.BaseRuntimeAlert{
AlertName: rule.Name(),
InfectedPID: openEvent.Pid,
FixSuggestions: "If this is a legitimate action, please consider removing this workload from the binding of this rule.",
Severity: R1013CryptoMiningFilesAccessRuleDescriptor.Priority,
},
RuntimeProcessDetails: apitypes.ProcessTree{
ProcessTree: apitypes.Process{
Comm: openEvent.Comm,
Gid: &openEvent.Gid,
PID: openEvent.Pid,
Uid: &openEvent.Uid,
},
ContainerID: openEvent.Runtime.ContainerID,
},
TriggerEvent: openEvent.Event,
RuleAlert: apitypes.RuleAlert{
RuleDescription: fmt.Sprintf("Unexpected access to crypto mining-related file: %s with flags: %s in: %s", openEvent.FullPath, strings.Join(openEvent.Flags, ","), openEvent.GetContainer()),
},
RuntimeAlertK8sDetails: apitypes.RuntimeAlertK8sDetails{
PodName: openEvent.GetPod(),
},
RuleID: rule.ID(),
}

return &ruleFailure
}
return nil
}

func (rule *R1013CryptoMiningFilesAccess) Requirements() ruleengine.RuleSpec {
return &RuleRequirements{
EventTypes: R1013CryptoMiningFilesAccessRuleDescriptor.Requirements.RequiredEventTypes(),
}
}
68 changes: 68 additions & 0 deletions pkg/ruleengine/v1/r1013_crypto_mining_files_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package ruleengine

import (
"testing"

"github.com/kubescape/node-agent/pkg/utils"

traceropentype "github.com/inspektor-gadget/inspektor-gadget/pkg/gadgets/trace/open/types"
"github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1"

eventtypes "github.com/inspektor-gadget/inspektor-gadget/pkg/types"
)

func TestR1013UnexpectedServiceAccountTokenMount(t *testing.T) {
// Create a new rule
r := CreateRuleR1013CryptoMiningFilesAccess()
// Assert r is not nil
if r == nil {
t.Errorf("Expected r to not be nil")
}

// Create a file access event
e := &traceropentype.Event{
Event: eventtypes.Event{
CommonData: eventtypes.CommonData{
K8s: eventtypes.K8sMetadata{
BasicK8sMetadata: eventtypes.BasicK8sMetadata{
ContainerName: "test",
},
},
},
},
Path: "/test",
FullPath: "/test",
Flags: []string{"O_RDONLY"},
}

// Test with nil appProfileAccess
ruleResult := r.ProcessEvent(utils.OpenEventType, e, &RuleObjectCacheMock{})
if ruleResult != nil {
t.Errorf("Expected ruleResult to not be nil since no appProfile")
return
}

// Test with whitelisted file
e.FullPath = "/proc/meminfo/asdasd"
objCache := RuleObjectCacheMock{}
profile := objCache.ApplicationProfileCache().GetApplicationProfile("test")
if profile == nil {
profile = &v1beta1.ApplicationProfile{}
profile.Spec.Containers = append(profile.Spec.Containers, v1beta1.ApplicationProfileContainer{
Name: "test",
Opens: []v1beta1.OpenCalls{
{
Path: "/proc/meminfo",
Flags: []string{"O_RDONLY"},
},
},
})

objCache.SetApplicationProfile(profile)
}

ruleResult = r.ProcessEvent(utils.OpenEventType, e, &objCache)
if ruleResult != nil {
t.Errorf("Expected ruleResult to be nil since file is whitelisted")
}
}
Loading