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

Better differentiation between web-access and pure-transfer logs #324

Merged
merged 1 commit into from
Oct 6, 2014
Merged

Better differentiation between web-access and pure-transfer logs #324

merged 1 commit into from
Oct 6, 2014

Conversation

bchavet
Copy link
Contributor

@bchavet bchavet commented Sep 29, 2014

Apache access logs are being decoded as PureFTP transfer logs because the first part of the log entries for each of these uses the same format. This change makes the prematch more specific.

@cgzones
Copy link
Contributor

cgzones commented Sep 30, 2014

Can you provide some log examples?

@bchavet
Copy link
Contributor Author

bchavet commented Sep 30, 2014

The log examples are already present in the decoder.xml file. For example:

pure-transfer:
example.com - user1 [11/Mar/2013:12:24:57 -0000] "GET /ftpdrive/user1/FinalBackup.zip" 200 25268220

web-accesslog:
123.4.5.6 aa.xx.com - [05/Nov/2006:00:46:56 -0500] "GET / HTTP/1.1" 302 -

As you can see, the first part of these entries use the same format, so web-accesslog was being matched as pure-transfer. The differentiator is that web-accesslog entries have HTTP* in the quoted string after the date. So, the change I am proposing just makes the prematch go farther down the string to make sure the right decoder is used.

@cgzones
Copy link
Contributor

cgzones commented Sep 30, 2014

Based on your log examples:
Can't we distinguish both at the start?
pure-transfer:

^\S+ - \S+ [...

web-accesslog:

^\S+ \S+ - [...

@bchavet
Copy link
Contributor Author

bchavet commented Sep 30, 2014

No, because those dashes are not necessarily always dashes, they are just placeholders for when there is no data to put there. For web-accesslog, this would be a username if HTTP authentication is used, for example.

@bchavet
Copy link
Contributor Author

bchavet commented Sep 30, 2014

This is directly related to #158

cgzones added a commit that referenced this pull request Oct 6, 2014
Better differentiation between web-access and pure-transfer logs
@cgzones cgzones merged commit 7d213ca into ossec:master Oct 6, 2014
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

Successfully merging this pull request may close these issues.

3 participants