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

Unable to ignore prefixed whitespace #318

Open
saurabhnanda opened this issue Mar 25, 2019 · 0 comments
Open

Unable to ignore prefixed whitespace #318

saurabhnanda opened this issue Mar 25, 2019 · 0 comments

Comments

@saurabhnanda
Copy link

I have the following ruleset...

version=2
rule=ssh,fail,invalid_user: Failed password for invalid user %user:word% from %clientip:ipv4% port %clientport:number%%-:rest%
rule=ssh,fail,incorrect_password: Failed password for %user:word% from %clientip:ipv4% port %clientport:number%%-:rest%
rule=ssh,fail,disconnect: Disconnected from authenticating user %user:word% %clientip:ipv4% port %clientport:number%%-:rest%
rule=ssh,fail,disconnect,invalid_user: Disconnected from invalid user %user:word% %clientip:ipv4% port %clientport:number%%-:rest%
rule=ssh,fail,disconnect: Received disconnect from %clientip:ipv4% port %clientport:number%%-:rest%
rule=ssh,fail,disconnect: Connection closed by %clientip:ipv4% port %clientport:number%%-:rest%

...which I wanted to simplify with...

version=2
prefix=%-:whitespace%
rule=ssh,fail,invalid_user:Failed password for invalid user %user:word% from %clientip:ipv4% port %clientport:number%%-:rest%
rule=ssh,fail,incorrect_password:Failed password for %user:word% from %clientip:ipv4% port %clientport:number%%-:rest%

# and others...

...however, this doesn't seem to work. Am I doing anything wrong, or is this a bug?

Also, even if I get this to work, it's probably going to be very brittle, because of what's written in the docs -

The current parsing position MUST be on a whitspace, else the parser does not match.

What is the best way to ignore optional prefixed whitespace?

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

1 participant