Skip to content

Syscheck - how to monitor directory without subdirectories #1595

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

Closed
alextodicescu opened this issue Dec 14, 2018 · 3 comments
Closed

Syscheck - how to monitor directory without subdirectories #1595

alextodicescu opened this issue Dec 14, 2018 · 3 comments

Comments

@alextodicescu
Copy link

alextodicescu commented Dec 14, 2018

Hi,

I'm trying to determine if it's possible to configure ossec syscheck to only monitor the current directory, without it's subdirectories.
For example, say we have the current filesystem structure
/
/dir1/
/dir1/file1
/dir1/dir2/
/dir1/dir2/file2

I would like to monitor the files in /dir1, so I will configure syscheck with the following:
<directories check_all="yes">/dir1</directories>

However, this will also monitor subdirectories of /dir1. I've tried a few options using <ignore> statement without any luck.

Appreciate any help here.

@alextodicescu alextodicescu changed the title Syscheck monitor directories without subdirectories Syscheck - how to monitor directory without subdirectories Dec 14, 2018
@ddpbsd
Copy link
Member

ddpbsd commented Dec 14, 2018

There's currently no "no recursive" option for syscheck. It's something I've considered recently though.
The best you could do is possibly using <ignore> options to ignore what you don't want to see.

@alextodicescu
Copy link
Author

Thanks @ddpbsd for the reply. Yep, it would be a nice feature to have.
The use case for it would be: having subdirectories with temporary/volatile files that you want to ignore from monitoring.

How would an <ignore> regex for all subdirectories look like? Tried validating a few regex with /var/ossec/bin/ossec-regex but had no joy.

@ddpbsd
Copy link
Member

ddpbsd commented Dec 16, 2018

Pull request #1597 adds a no_recurse option.

@ddpbsd ddpbsd closed this as completed Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants