Detect API activity from users without MFA

Original Source: [splunk source]
Name:Detect API activity from users without MFA
id:4d46e8bd-4072-48e4-92db-0325889ef894
version:3
date:2024-10-17
author:Bhavin Patel, Splunk
status:deprecated
type:Hunting
Description:This search looks for AWS CloudTrail events where a user logged into the AWS account, is making API calls and has not enabled Multi Factor authentication. Multi factor authentication adds a layer of security by forcing the users to type a unique authentication code from an approved authentication device when they access AWS websites or services. AWS Best Practices recommend that you enable MFA for privileged IAM users.
Data_source:
search:`cloudtrail` userIdentity.sessionContext.attributes.mfaAuthenticated=false
| search NOT [| inputlookup aws_service_accounts
| fields identity
| rename identity as user]| stats count min(_time) as firstTime max(_time) as lastTime values(eventName) as eventName by userIdentity.arn userIdentity.type user
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `detect_api_activity_from_users_without_mfa_filter`


how_to_implement:You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your AWS CloudTrail inputs. Leverage the support search `Create a list of approved AWS service accounts`: run it once every 30 days to create a list of service accounts and validate them. This search produces fields (`eventName`,`userIdentity.type`,`userIdentity.arn`) that are not yet supported by ES Incident Review and therefore cannot be viewed when a notable event is raised. These fields contribute additional context to the notable. To see the additional metadata, add the following fields, if not already present, to Incident Review - Event Attributes (Configure > Incident Management > Incident Review Settings > Add New Entry): * **Label:** AWS Event Name, **Field:** eventName * **Label:** AWS User ARN, **Field:** userIdentity.arn * **Label:** AWS User Type, **Field:** userIdentity.type Detailed documentation on how to create a new field within Incident Review may be found here: `https://docs.splunk.com/Documentation/ES/5.3.0/Admin/Customizenotables#Add_a_field_to_the_notable_event_details`
known_false_positives:Many service accounts configured within an AWS infrastructure do not have multi factor authentication enabled. Please ignore the service accounts, if triggered and instead add them to the aws_service_accounts.csv file to fine tune the detection. It is also possible that the search detects users in your environment using Single Sign-On systems, since the MFA is not handled by AWS.
References:
drilldown_searches:
  :
tags:
  analytic_story:
    - 'AWS User Monitoring'
  asset_type:AWS Instance
  confidence:50
  impact:50
  message:tbd
  observable:
    name:'user'
    type:'User'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'userIdentity.sessionContext.attributes.mfaAuthenticated'
    - 'eventName'
    - 'userIdentity.arn'
    - 'userIdentity.type'
    - 'user'
  risk_score:25.0
  security_domain:network

tests:
  :
manual_test:None

Related Analytic Stories


AWS User Monitoring