What is an Elastic integration?

This integration is powered by Elastic Agent. Elastic Agent is a single, unified way to add monitoring for logs, metrics, and other types of data to a host. It can also protect hosts from security threats, query data from operating systems, forward data from remote services or hardware, and more. Refer to our documentation for a detailed comparison between Beats and Elastic Agent.

Prefer to use Beats for this use case? See Filebeat modules for logs or Metricbeat modules for metrics.

Overview

This integration is for Microsoft Office 365. It currently supports user, admin, system, and policy actions and events from Office 365 and Azure AD activity logs exposed by the Office 365 Management Activity API.

Configuration

To use this package you need to enable Audit Log Search and register an application in Azure AD.

Once this application is registered note the Application (client) ID and the Directory (tenant) ID. Then configure the authentication in the Certificates & Secrets section.

To use client-secret authentication, add you secret to the Client Secret (API key) field.

To use certificate-based authentication, set the paths to the certificate and private key files. If the key file is protected with a passphrase, set this passphrase in the Private key passphrase field. Paths must be absolute and files must exist in the host where Elastic Agent is running.

Add your tenant ID(s) to the Directory (tenant) IDs field, then add the hostname that this tenant identifies to the Directory (tenant) domains field. For example:

  • Directory IDs: my-id-a my-id-b
  • Directory domains: a.onmicrosoft.com b.onmicrosoft.com

Compatibility

The ingest-geoip and ingest-user_agent Elasticsearch plugins are required to run this module.

Logs

Audit

Uses the Office 365 Management Activity API to retrieve audit messages from Office 365 and Azure AD activity logs. These are the same logs that are available under Audit Log Search in the Security and Compliance Center.

An example event for audit looks as following:

{
    "@timestamp": "2020-02-07T16:43:53.000Z",
    "agent": {
        "ephemeral_id": "14ad310a-30bb-45d4-9dd4-20f22267fbd5",
        "id": "b1d83907-ff3e-464a-b79a-cf843f6f0bba",
        "name": "docker-fleet-agent",
        "type": "filebeat",
        "version": "8.0.0-beta1"
    },
    "client": {
        "address": "213.97.47.133",
        "ip": "213.97.47.133"
    },
    "data_stream": {
        "dataset": "o365.audit",
        "namespace": "ep",
        "type": "logs"
    },
    "ecs": {
        "version": "8.3.0"
    },
    "elastic_agent": {
        "id": "b1d83907-ff3e-464a-b79a-cf843f6f0bba",
        "snapshot": false,
        "version": "8.0.0-beta1"
    },
    "event": {
        "action": "PageViewed",
        "agent_id_status": "verified",
        "category": [
            "web"
        ],
        "code": "SharePoint",
        "dataset": "o365.audit",
        "id": "99d005e6-a4c6-46fd-117c-08d7abeceab5",
        "ingested": "2022-01-02T03:51:15Z",
        "kind": "event",
        "original": "{\"ListItemUniqueId\": \"59a8433d-9bb8-cfef-6edc-4c0fc8b86875\", \"ItemType\": \"Page\", \"Workload\": \"OneDrive\", \"OrganizationId\": \"b86ab9d4-fcf1-4b11-8a06-7a8f91b47fbd\", \"UserId\": \"asr@testsiem.onmicrosoft.com\", \"CreationTime\": \"2020-02-07T16:43:53\", \"Site\": \"d5180cfc-3479-44d6-b410-8c985ac894e3\", \"ClientIP\": \"213.97.47.133\", \"WebId\": \"8c5c94bb-8396-470c-87d7-8999f440cd30\", \"UserType\": 0, \"Version\": 1, \"EventSource\": \"SharePoint\", \"UserAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0\", \"UserKey\": \"i:0h.f|membership|1003200096971f55@live.com\", \"CustomUniqueId\": true, \"Operation\": \"PageViewed\", \"ObjectId\": \"https://testsiem-my.sharepoint.com/personal/asr_testsiem_onmicrosoft_com/_layouts/15/onedrive.aspx\", \"Id\": \"99d005e6-a4c6-46fd-117c-08d7abeceab5\", \"CorrelationId\": \"622b339f-4000-a000-f25f-92b3478c7a25\", \"RecordType\": 4}",
        "outcome": "success",
        "provider": "OneDrive",
        "type": [
            "info"
        ]
    },
    "host": {
        "id": "b86ab9d4-fcf1-4b11-8a06-7a8f91b47fbd",
        "name": "testsiem.onmicrosoft.com"
    },
    "input": {
        "type": "o365audit"
    },
    "network": {
        "type": "ipv4"
    },
    "o365": {
        "audit": {
            "CorrelationId": "622b339f-4000-a000-f25f-92b3478c7a25",
            "CreationTime": "2020-02-07T16:43:53",
            "CustomUniqueId": true,
            "EventSource": "SharePoint",
            "ItemType": "Page",
            "ListItemUniqueId": "59a8433d-9bb8-cfef-6edc-4c0fc8b86875",
            "ObjectId": "https://testsiem-my.sharepoint.com/personal/asr_testsiem_onmicrosoft_com/_layouts/15/onedrive.aspx",
            "RecordType": "4",
            "Site": "d5180cfc-3479-44d6-b410-8c985ac894e3",
            "UserId": "asr@testsiem.onmicrosoft.com",
            "UserKey": "i:0h.f|membership|1003200096971f55@live.com",
            "UserType": "0",
            "Version": "1",
            "WebId": "8c5c94bb-8396-470c-87d7-8999f440cd30"
        }
    },
    "organization": {
        "id": "b86ab9d4-fcf1-4b11-8a06-7a8f91b47fbd"
    },
    "related": {
        "ip": [
            "213.97.47.133"
        ],
        "user": [
            "asr"
        ]
    },
    "source": {
        "ip": "213.97.47.133"
    },
    "tags": [
        "forwarded",
        "o365-audit",
        "preserve_original_event"
    ],
    "user": {
        "domain": "testsiem.onmicrosoft.com",
        "email": "asr@testsiem.onmicrosoft.com",
        "id": "asr@testsiem.onmicrosoft.com",
        "name": "asr"
    },
    "user_agent": {
        "device": {
            "name": "Mac"
        },
        "name": "Firefox",
        "original": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0",
        "os": {
            "full": "Mac OS X 10.14",
            "name": "Mac OS X",
            "version": "10.14"
        },
        "version": "72.0."
    }
}

