In Red Hat Enterprise Linux 9, the default permissions are more stringent compared to RHEL 7. This can cause certain applications and commands that worked seamlessly on RHEL 7 to fail or encounter permission issues on RHEL 9.
To resolve this issue, you need to adjust the permissions on RHEL 9 to allow the necessary capabilities. Below are two solutions to address this problem:
Solution 1: Modify Permissions Directly on curl
- Open a terminal from the RHEL 9 server where the hawkagent is running from.
- Execute the following command to grant the necessary capabilities to the curl binary:
sudo setcap cap_net_bind_service,cap_net_admin+ep /usr/bin/curl
If you are not able to grant the permission to original binary file, you can try this:
Solution 2: Create a Copy of curl and Modify Permissions
- Open a terminal from the RHEL 9 server where the hawkagent is running from.
- sudo cp /usr/bin/curl /usr/local/bin/curl_hawk
- sudo setcap cap_net_bind_service,cap_net_admin+ep /usr/local/bin/curl_hawk
- Use it in rulebases or in script: custom:executeForString(curl_hawk xxx).
To revert the changes:
sudo setcap -r /usr/bin/curl OR
sudo setcap -r /usr/local/bin/curl_hawk