sudo cscli collections install jusabatier/apereo-casInstalls 1 parser and 2 scenarios.
View Apereo CAS - Bruteforce Protection →sudo cscli parsers install jusabatier/apereo-cas-audit-logsThen reload CrowdSec: sudo systemctl reload crowdsec
Sign in to see which of your engines run it →Hover a line or a note to see what each field does.
onsuccess: next_stage#debug: truefilter: "evt.Parsed.program == 'cas'"name: jusabatier/apereo-cas-audit-logsdescription: "Parse apereo CAS Audits logs"pattern_syntax:# The IP grok pattern that ships with crowdsec is buggy and does not capture the last digit of an IP if it is the last thing it matches, and the last octet starts with a 2# https://github.com/crowdsecurity/crowdsec/issues/938IPv4_WORKAROUND: (?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)IP_WORKAROUND: (?:%{IPV6}|%{IPv4_WORKAROUND})SECOND_WORKAROUND: '(?:[0-5]?[0-9]|60)?'TIMESTAMP_WORKAROUND: '%{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND_WORKAROUND})?%{ISO8601_TIMEZONE}?'CAS_AUTH_FAIL: '^%{TIMESTAMP_WORKAROUND:time}(?:,\d+)? %{LOGLEVEL:loglevel} \[%{DATA:threadname}\] - (.*)\|CAS\|(.*)\|AUTHENTICATION_FAILED\|%{USERNAME:cas_invalid_user}\|%{IP_WORKAROUND:cas_client_ip}\|(.*)$'# CAS v7: <timestamp|user|details|AUTHENTICATION_FAILED|client_ip|server_ip|>CAS_V7_AUTH_FAIL: '^%{TIMESTAMP_WORKAROUND:time}(?:,\d+)? %{LOGLEVEL:loglevel} \[%{DATA:threadname}\] - <[^|]+\|%{USERNAME:cas_invalid_user}\|[^|]+\|AUTHENTICATION_FAILED\|%{IP_WORKAROUND:cas_client_ip}\|'nodes:- grok:name: "CAS_AUTH_FAIL"apply_on: messagestatics:- meta: log_typevalue: cas_failed-auth- meta: target_userexpression: "evt.Parsed.cas_invalid_user"- target: evt.StrTimeexpression: evt.Parsed.time- grok:name: "CAS_V7_AUTH_FAIL"apply_on: messagestatics:- meta: log_typevalue: cas_failed-auth- meta: target_userexpression: "evt.Parsed.cas_invalid_user"- target: evt.StrTimeexpression: evt.Parsed.timestatics:- meta: servicevalue: cas- meta: source_ip
Sign in to see the Security Engines that run this log parser, the version they run and whether it was modified locally.
Use Apereo CAS audit logs : https://apereo.github.io/cas/6.4.x/audits/Audits-File.html
Need to :
cas.audit.slf4j.use-single-line=true in CAS configurationSample log4j config :
1[...]2 <RollingFile name="auditlogfile" fileName="${baseDir}/cas_audit.log" append="true"3 filePattern="${baseDir}/cas_audit-%d{yyyy-MM-dd-HH}-%i.log">4 <PatternLayout pattern="%d %p [%c] - %m%n"/>5 <Policies>6 <OnStartupTriggeringPolicy />7 <SizeBasedTriggeringPolicy size="10 MB"/>8 <TimeBasedTriggeringPolicy />9 </Policies>10 </RollingFile>1112 <CasAppender name="casAudit">13 <AppenderRef ref="auditlogfile" />14 </CasAppender>15[...]16 <AsyncLogger name="org.apereo.inspektr.audit.support" level="info" includeLocation="true" >17 <AppenderRef ref="casAudit"/>18 </AsyncLogger>19[...]