Exported fields

FieldDescriptionType
@timestamp
Event timestamp.
date
client.address
Some event client addresses are defined ambiguously. The event will sometimes list an IP, a domain or a unix socket. You should always store the raw address in the .address field. Then it should be duplicated to .ip or .domain, depending on which one it is.
keyword
client.domain
The domain name of the client system. This value may be a host name, a fully qualified domain name, or another host naming format. The value may derive from the original event or be added from enrichment.
keyword
client.ip
IP address of the client (IPv4 or IPv6).
ip
client.port
Port of the client.
long
cloud.account.id
The cloud account or organization id used to identify different entities in a multi-tenant environment. Examples: AWS account id, Google Cloud ORG Id, or other unique identifier.
keyword
cloud.availability_zone
Availability zone in which this host is running.
keyword
cloud.image.id
Image ID for the cloud instance.
keyword
cloud.instance.id
Instance ID of the host machine.
keyword
cloud.instance.name
Instance name of the host machine.
keyword
cloud.machine.type
Machine type of the host machine.
keyword
cloud.project.id
Name of the project in Google Cloud.
keyword
cloud.provider
Name of the cloud provider. Example values are aws, azure, gcp, or digitalocean.
keyword
cloud.region
Region in which this host is running.
keyword
container.id
Unique container id.
keyword
container.image.name
Name of the image the container was built on.
keyword
container.labels
Image labels.
object
container.name
Container name.
keyword
data_stream.dataset
Data stream dataset name.
constant_keyword
data_stream.namespace
Data stream namespace.
constant_keyword
data_stream.type
Data stream type.
constant_keyword
destination.ip
IP address of the destination (IPv4 or IPv6).
ip
destination.user.email
User email address.
keyword
destination.user.id
Unique identifier of the user.
keyword
ecs.version
ECS version this event conforms to. ecs.version is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events.
keyword
event.action
The action captured by the event. This describes the information in the event. It is more specific than event.category. Examples are group-add, process-started, file-created. The value is normally defined by the implementer.
keyword
event.category
This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy. event.category represents the "big buckets" of ECS categories. For example, filtering on event.category:process yields all events relating to process activity. This field is closely related to event.type, which is used as a subcategory. This field is an array. This will allow proper categorization of some events that fall in multiple categories.
keyword
event.code
Identification code for this event, if one exists. Some event sources use event codes to identify messages unambiguously, regardless of message language or wording adjustments over time. An example of this is the Windows Event ID.
keyword
event.dataset
Event dataset
constant_keyword
event.id
Unique ID to describe the event.
keyword
event.ingested
Timestamp when an event arrived in the central data store. This is different from @timestamp, which is when the event originally occurred. It's also different from event.created, which is meant to capture the first time an agent saw the event. In normal conditions, assuming no tampering, the timestamps should chronologically look like this: @timestamp < event.created < event.ingested.
date
event.kind
This is one of four ECS Categorization Fields, and indicates the highest level in the ECS category hierarchy. event.kind gives high-level information about what type of information the event contains, without being specific to the contents of the event. For example, values of this field distinguish alert events from metric events. The value of this field can be used to inform how these kinds of events should be handled. They may warrant different retention, different access control, it may also help understand whether the data coming in at a regular interval or not.
keyword
event.module
Event module
constant_keyword
event.outcome
This is one of four ECS Categorization Fields, and indicates the lowest level in the ECS category hierarchy. event.outcome simply denotes whether the event represents a success or a failure from the perspective of the entity that produced the event. Note that when a single transaction is described in multiple events, each event may populate different values of event.outcome, according to their perspective. Also note that in the case of a compound event (a single event that contains multiple logical events), this field should be populated with the value that best captures the overall success or failure from the perspective of the event producer. Further note that not all events will have an associated outcome. For example, this field is generally not populated for metric events, events with event.type:info, or any events for which an outcome does not make logical sense.
keyword
event.provider
Source of the event. Event transports such as Syslog or the Windows Event Log typically mention the source of an event. It can be the name of the software that generated the event (e.g. Sysmon, httpd), or of a subsystem of the operating system (kernel, Microsoft-Windows-Security-Auditing).
keyword
event.severity
The numeric severity of the event according to your event source. What the different severity values mean can be different between sources and use cases. It's up to the implementer to make sure severities are consistent across events from the same source. The Syslog severity belongs in log.syslog.severity.code. event.severity is meant to represent the severity according to the event source (e.g. firewall, IDS). If the event source does not publish its own severity, you may optionally copy the log.syslog.severity.code to event.severity.
long
event.type
This is one of four ECS Categorization Fields, and indicates the third level in the ECS category hierarchy. event.type represents a categorization "sub-bucket" that, when used along with the event.category field values, enables filtering events down to a level appropriate for single visualization. This field is an array. This will allow proper categorization of some events that fall in multiple event types.
keyword
file.directory
Directory where the file is located. It should include the drive letter, when appropriate.
keyword
file.extension
File extension, excluding the leading dot. Note that when the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz").
keyword
file.inode
Inode representing the file in the filesystem.
keyword
file.mtime
Last time the file content was modified.
date
file.name
Name of the file including the extension, without the directory.
keyword
file.owner
File owner's username.
keyword
group.name
Name of the group.
keyword
host.architecture
Operating system architecture.
keyword
host.containerized
If the host is a container.
boolean
host.domain
Name of the domain of which the host is a member. For example, on Windows this could be the host's Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host's LDAP provider.
keyword
host.hostname
Hostname of the host. It normally contains what the hostname command returns on the host machine.
keyword
host.id
Unique host id. As hostname is not always unique, use values that are meaningful in your environment. Example: The current usage of beat.name.
keyword
host.ip
Host ip addresses.
ip
host.mac
Host mac addresses.
keyword
host.name
Name of the host. It can contain what hostname returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.
keyword
host.os.build
OS build information.
keyword
host.os.codename
OS codename, if any.
keyword
host.os.family
OS family (such as redhat, debian, freebsd, windows).
keyword
host.os.kernel
Operating system kernel version as a raw string.
keyword
host.os.name
Operating system name, without the version.
keyword
host.os.name.text
Multi-field of host.os.name.
text
host.os.platform
Operating system platform (such centos, ubuntu, windows).
keyword
host.os.version
Operating system version as a raw string.
keyword
host.type
Type of host. For Cloud providers this can be the machine type like t2.medium. If vm, this could be the container, for example, or other information meaningful in your environment.
keyword
input.type
Type of Filebeat input.
keyword
log.file.path
Path to the log file.
keyword
log.flags
Flags for the log file.
keyword
log.offset
Offset of the entry in the log file.
long
message
For log events the message field contains the log message, optimized for viewing in a log viewer. For structured logs without an original message field, other fields can be concatenated to form a human-readable summary of the event. If multiple messages exist, they can be combined into one message.
match_only_text
network.type
In the OSI Model this would be the Network Layer. ipv4, ipv6, ipsec, pim, etc The field value must be normalized to lowercase for querying.
keyword
o365.audit.Actor.ID
keyword
o365.audit.Actor.Type
keyword
o365.audit.ActorContextId
keyword
o365.audit.ActorIpAddress
keyword
o365.audit.ActorUserId
keyword
o365.audit.ActorYammerUserId
keyword
o365.audit.AlertEntityId
keyword
o365.audit.AlertId
keyword
o365.audit.AlertLinks
array
o365.audit.AlertType
keyword
o365.audit.AppId
keyword
o365.audit.ApplicationDisplayName
keyword
o365.audit.ApplicationId
keyword
o365.audit.AzureActiveDirectoryEventType
keyword
o365.audit.Category
keyword
o365.audit.ClientAppId
keyword
o365.audit.ClientIP
keyword
o365.audit.ClientIPAddress
keyword
o365.audit.ClientInfoString
keyword
o365.audit.ClientRequestId
keyword
o365.audit.Comments
text
o365.audit.CorrelationId
keyword
o365.audit.CreationTime
keyword
o365.audit.CustomUniqueId
boolean
o365.audit.Data
keyword
o365.audit.DataType
keyword
o365.audit.EntityType
keyword
o365.audit.ErrorNumber
keyword
o365.audit.EventData
keyword
o365.audit.EventSource
keyword
o365.audit.ExceptionInfo.*
object
o365.audit.ExchangeMetaData.*
object
o365.audit.ExtendedProperties.*
object
o365.audit.ExternalAccess
boolean
o365.audit.GroupName
keyword
o365.audit.Id
keyword
o365.audit.ImplicitShare
keyword
o365.audit.IncidentId
keyword
o365.audit.InterSystemsId
keyword
o365.audit.InternalLogonType
keyword
o365.audit.IntraSystemId
keyword
o365.audit.Item.*
object
o365.audit.Item.*.*
object
o365.audit.ItemName
keyword
o365.audit.ItemType
keyword
o365.audit.ListId
keyword
o365.audit.ListItemUniqueId
keyword
o365.audit.LogonError
keyword
o365.audit.LogonType
keyword
o365.audit.LogonUserSid
keyword
o365.audit.MailboxGuid
keyword
o365.audit.MailboxOwnerMasterAccountSid
keyword
o365.audit.MailboxOwnerSid
keyword
o365.audit.MailboxOwnerUPN
keyword
o365.audit.Members
array
o365.audit.Members.*
object
o365.audit.ModifiedProperties.*.*
object
o365.audit.Name
keyword
o365.audit.ObjectId
keyword
o365.audit.Operation
keyword
o365.audit.OrganizationId
keyword
o365.audit.OrganizationName
keyword
o365.audit.OriginatingServer
keyword
o365.audit.Parameters.*
object
o365.audit.PolicyDetails
array
o365.audit.PolicyId
keyword
o365.audit.RecordType
keyword
o365.audit.ResultStatus
keyword
o365.audit.SensitiveInfoDetectionIsIncluded
boolean
o365.audit.SessionId
keyword
o365.audit.Severity
keyword
o365.audit.SharePointMetaData.*
object
o365.audit.Site
keyword
o365.audit.SiteUrl
keyword
o365.audit.Source
keyword
o365.audit.SourceFileExtension
keyword
o365.audit.SourceFileName
keyword
o365.audit.SourceRelativeUrl
keyword
o365.audit.Status
keyword
o365.audit.SupportTicketId
keyword
o365.audit.Target.ID
keyword
o365.audit.Target.Type
keyword
o365.audit.TargetContextId
keyword
o365.audit.TargetUserOrGroupName
keyword
o365.audit.TargetUserOrGroupType
keyword
o365.audit.TeamGuid
keyword
o365.audit.TeamName
keyword
o365.audit.UniqueSharingId
keyword
o365.audit.UserAgent
keyword
o365.audit.UserId
keyword
o365.audit.UserKey
keyword
o365.audit.UserType
keyword
o365.audit.Version
keyword
o365.audit.WebId
keyword
o365.audit.Workload
keyword
o365.audit.YammerNetworkId
keyword
organization.id
Unique identifier for the organization.
keyword
organization.name
Organization name.
keyword
organization.name.text
Multi-field of organization.name.
match_only_text
process.name
Process name. Sometimes called program name or similar.
keyword
process.name.text
Multi-field of process.name.
match_only_text
related.ip
All of the IPs seen on your event.
ip
related.user
All the user names or other user identifiers seen on the event.
keyword
rule.category
A categorization value keyword used by the entity using the rule for detection of this event.
keyword
rule.description
The description of the rule generating the event.
keyword
rule.id
A rule ID that is unique within the scope of an agent, observer, or other entity using the rule for detection of this event.
keyword
rule.name
The name of the rule or signature generating the event.
keyword
rule.reference
Reference URL to additional information about the rule used to generate this event. The URL can point to the vendor's documentation about the rule. If that's not available, it can also be a link to a more general page describing this type of alert.
keyword
rule.ruleset
Name of the ruleset, policy, group, or parent category in which the rule used to generate this event is a member.
keyword
server.address
Some event server addresses are defined ambiguously. The event will sometimes list an IP, a domain or a unix socket. You should always store the raw address in the .address field. Then it should be duplicated to .ip or .domain, depending on which one it is.
keyword
server.domain
The domain name of the server system. This value may be a host name, a fully qualified domain name, or another host naming format. The value may derive from the original event or be added from enrichment.
keyword
server.ip
IP address of the server (IPv4 or IPv6).
ip
source.as.number
Unique number allocated to the autonomous system. The autonomous system number (ASN) uniquely identifies each network on the Internet.
long
source.as.organization.name
Organization name.
keyword
source.as.organization.name.text
Multi-field of source.as.organization.name.
match_only_text
source.geo.city_name
City name.
keyword
source.geo.continent_name
Name of the continent.
keyword
source.geo.country_iso_code
Country ISO code.
keyword
source.geo.country_name
Country name.
keyword
source.geo.location
Longitude and latitude.
geo_point
source.geo.name
User-defined description of a location, at the level of granularity they care about. Could be the name of their data centers, the floor number, if this describes a local physical entity, city names. Not typically used in automated geolocation.
keyword
source.geo.region_iso_code
Region ISO code.
keyword
source.geo.region_name
Region name.
keyword
source.ip
IP address of the source (IPv4 or IPv6).
ip
source.port
Port of the source.
long
source.user.email
User email address.
keyword
tags
List of keywords used to tag each event.
keyword
threat.technique.id
The id of technique used by this threat. You can use a MITRE ATT&CK® technique, for example. (ex. https://attack.mitre.org/techniques/T1059/)
keyword
url.original
Unmodified original url as seen in the event source. Note that in network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not.
wildcard
url.original.text
Multi-field of url.original.
match_only_text
user.domain
Name of the directory the user is a member of. For example, an LDAP or Active Directory domain name.
keyword
user.email
User email address.
keyword
user.full_name
User's full name, if available.
keyword
user.full_name.text
Multi-field of user.full_name.
match_only_text
user.id
Unique identifier of the user.
keyword
user.name
Short name or login of the user.
keyword
user.name.text
Multi-field of user.name.
match_only_text
user.target.domain
Name of the directory the user is a member of. For example, an LDAP or Active Directory domain name.
keyword
user.target.email
User email address.
keyword
user.target.full_name
User's full name, if available.
keyword
user.target.full_name.text
Multi-field of user.target.full_name.
match_only_text
user.target.group.domain
Name of the directory the group is a member of. For example, an LDAP or Active Directory domain name.
keyword
user.target.group.id
Unique identifier for the group on the system/platform.
keyword
user.target.group.name
Name of the group.
keyword
user.target.id
Unique identifier of the user.
keyword
user.target.name
Short name or login of the user.
keyword
user.target.name.text
Multi-field of user.target.name.
match_only_text
user_agent.device.name
Name of the device.
keyword
user_agent.name
Name of the user agent.
keyword
user_agent.original
Unparsed user_agent string.
keyword
user_agent.original.text
Multi-field of user_agent.original.
match_only_text
user_agent.os.full
Operating system name, including the version or code name.
keyword
user_agent.os.full.text
Multi-field of user_agent.os.full.
match_only_text
user_agent.os.name
Operating system name, without the version.
keyword
user_agent.os.name.text
Multi-field of user_agent.os.name.
match_only_text
user_agent.os.version
Operating system version as a raw string.
keyword
user_agent.version
Version of the user agent.
keyword

Changelog

VersionDetails
1.7.1
Enhancement View pull request
Update package name and description to align with standard wording
1.7.0
Enhancement View pull request
Update package to ECS 8.3.0.
1.6.0
Enhancement View pull request
Extend list of mapped record types
1.5.1
Bug fix View pull request
Fix processing of ModifiedProperties when it is a list of strings
1.5.0
Enhancement View pull request
Update to ECS 8.2
1.4.3
Enhancement View pull request
Replace invalid field value
1.4.2
Enhancement View pull request
Add documentation for multi-fields
1.4.1
Bug fix View pull request
Fix grok parsing errors due to invalid IP addresses.
1.4.0
Enhancement View pull request
Update to ECS 8.0
1.3.2
Bug fix View pull request
Regenerate test files using the new GeoIP database
1.3.1
Bug fix View pull request
Change test public IPs to the supported subset
1.3.0
Enhancement View pull request
Add 8.0.0 version constraint
1.2.4
Enhancement View pull request
Uniform with guidelines
1.2.3
Bug fix View pull request
Fix processors configuration
1.2.2
Enhancement View pull request
Update Title and Description.
1.2.1
Bug fix View pull request
Fix logic that checks for the 'forwarded' tag
1.2.0
Enhancement View pull request
Update to ECS 1.12.0
1.1.4
Bug fix View pull request
additional type assertions in painless scripts
1.1.3
Enhancement View pull request
Convert to generated ECS fields
1.1.2
Enhancement View pull request
update to ECS 1.11.0
1.1.1
Enhancement View pull request
Escape special characters in docs
1.1.0
Enhancement View pull request
Update integration description
1.0.0
Enhancement View pull request
make GA

Enhancement View pull request
Set "event.module" and "event.dataset"
0.6.2
Enhancement View pull request
Use wildcard field type for the relevant ECS fields.
0.6.1
Enhancement View pull request
small pipeline fix for parameters when they are string instead of objects
0.6.0
Enhancement View pull request
add system tests

Enhancement View pull request
fixes o365audit config file
0.5.0
Enhancement View pull request
update to ECS 1.10.0 and adding event.original options
0.4.0
Enhancement View pull request
moving edge processing to ingest pipelines
0.3.2
Enhancement View pull request
update to ECS 1.9.0
0.3.1
Bug fix View pull request
Change kibana.version constraint to be more conservative.
0.3.0
Enhancement View pull request
Add changes to use ECS 1.8 fields.
0.1.0
Enhancement View pull request
initial release