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

Suricata - Policy usage creates error: error installing ids rules () #5382

Closed
2 tasks done
f45tb00t opened this issue Nov 29, 2021 · 6 comments · Fixed by #5383
Closed
2 tasks done

Suricata - Policy usage creates error: error installing ids rules () #5382

f45tb00t opened this issue Nov 29, 2021 · 6 comments · Fixed by #5383
Assignees
Labels
cleanup Low impact changes
Milestone

Comments

@f45tb00t
Copy link

f45tb00t commented Nov 29, 2021

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

Hi,

I thought this has been fixed with:
ref: #4946

Actually I am not very sure if this is related to the issue from above.
Basically when I create a policy and click apply I get "error: error installing ids rules ()"

I've removed everything from the policies, shutdown suricata, deleted everything from "/usr/local/etc/suricata/rules" and reinstalled suricata and tried again. The issue persists

I also do not have any extra plugins (like the free ones) installed anymore. I had them installed, but removed them some month ago.

To Reproduce

Steps to reproduce the behavior:

  1. Just add a policy and click apply and the error will pop up

Expected behavior

When appliying the policy I would not expect the error.

Describe alternatives you considered

Remove everything and start from scratch. Issue persist.

Screenshots

None yet

Relevant log files
Please let me know which log file you need and I'll provide it asap
Additional context

None yet

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 21.7.6-amd64 (amd64, OpenSSL).
Intel(R) Celeron(R) CPU J3160 @ 1.60GHz
Network I210 Gigabit Network Connection

@f45tb00t f45tb00t changed the title Suricata: error installing ids rules ( Suricata - Policy usage creates error: error installing ids rules () Nov 29, 2021
@AdSchellevis AdSchellevis added the support Community support label Nov 29, 2021
@f45tb00t
Copy link
Author

Note: The interesting part is, I've checked the file status while creation
38596 8389 -rw-r----- 1 root wheel 30M Nov 29 14:53 rules.sqlite
When it reaches the 30M the error pops up.

Could it be, that the timeout is set too low somehow? Like the error is shown when applying the policy takes too long?

@kulikov-a
Copy link
Member

hi
any errors if you run /usr/local/opnsense/scripts/suricata/installRules.py manually?

@f45tb00t
Copy link
Author

Hello @kulikov-a,

no errors at all shown via cli when executing the script manually.

@kulikov-a
Copy link
Member

kulikov-a commented Nov 30, 2021

@f45tb00t
sorry for the delay.
yes, the configdRun() function contains timouts control (2 min by default). but I had to reduce it to 1 minute for a configuration with snort rules enabled and a 54MB cache db in order to reproduce your error. and this is on a VM with one Xeon(R) CPU E5-2620 core configured and 4GB of RAM (and with unbound with all blacklists allowed).
so imho the reason is something else. resources are already depleted. Policies applying task is not so resource intensive.

@f45tb00t
Copy link
Author

Hello,

just let me know what I can provide as logs to track down the issue when you have time. Regardless to the error, it seems the policy is applied. But from where the error comes, I have absolutely no clue.

@kulikov-a
Copy link
Member

kulikov-a commented Nov 30, 2021

Regardless to the error, it seems the policy is applied.

i think installRules.py worked anyway (although the configdRun() function returned null because of timeout)

just let me know what I can provide as logs to track down the issue when you have time

if I understood the code correctly, an empty "error: error installing ids rules ()" error may appear if the call to the configdRun("ids install rules") function did not return 'OK'. which in its turn can happen due to a timeout, an execution error, or the impossibility of connecting to the configd socket. (in such cases, the corresponding errors should appear in the backend log, but it seems that for now internal configdRun errors are not processed by syslog-ng. I will try to make a pr for this).
since in your case the script starts executing (the size of the cache db changes), I think that the matter is in the execution timeout. and in this case, I would follow the resources and processes that these resources can absorb (SYSTEM: DIAGNOSTICS: ACTIVITY)

@fichtner fichtner added cleanup Low impact changes and removed support Community support labels Jan 18, 2022
@fichtner fichtner added this to the 22.1 milestone Jan 18, 2022
@fichtner fichtner linked a pull request Jan 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Low impact changes
Development

Successfully merging a pull request may close this issue.

4 participants