Arsnael commented on code in PR #1743:
URL: https://github.com/apache/james-project/pull/1743#discussion_r1356476154


##########
third-party/crowdsec/sample-configuration/parsers/james-auth.yaml:
##########
@@ -0,0 +1,27 @@
+onsuccess: next_stage
+debug: true
+filter: "evt.Parsed.program == 'james'"
+name: linagora/james-connect-security-log
+description: "Parser for James Connect Security Log"
+
+pattern_syntax:
+  JAMES_AUTH_FAIL: 
'\{"timestamp":"%{DATA:time}","level":"%{LOGLEVEL:level}","thread":"%{DATA:thread}","mdc":{"protocol":"%{DATA:protocol}","ip":"%{IPV4:ip}","host":"%{IPV4:host}","action":"LOGIN","login-user":"%{EMAILADDRESS:loginUser}","sessionId":"%{DATA:sessionId}","user":"%{DATA:user}"\},"logger":"%{JAVACLASS:logger}","message":"User
 %{DATA:loginUser} failed authentication","context":"%{DATA:context}"\}'

Review Comment:
   From the mob / brainstorming, actually maybe two leads:
   
   - from tung: we could add via logback an other entryof logs just for 
crowdsec with just the fields we are interested in in the format we want. Then 
we isolate the ones with AUTH_FAIL in crowdsec pattern stuff
   - from rene:  we could maybe have a pattern syntax like `'%{DATA:data}failed 
authentication%{DATA:data}'` to just get logs with failed auth and then try to 
see if can use https://docs.crowdsec.net/docs/expr/helpers/#json-helpers to 
extract in a json way the fields we want from the logs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to