deepfence / deepfence/ThreatMapper
Agent Fails to start and Install Rocky Linux
- Dominant language
- TypeScript
- Stars
- 5.3k
- Forks
- 631
- PR merge metrics
- No merged PRs in 30d
Description
With reference to the document below I am trying to install the sensor-agent on my Rocky Linux VM
https://community.deepfence.io/threatmapper/docs/sensors/linux-host
Basically it fails to install because as per the script your script fails at this point
```
OS_ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
if [[ "$OS_ID" == "amzn" || "$OS_ID" == "centos" ]]; then
# Do necessary installs for Amazon Linux
yum -y install logrotate jq curl
if [[ "$?" != "0" ]]; then
echo "Failed to install logrotate"
exit 1
fi
```
On rocky linux they mention /etc/os-release
` NAME="Rocky Linux"`
` VERSION="9.4 (Blue Onyx)"`
`ID="rocky"`
`ID_LIKE="rhel centos fedora"`
`VERSION_ID="9.4"`
`PLATFORM_ID="platform:el9"`
`PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"`
`ANSI_COLOR="0;32"`
`LOGO="fedora-logo-icon"`
`CPE_NAME="cpe:/o:rocky:rocky:9::baseos"`
`HOME_URL="https://rockylinux.org/"`
`BUG_REPORT_URL="https://bugs.rockylinux.org/"`
`SUPPORT_END="2032-05-31"`
`ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"`
`ROCKY_SUPPORT_PRODUCT_VERSION="9.4"`
`REDHAT_SUPPORT_PRODUCT="Rocky Linux"`
`REDHAT_SUPPORT_PRODUCT_VERSION="9.4"`
I bypass the issue and installed by after that the startup script fails with systemctl
the host shows in only when I start manually under the path
`/opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/start_deepfenced.sh`
After that when I tried to scan vulnerability it scan and I get the result.
But when I do other scan like malware / posture / secret it fails
In the malware log I could see as mention below.
```
^[[31mERRO^[[0m[2024-06-07T13:01:35Z] yara.go:59 open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/yara-hunter/yara-rules: no such file or directory
^[[31mPANI^[[0m[2024-06-07T13:01:35Z] runner.go:28 main: failed to serve: open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/yara-hunter/yara-rules: no such file or directory
panic: (*logrus.Entry) 0xc0000360e0
goroutine 7 [running]:
github.com/sirupsen/logrus.(*Entry).log(0xc000525f10, 0x0, {0xc0001b21b0, 0x89})
/home/deepfence/src/YaraHunter/vendor/github.com/sirupsen/logrus/entry.go:260 +0x4d6
github.com/sirupsen/logrus.(*Entry).Log(0xc000525f10, 0x0, {0xc000579ed0?, 0x1?, 0x1?})
/home/deepfence/src/YaraHunter/vendor/github.com/sirupsen/logrus/entry.go:304 +0x4f
github.com/sirupsen/logrus.(*Entry).Logf(0xc000525f10, 0x0, {0x10f5856?, 0x0?}, {0xc000579f80?, 0x1218118?, 0x15e8c98?})
/home/deepfence/src/YaraHunter/vendor/github.com/sirupsen/logrus/entry.go:349 +0x85
github.com/sirupsen/logrus.(*Logger).Logf(0xc0000a6180, 0x0, {0x10f5856, 0x19}, {0xc000579f80, 0x1, 0x1})
/home/deepfence/src/YaraHunter/vendor/github.com/sirupsen/logrus/logger.go:154 +0x85
github.com/sirupsen/logrus.(*Logger).Panicf(...)
/home/deepfence/src/YaraHunter/vendor/github.com/sirupsen/logrus/logger.go:195
github.com/sirupsen/logrus.Panicf(...)
/home/deepfence/src/YaraHunter/vendor/github.com/sirupsen/logrus/exported.go:219
github.com/deepfence/YaraHunter/pkg/runner.StartYaraHunter(0x0?, 0x0?, 0x0?)
/home/deepfence/src/YaraHunter/pkg/runner/runner.go:28 +0xb0
created by main.main
```
For secret scan log
```
time="2024-06-07 13:01:35" level=error msg="open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-06-07 13:01:40" level=error msg="open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-06-07 13:03:10" level=error msg="open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-06-07 13:03:15" level=error msg="open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-06-07 13:03:20" level=error msg="open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
time="2024-06-07 13:03:25" level=error msg="open /opt/deepfence/df-agents/rocky-vue-php74/home/deepfence/bin/secret-scanner/config/config.yaml: no such file or directory"
^[[36mINFO^[[0m[2024-06-07T13:03:30Z] grpc.go:98 main: server listening at /opt/deepfence/df-agents/rocky-vue-php74/tmp/secret-scanner.sock
~
```

Contributor guide
Assessment
This issue has not been assessed yet.