# \[BUG ?\] Notification file use bad tmp folder

**URL:** <https://discourse.crowdsec.net/t/bug-notification-file-use-bad-tmp-folder/2087>\
**Category:** crowdsec\
**Created:** [October 17, 2024, 4:59pm UTC](https://discourse.crowdsec.net/t/bug-notification-file-use-bad-tmp-folder/2087 "2024-10-17T16:59:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JsdBEnZ7Rt9orgOfa1Ep](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/jsdbenz7rt9orgofa1ep/32/1017_2.png) [@JsdBEnZ7Rt9orgOfa1Ep](https://discourse.crowdsec.net/u/JsdBEnZ7Rt9orgOfa1Ep)\
**Post date:** [October 17, 2024, 4:59pm UTC](https://discourse.crowdsec.net/t/bug-notification-file-use-bad-tmp-folder/2087/1 "2024-10-17T16:59:13Z")

</div>

Hi all,

I am trying to use the solution described here: [CrowdSec Wazuh Integration](https://zaferbalkan.com/2024/06/19/crowdsec-wazuh-integration.html).

However, I am encountering an issue with the notification-file plugin. It seems that this process is running as the user “nobody,” as specified in my `config.yaml`:

```yaml
plugin_config:
  user: nobody # plugin process would be run on behalf of this user
  group: nogroup # plugin process would be run on behalf of this group

```

When I launch the plugin for debugging, it attempts to use the `/tmp` folder of the root user:

```auto
└──╼ cscli notifications test file_default --debug
DEBU[2024-10-17T18:55:23+02:00] Using /etc/crowdsec/config.yaml as configuration file 
DEBU[2024-10-17T18:55:23+02:00] Enabled feature flags: <none>                
DEBU Console configuration '/etc/crowdsec/console.yaml' loaded successfully 
DEBU Executing plugin /usr/lib/crowdsec/plugins/notification-file 
DEBU[0000] starting plugin args="[/usr/lib/crowdsec/plugins/notification-file]" path=/usr/lib/crowdsec/plugins/notification-file
DEBU[0000] plugin started path=/usr/lib/crowdsec/plugins/notification-file pid=33587
DEBU[0000] waiting for RPC address path=/usr/lib/crowdsec/plugins/notification-file
ERRO[0000] plugin init error @module=file-plugin error="open /tmp/user/0/plugin3568862350: permission denied"
FATA while loading plugin: Unrecognized remote plugin message: 
This usually means
  the plugin was not compiled for this architecture,
  the plugin is missing dynamic-link libraries necessary to run,
  the plugin is not executable by this process due to file permissions, or
  the plugin failed to negotiate the initial go-plugin protocol handshake

Additional notes about the plugin:
  Path: /usr/lib/crowdsec/plugins/notification-file
  Mode: -rwxr-xr-x
  Owner: 0 [root] (current: 0 [root])
  Group: 0 [root] (current: 0 [root])
  ELF architecture: EM_X86_64 (current architecture: amd64) 

```

When I add `rwx` permissions for others on my `/tmp/run/0` folder, it works, but this raises security concerns.

Am I making a mistake in my configuration, or is this a bug?

Thanks!

---

<div class="post-metadata">

**Author:** ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)\
**Post date:** [October 18, 2024, 10:29am UTC](https://discourse.crowdsec.net/t/bug-notification-file-use-bad-tmp-folder/2087/2 "2024-10-18T10:29:42Z")

</div>

When you run the `cscli notifications test` command are you running as `root` or your user account? as under the hood `cscli` is spinning up a temporary notifications pipeline so it could be that it is reusing the same `/tmp` folder as the actual crowdsec process that is running as `root` but I would be surprised if that is the case.

Might be good if you can provide distro, arch and a few way to replicate as currently from my own tests I have no issues.

---

<div class="post-metadata">

**Author:** ![JsdBEnZ7Rt9orgOfa1Ep](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/jsdbenz7rt9orgofa1ep/32/1017_2.png) [@JsdBEnZ7Rt9orgOfa1Ep](https://discourse.crowdsec.net/u/JsdBEnZ7Rt9orgOfa1Ep)\
**Post date:** [October 18, 2024, 10:49am UTC](https://discourse.crowdsec.net/t/bug-notification-file-use-bad-tmp-folder/2087/3 "2024-10-18T10:49:57Z")

</div>

Hi,  
Thanks for reply  
Distro: Debian GNU/Linux 11 (bullseye) / amd64  
Process list :

```auto
└──╼ ps aux | grep crow
root 5438 1.4 4.6 2034928 91364 ? Ssl Oct14 84:05 /usr/bin/crowdsec -c /etc/crowdsec/config.yaml
root 9526 0.0 0.8 1239756 17368 ? Ssl Sep30 4:42 /usr/bin/crowdsec-firewall-bouncer -c /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml

```

Command execute as root

```auto
DEBU[2024-10-18T12:47:51+02:00] Using /etc/crowdsec/config.yaml as configuration file 
DEBU[2024-10-18T12:47:51+02:00] Enabled feature flags: <none>                
DEBU Console configuration '/etc/crowdsec/console.yaml' loaded successfully 
DEBU Executing plugin /usr/lib/crowdsec/plugins/notification-file 
DEBU[0000] starting plugin args="[/usr/lib/crowdsec/plugins/notification-file]" path=/usr/lib/crowdsec/plugins/notification-file
DEBU[0000] plugin started path=/usr/lib/crowdsec/plugins/notification-file pid=10658
DEBU[0000] waiting for RPC address path=/usr/lib/crowdsec/plugins/notification-file
ERRO[0001] plugin init error @module=file-plugin error="open /tmp/user/0/plugin2554856807: permission denied"
FATA while loading plugin: Unrecognized remote plugin message: 
This usually means
  the plugin was not compiled for this architecture,
  the plugin is missing dynamic-link libraries necessary to run,
  the plugin is not executable by this process due to file permissions, or
  the plugin failed to negotiate the initial go-plugin protocol handshake

Additional notes about plugin:
  Path: /usr/lib/crowdsec/plugins/notification-file
  Mode: -rwxr-xr-x
  Owner: 0 [root] (current: 0 [root])
  Group: 0 [root] (current: 0 [root])
  ELF architecture: EM_X86_64 (current architecture: amd64) 

```

Command execute as nobody

```auto
└──╼ cscli notifications test file_default --debug
DEBU[2024-10-18T12:49:03+02:00] Using /etc/crowdsec/config.yaml as configuration file 
DEBU[2024-10-18T12:49:03+02:00] Enabled feature flags: <none>                
FATA failed to load Local API: loading online client credentials: open /etc/crowdsec/online_api_credentials.yaml: permission denied 

```

---

<div class="post-metadata">

**Author:** ![thomas.sec](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@thomas.sec](https://discourse.crowdsec.net/u/thomas.sec)\
**Post date:** [January 9, 2025, 10:25am UTC](https://discourse.crowdsec.net/t/bug-notification-file-use-bad-tmp-folder/2087/4 "2025-01-09T10:25:30Z")

</div>

Hi, I wanted to follow up and ask if you managed to find a solution to the issue. Let me know, thanks ! I have the same problem, I am tring to send crowdsec alerts in wazuh.

Debian 12.8 amd64  
crowdsec 1.6.4
