sudo cscli collections install crowdsecurity/aws-consoleInstalls 1 parser and 2 scenarios.
View AWS Console - Bruteforce Protection →sudo cscli scenarios install crowdsecurity/aws-nwo-loginThen 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.
# NWD/NWH AWS console logintype: triggername: crowdsecurity/aws-cloudtrail-nwo-nwd-console-logindescription: "Detect console login outside of office hours"filter: |evt.Meta.log_type == 'aws-cloudtrail' &&(evt.Meta.event_name == 'ConsoleLogin' || evt.Meta.event_name == 'GetSessionToken' || evt.Meta.event_name == 'GetFederationToken') &&evt.Unmarshaled.cloudtrail.responseElements?.ConsoleLogin == 'Success' &&((evt.Time.Hour() >= 18 || evt.Time.Hour() < 6) ||(evt.Time.Weekday().String() == 'Saturday' || evt.Time.Weekday().String() == 'Sunday'))groupby: evt.Meta.source_ipscope:type: AwsARNexpression: evt.Meta.user_arnlabels:confidence: 3spoofable: 0classification:- attack.T1078behavior: "cloud:unusual-activity"label: "AWS bruteforce"service: awscti: falseremediation: false
Sign in to see the Security Engines that run this attack scenario, the version they run and whether it was modified locally.
This scenario needs the crowdsecurity/aws-cloudtrail parser and detects non working hours/days login in the aws console. You may want to adapt the hours to your specific needs. As an example, the scenario is written for UTC+2 working hours.
Following the https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-aws-console-sign-in-events.html take an extra care of your cloudtrail region configuration when dealing with console signing event capture.