Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[m365_defender] Add Support of Alert Data Stream #8950

Merged
merged 5 commits into from Feb 5, 2024

Conversation

mohitjha-elastic
Copy link
Contributor

Type of change

  • Enhancements

What does this PR do?

1. Add Support of Alert Data Stream

2. Fixed the dashboard issue in Incident and Event Data Stream
Combined the aggregated alerts coming through the incident endpoint in the existing dashboard of Incident and created
new dashboard for the alert.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

All changes

  • Change follows the contributing guidelines
  • Supported versions of the monitoring target are documented
  • Supported operating systems are documented (if applicable)
  • Integration or System tests exist
  • Documentation exists
  • Fields follow ECS and naming conventions
  • At least a manual test with ES / Kibana / Agent has been performed.
  • Required Kibana version set to: ^8.7.1

How to test this PR locally

Clone integrations repo.
Install the elastic package locally.
Start the elastic stack using the elastic package.
Move to integrations/packages/m365_defender directory.
Run the following command to run tests.
elastic-package test -v

Related issues

Automated Test

elastic-package test -v
2024/01/22 18:38:34 DEBUG Enable verbose logging
2024/01/22 18:38:34 DEBUG latest version (cached): v0.95.0. Download from: https://github.com/elastic/elastic-package/releases/tag/v0.95.0 (Timestamp 2024-01-22 18:34:56.772617899 +0530 IST)
Run test suite for the package
Run asset tests for the package
2024/01/22 18:38:34 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:38:34 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:38:34 DEBUG Connecting with Elasticsearch host from current profile (profile: default, host: "https://127.0.0.1:9200")
2024/01/22 18:38:34 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:38:34 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:38:34 DEBUG Connecting with Kibana host from current profile (profile: default, host: "https://127.0.0.1:5601")
2024/01/22 18:38:34 DEBUG GET https://127.0.0.1:5601/api/status
2024/01/22 18:38:34 DEBUG installing package...
2024/01/22 18:38:34 DEBUG Build directory: /root/integrations/build/packages/m365_defender/2.7.0
2024/01/22 18:38:34 DEBUG Clear target directory (path: /root/integrations/build/packages/m365_defender/2.7.0)
2024/01/22 18:38:34 DEBUG Copy package content (source: /root/integrations/packages/m365_defender)
2024/01/22 18:38:34 DEBUG Copy license file if needed
2024/01/22 18:38:34  INFO License text found in "/root/integrations/LICENSE.txt" will be included in package
2024/01/22 18:38:34 DEBUG Encode dashboards
2024/01/22 18:38:34 DEBUG Resolve external fields
2024/01/22 18:38:34 DEBUG Package has external dependencies defined
2024/01/22 18:38:34 DEBUG data_stream/alert/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/alert/fields/beats.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/alert/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/event/fields/agent.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/event/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/event/fields/ecs.yml: source file has been changed
2024/01/22 18:38:34 DEBUG data_stream/event/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/incident/fields/agent.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/incident/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/incident/fields/ecs.yml: source file has been changed
2024/01/22 18:38:34 DEBUG data_stream/incident/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/log/fields/agent.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/log/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:34 DEBUG data_stream/log/fields/ecs.yml: source file has been changed
2024/01/22 18:38:34 DEBUG data_stream/log/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:34  INFO Import ECS mappings into the built package (technical preview)
2024/01/22 18:38:34 DEBUG Build zipped package
2024/01/22 18:38:34 DEBUG Compress using archiver.Zip (destination: /root/integrations/build/packages/m365_defender-2.7.0.zip)
2024/01/22 18:38:34 DEBUG Create work directory for archiving: /tmp/elastic-package-2593982841/m365_defender-2.7.0
2024/01/22 18:38:34 DEBUG Skip validation of the built .zip package
2024/01/22 18:38:34 DEBUG POST https://127.0.0.1:5601/api/fleet/epm/packages
2024/01/22 18:38:37 DEBUG removing package...
2024/01/22 18:38:37 DEBUG DELETE https://127.0.0.1:5601/api/fleet/epm/packages/m365_defender/2.7.0
--- Test results for package: m365_defender - START ---
╭───────────────┬─────────────┬───────────┬────────────────────────────────────────────────────────────────────────┬────────┬──────────────╮
│ PACKAGE       │ DATA STREAM │ TEST TYPE │ TEST NAME                                                              │ RESULT │ TIME ELAPSED │
├───────────────┼─────────────┼───────────┼────────────────────────────────────────────────────────────────────────┼────────┼──────────────┤
│ m365_defender │             │ asset     │ dashboard m365_defender-2690a440-7235-11ed-8657-c59f6ece834c is loaded │ PASS   │       4.98µs │
│ m365_defender │             │ asset     │ dashboard m365_defender-3caf3c00-7456-11ed-8657-c59f6ece834c is loaded │ PASS   │        641ns │
│ m365_defender │             │ asset     │ dashboard m365_defender-ac54d310-44ab-11ed-8375-0168a9970c06 is loaded │ PASS   │        655ns │
│ m365_defender │             │ asset     │ dashboard m365_defender-c0b796d0-720a-11ed-8657-c59f6ece834c is loaded │ PASS   │        654ns │
│ m365_defender │             │ asset     │ dashboard m365_defender-d587df00-745f-11ed-8657-c59f6ece834c is loaded │ PASS   │        726ns │
│ m365_defender │             │ asset     │ dashboard m365_defender-d80d7840-4366-11ed-b1f2-e917f608bd03 is loaded │ PASS   │        778ns │
│ m365_defender │             │ asset     │ search m365_defender-64a31410-722c-11ed-8657-c59f6ece834c is loaded    │ PASS   │        702ns │
│ m365_defender │             │ asset     │ search m365_defender-989afc60-44a5-11ed-8375-0168a9970c06 is loaded    │ PASS   │        666ns │
│ m365_defender │             │ asset     │ search m365_defender-fcf25960-44af-11ed-8375-0168a9970c06 is loaded    │ PASS   │        715ns │
│ m365_defender │ alert       │ asset     │ index_template logs-m365_defender.alert is loaded                      │ PASS   │      1.206µs │
│ m365_defender │ alert       │ asset     │ ingest_pipeline logs-m365_defender.alert-2.7.0 is loaded               │ PASS   │        742ns │
│ m365_defender │ event       │ asset     │ index_template logs-m365_defender.event is loaded                      │ PASS   │        745ns │
│ m365_defender │ event       │ asset     │ ingest_pipeline logs-m365_defender.event-2.7.0 is loaded               │ PASS   │        690ns │
│ m365_defender │ incident    │ asset     │ index_template logs-m365_defender.incident is loaded                   │ PASS   │        888ns │
│ m365_defender │ incident    │ asset     │ ingest_pipeline logs-m365_defender.incident-2.7.0 is loaded            │ PASS   │        863ns │
│ m365_defender │ log         │ asset     │ index_template logs-m365_defender.log is loaded                        │ PASS   │        859ns │
│ m365_defender │ log         │ asset     │ ingest_pipeline logs-m365_defender.log-2.7.0 is loaded                 │ PASS   │        749ns │
╰───────────────┴─────────────┴───────────┴────────────────────────────────────────────────────────────────────────┴────────┴──────────────╯
--- Test results for package: m365_defender - END   ---
Done
Run pipeline tests for the package
2024/01/22 18:38:40 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:38:40 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:38:40 DEBUG Connecting with Elasticsearch host from current profile (profile: default, host: "https://127.0.0.1:9200")
--- Test results for package: m365_defender - START ---
╭───────────────┬─────────────┬───────────┬─────────────────────────────────────┬────────┬──────────────╮
│ PACKAGE       │ DATA STREAM │ TEST TYPE │ TEST NAME                           │ RESULT │ TIME ELAPSED │
├───────────────┼─────────────┼───────────┼─────────────────────────────────────┼────────┼──────────────┤
│ m365_defender │ alert       │ pipeline  │ test-alert.log                      │ PASS   │  58.621234ms │
│ m365_defender │ event       │ pipeline  │ test-alert.log                      │ PASS   │  23.636319ms │
│ m365_defender │ event       │ pipeline  │ test-app-and-identity.log           │ PASS   │  15.958594ms │
│ m365_defender │ event       │ pipeline  │ test-device.log                     │ PASS   │ 125.954076ms │
│ m365_defender │ event       │ pipeline  │ test-email.log                      │ PASS   │  11.328493ms │
│ m365_defender │ incident    │ pipeline  │ test-incident.log                   │ PASS   │  67.127806ms │
│ m365_defender │ log         │ pipeline  │ test-m365-defender-empty-ndjson.log │ PASS   │   3.243361ms │
│ m365_defender │ log         │ pipeline  │ test-m365-defender-ndjson.log       │ PASS   │  17.301047ms │
╰───────────────┴─────────────┴───────────┴─────────────────────────────────────┴────────┴──────────────╯
--- Test results for package: m365_defender - END   ---
Done
Run static tests for the package
2024/01/22 18:38:44 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:38:44 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:38:44 DEBUG Connecting with Elasticsearch host from current profile (profile: default, host: "https://127.0.0.1:9200")
--- Test results for package: m365_defender - START ---
╭───────────────┬─────────────┬───────────┬──────────────────────────┬────────┬──────────────╮
│ PACKAGE       │ DATA STREAM │ TEST TYPE │ TEST NAME                │ RESULT │ TIME ELAPSED │
├───────────────┼─────────────┼───────────┼──────────────────────────┼────────┼──────────────┤
│ m365_defender │ alert       │ static    │ Verify sample_event.json │ PASS   │ 164.641607ms │
│ m365_defender │ incident    │ static    │ Verify sample_event.json │ PASS   │ 176.197699ms │
│ m365_defender │ log         │ static    │ Verify sample_event.json │ PASS   │ 156.672506ms │
╰───────────────┴─────────────┴───────────┴──────────────────────────┴────────┴──────────────╯
--- Test results for package: m365_defender - END   ---
Done
Run system tests for the package
2024/01/22 18:38:45 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:38:45 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:38:45 DEBUG Connecting with Elasticsearch host from current profile (profile: default, host: "https://127.0.0.1:9200")
2024/01/22 18:38:45 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:38:45 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:38:45 DEBUG Connecting with Kibana host from current profile (profile: default, host: "https://127.0.0.1:5601")
2024/01/22 18:38:45 DEBUG GET https://127.0.0.1:5601/api/status
2024/01/22 18:38:45 DEBUG Running system tests for data stream
2024/01/22 18:38:45 DEBUG running test with configuration 'default'
2024/01/22 18:38:45 DEBUG setting up service...
2024/01/22 18:38:45 DEBUG setting up service using Docker Compose service deployer
2024/01/22 18:38:45 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:38:45 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:38:45 DEBUG output command: /usr/bin/docker network inspect elastic-package-stack_default
2024/01/22 18:38:45 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service up --build -d
[+] Running 2/2
 ✔ Network elastic-package-service_default                 Created                                                                              0.2s 
 ✔ Container elastic-package-service-m365-defender-http-1  Started                                                                              0.0s 
2024/01/22 18:38:46 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service ps -a -q
2024/01/22 18:38:46 DEBUG Wait for healthy containers: d00be514ace68b8780e0b9257b264b1b3665f671f6d5940a180accd526f4425e
2024/01/22 18:38:46 DEBUG output command: /usr/bin/docker inspect d00be514ace68b8780e0b9257b264b1b3665f671f6d5940a180accd526f4425e
2024/01/22 18:38:46 DEBUG Container status: {"Config":{"Image":"docker.elastic.co/observability/stream:v0.8.0","Labels":{"BRANCH_NAME":"v0.8.0","GIT_SHA":"3df2f6636c0b047f4e9903ff226dab5064da0ad4","GO_VERSION":"1.19.1","TIMESTAMP":"2022-09-15_16:29","com.docker.compose.config-hash":"ec88ddce0d37976e2f1f43621d3e40615e9f2a45474d59c62b51a640a08245c8","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:62eb4cdf2c37cd9619e21a06f9639399a187e970c88adec4ed8cd166ffb5c5a8","com.docker.compose.oneoff":"False","com.docker.compose.project":"elastic-package-service","com.docker.compose.project.config_files":"/root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml","com.docker.compose.project.working_dir":"/root/integrations/packages/m365_defender/_dev/deploy/docker","com.docker.compose.service":"m365-defender-http","com.docker.compose.version":"2.23.3"}},"ID":"d00be514ace68b8780e0b9257b264b1b3665f671f6d5940a180accd526f4425e","State":{"Status":"running","ExitCode":0,"Health":null}}
2024/01/22 18:38:46 DEBUG run command: /usr/bin/docker network connect elastic-package-stack_default elastic-package-service-m365-defender-http-1
2024/01/22 18:38:46 DEBUG adding service container elastic-package-service-m365-defender-http-1 internal ports to context
2024/01/22 18:38:46 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service config
2024/01/22 18:38:46 DEBUG Installing package...
2024/01/22 18:38:46 DEBUG Build directory: /root/integrations/build/packages/m365_defender/2.7.0
2024/01/22 18:38:46 DEBUG Clear target directory (path: /root/integrations/build/packages/m365_defender/2.7.0)
2024/01/22 18:38:46 DEBUG Copy package content (source: /root/integrations/packages/m365_defender)
2024/01/22 18:38:46 DEBUG Copy license file if needed
2024/01/22 18:38:46  INFO License text found in "/root/integrations/LICENSE.txt" will be included in package
2024/01/22 18:38:46 DEBUG Encode dashboards
2024/01/22 18:38:46 DEBUG Resolve external fields
2024/01/22 18:38:46 DEBUG Package has external dependencies defined
2024/01/22 18:38:46 DEBUG data_stream/alert/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/alert/fields/beats.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/alert/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/event/fields/agent.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/event/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/event/fields/ecs.yml: source file has been changed
2024/01/22 18:38:46 DEBUG data_stream/event/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/incident/fields/agent.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/incident/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/incident/fields/ecs.yml: source file has been changed
2024/01/22 18:38:46 DEBUG data_stream/incident/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/log/fields/agent.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/log/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:38:46 DEBUG data_stream/log/fields/ecs.yml: source file has been changed
2024/01/22 18:38:46 DEBUG data_stream/log/fields/fields.yml: source file hasn't been changed
2024/01/22 18:38:46  INFO Import ECS mappings into the built package (technical preview)
2024/01/22 18:38:46 DEBUG Build zipped package
2024/01/22 18:38:46 DEBUG Compress using archiver.Zip (destination: /root/integrations/build/packages/m365_defender-2.7.0.zip)
2024/01/22 18:38:46 DEBUG Create work directory for archiving: /tmp/elastic-package-111438822/m365_defender-2.7.0
2024/01/22 18:38:46 DEBUG Skip validation of the built .zip package
2024/01/22 18:38:46 DEBUG POST https://127.0.0.1:5601/api/fleet/epm/packages
2024/01/22 18:38:48 DEBUG creating test policy...
2024/01/22 18:38:48 DEBUG POST https://127.0.0.1:5601/api/fleet/agent_policies
2024/01/22 18:38:51 DEBUG adding package data stream to test policy...
2024/01/22 18:38:51 DEBUG POST https://127.0.0.1:5601/api/fleet/package_policies
2024/01/22 18:38:53 DEBUG deleting old data in data stream...
2024/01/22 18:38:53 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:38:53 DEBUG GET https://127.0.0.1:5601/api/fleet/agents
2024/01/22 18:38:55 DEBUG filter agents using criteria: NamePrefix=docker-fleet-agent
2024/01/22 18:38:55 DEBUG found 1 enrolled agent(s)
2024/01/22 18:38:55 DEBUG GET https://127.0.0.1:5601/api/fleet/agent_policies/6176c1e0-b927-11ee-a654-fdc8fb5df46b
2024/01/22 18:38:55 DEBUG assigning package data stream to agent...
2024/01/22 18:38:55 DEBUG PUT https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237/reassign
2024/01/22 18:38:57 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:38:57 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"6176c1e0-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:38:57 DEBUG Wait until the policy (ID: 6176c1e0-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:38:59 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:38:59 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"6176c1e0-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:38:59 DEBUG Wait until the policy (ID: 6176c1e0-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:01 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:01 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"6176c1e0-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:01 DEBUG Wait until the policy (ID: 6176c1e0-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:03 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:03 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"6176c1e0-b927-11ee-a654-fdc8fb5df46b","policy_revision":2,"local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:03 DEBUG Policy revision assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:03 DEBUG checking for expected data in data stream...
2024/01/22 18:39:03 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:04 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:05 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:06 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:07 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:08 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:09 DEBUG found 0 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:10 DEBUG found 3 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:14 DEBUG found 3 hits in logs-m365_defender.alert-ep data stream
2024/01/22 18:39:14 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:14 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:14 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service ps -a -q m365-defender-http
2024/01/22 18:39:14 DEBUG output command: /usr/bin/docker inspect d00be514ace68b8780e0b9257b264b1b3665f671f6d5940a180accd526f4425e
2024/01/22 18:39:14 DEBUG check whether or not synthetics is enabled (component template logs-m365_defender.alert@package)...
2024/01/22 18:39:14 DEBUG data stream logs-m365_defender.alert-ep has synthetics enabled: false
2024/01/22 18:39:14 DEBUG assert hit count expected 3, observed 3
2024/01/22 18:39:14 DEBUG reassigning original policy back to agent...
2024/01/22 18:39:14 DEBUG PUT https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237/reassign
2024/01/22 18:39:15 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:15 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:15 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:17 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:17 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:17 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:19 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:19 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:19 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:21 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:21 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:21 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:23 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:23 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","policy_revision":3,"local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:23 DEBUG Policy revision assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:23 DEBUG deleting test policy...
2024/01/22 18:39:23 DEBUG POST https://127.0.0.1:5601/api/fleet/agent_policies/delete
2024/01/22 18:39:25 DEBUG DELETE https://127.0.0.1:5601/api/fleet/epm/packages/m365_defender/2.7.0
2024/01/22 18:39:27 DEBUG tearing down service...
2024/01/22 18:39:27 DEBUG tearing down service using Docker Compose runner
2024/01/22 18:39:27 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:27 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:27 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service logs
2024/01/22 18:39:27  INFO Write container logs to file: /root/integrations/build/container-logs/m365-defender-http-1705928967662369272.log
2024/01/22 18:39:27 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service down --volumes
[+] Running 2/2
 ✔ Container elastic-package-service-m365-defender-http-1  Removed                                                                              0.3s 
 ✔ Network elastic-package-service_default                 Removed                                                                              0.1s 
2024/01/22 18:39:28 DEBUG deleting data in data stream...
2024/01/22 18:39:28 DEBUG Dump Elastic stack data
2024/01/22 18:39:28 DEBUG Dump stack logs (location: /tmp/test-system-3092996922)
2024/01/22 18:39:28 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:39:28 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:39:28 DEBUG Dump stack logs for elastic-agent
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs elastic-agent
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG run command: /usr/bin/docker cp elastic-package-stack-elastic-agent-1:/usr/share/elastic-agent/state/data/logs/ /tmp/test-system-3092996922/logs/elastic-agent-internal
2024/01/22 18:39:28 DEBUG Dump stack logs for fleet-server
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs fleet-server
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG run command: /usr/bin/docker cp elastic-package-stack-fleet-server-1:/usr/share/elastic-agent/state/data/logs/ /tmp/test-system-3092996922/logs/fleet-server-internal
2024/01/22 18:39:28 DEBUG Dump stack logs for kibana
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs kibana
2024/01/22 18:39:28 DEBUG Dump stack logs for elasticsearch
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs elasticsearch
2024/01/22 18:39:28 DEBUG Dump stack logs for package-registry
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs package-registry
2024/01/22 18:39:28 DEBUG Running system tests for data stream
2024/01/22 18:39:28 DEBUG running test with configuration 'default'
2024/01/22 18:39:28 DEBUG setting up service...
2024/01/22 18:39:28 DEBUG setting up service using Docker Compose service deployer
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:28 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:28 DEBUG output command: /usr/bin/docker network inspect elastic-package-stack_default
2024/01/22 18:39:28 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service up --build -d
[+] Running 2/2
 ✔ Network elastic-package-service_default                 Created                                                                              0.2s 
 ✔ Container elastic-package-service-m365-defender-http-1  Started                                                                              0.0s 
2024/01/22 18:39:29 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service ps -a -q
2024/01/22 18:39:29 DEBUG Wait for healthy containers: 9002930d4ef692a72ccf2be645e34af6f52a4310792663e5b38d75bc6a02d4c7
2024/01/22 18:39:29 DEBUG output command: /usr/bin/docker inspect 9002930d4ef692a72ccf2be645e34af6f52a4310792663e5b38d75bc6a02d4c7
2024/01/22 18:39:29 DEBUG Container status: {"Config":{"Image":"docker.elastic.co/observability/stream:v0.8.0","Labels":{"BRANCH_NAME":"v0.8.0","GIT_SHA":"3df2f6636c0b047f4e9903ff226dab5064da0ad4","GO_VERSION":"1.19.1","TIMESTAMP":"2022-09-15_16:29","com.docker.compose.config-hash":"ec88ddce0d37976e2f1f43621d3e40615e9f2a45474d59c62b51a640a08245c8","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:62eb4cdf2c37cd9619e21a06f9639399a187e970c88adec4ed8cd166ffb5c5a8","com.docker.compose.oneoff":"False","com.docker.compose.project":"elastic-package-service","com.docker.compose.project.config_files":"/root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml","com.docker.compose.project.working_dir":"/root/integrations/packages/m365_defender/_dev/deploy/docker","com.docker.compose.service":"m365-defender-http","com.docker.compose.version":"2.23.3"}},"ID":"9002930d4ef692a72ccf2be645e34af6f52a4310792663e5b38d75bc6a02d4c7","State":{"Status":"running","ExitCode":0,"Health":null}}
2024/01/22 18:39:29 DEBUG run command: /usr/bin/docker network connect elastic-package-stack_default elastic-package-service-m365-defender-http-1
2024/01/22 18:39:29 DEBUG adding service container elastic-package-service-m365-defender-http-1 internal ports to context
2024/01/22 18:39:29 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service config
2024/01/22 18:39:29 DEBUG Installing package...
2024/01/22 18:39:29 DEBUG Build directory: /root/integrations/build/packages/m365_defender/2.7.0
2024/01/22 18:39:29 DEBUG Clear target directory (path: /root/integrations/build/packages/m365_defender/2.7.0)
2024/01/22 18:39:29 DEBUG Copy package content (source: /root/integrations/packages/m365_defender)
2024/01/22 18:39:29 DEBUG Copy license file if needed
2024/01/22 18:39:29  INFO License text found in "/root/integrations/LICENSE.txt" will be included in package
2024/01/22 18:39:29 DEBUG Encode dashboards
2024/01/22 18:39:29 DEBUG Resolve external fields
2024/01/22 18:39:29 DEBUG Package has external dependencies defined
2024/01/22 18:39:29 DEBUG data_stream/alert/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/alert/fields/beats.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/alert/fields/fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/event/fields/agent.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/event/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/event/fields/ecs.yml: source file has been changed
2024/01/22 18:39:29 DEBUG data_stream/event/fields/fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/incident/fields/agent.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/incident/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/incident/fields/ecs.yml: source file has been changed
2024/01/22 18:39:29 DEBUG data_stream/incident/fields/fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/log/fields/agent.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/log/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:39:29 DEBUG data_stream/log/fields/ecs.yml: source file has been changed
2024/01/22 18:39:29 DEBUG data_stream/log/fields/fields.yml: source file hasn't been changed
2024/01/22 18:39:29  INFO Import ECS mappings into the built package (technical preview)
2024/01/22 18:39:29 DEBUG Build zipped package
2024/01/22 18:39:29 DEBUG Compress using archiver.Zip (destination: /root/integrations/build/packages/m365_defender-2.7.0.zip)
2024/01/22 18:39:29 DEBUG Create work directory for archiving: /tmp/elastic-package-993955360/m365_defender-2.7.0
2024/01/22 18:39:29 DEBUG Skip validation of the built .zip package
2024/01/22 18:39:29 DEBUG POST https://127.0.0.1:5601/api/fleet/epm/packages
2024/01/22 18:39:31 DEBUG creating test policy...
2024/01/22 18:39:31 DEBUG POST https://127.0.0.1:5601/api/fleet/agent_policies
2024/01/22 18:39:35 DEBUG adding package data stream to test policy...
2024/01/22 18:39:35 DEBUG POST https://127.0.0.1:5601/api/fleet/package_policies
2024/01/22 18:39:37 DEBUG deleting old data in data stream...
2024/01/22 18:39:37 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:37 DEBUG GET https://127.0.0.1:5601/api/fleet/agents
2024/01/22 18:39:38 DEBUG filter agents using criteria: NamePrefix=docker-fleet-agent
2024/01/22 18:39:38 DEBUG found 1 enrolled agent(s)
2024/01/22 18:39:38 DEBUG GET https://127.0.0.1:5601/api/fleet/agent_policies/7b32bd50-b927-11ee-a654-fdc8fb5df46b
2024/01/22 18:39:38 DEBUG assigning package data stream to agent...
2024/01/22 18:39:38 DEBUG PUT https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237/reassign
2024/01/22 18:39:39 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:39 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"7b32bd50-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:39 DEBUG Wait until the policy (ID: 7b32bd50-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:41 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:41 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"7b32bd50-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:41 DEBUG Wait until the policy (ID: 7b32bd50-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:43 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:43 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"7b32bd50-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:43 DEBUG Wait until the policy (ID: 7b32bd50-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:45 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:45 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"7b32bd50-b927-11ee-a654-fdc8fb5df46b","policy_revision":2,"local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:45 DEBUG Policy revision assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:45 DEBUG checking for expected data in data stream...
2024/01/22 18:39:45 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:46 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:47 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:48 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:49 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:50 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:51 DEBUG found 0 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:52 DEBUG found 1 hits in logs-m365_defender.incident-ep data stream
2024/01/22 18:39:52 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:39:52 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:39:52 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service ps -a -q m365-defender-http
2024/01/22 18:39:52 DEBUG output command: /usr/bin/docker inspect 9002930d4ef692a72ccf2be645e34af6f52a4310792663e5b38d75bc6a02d4c7
2024/01/22 18:39:52 DEBUG check whether or not synthetics is enabled (component template logs-m365_defender.incident@package)...
2024/01/22 18:39:52 DEBUG data stream logs-m365_defender.incident-ep has synthetics enabled: false
2024/01/22 18:39:52 DEBUG reassigning original policy back to agent...
2024/01/22 18:39:52 DEBUG PUT https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237/reassign
2024/01/22 18:39:53 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:53 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:53 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:55 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:55 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:55 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:57 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:57 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:57 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:39:59 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:39:59 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:39:59 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:01 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:01 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","policy_revision":3,"local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:01 DEBUG Policy revision assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:01 DEBUG deleting test policy...
2024/01/22 18:40:01 DEBUG POST https://127.0.0.1:5601/api/fleet/agent_policies/delete
2024/01/22 18:40:04 DEBUG DELETE https://127.0.0.1:5601/api/fleet/epm/packages/m365_defender/2.7.0
2024/01/22 18:40:05 DEBUG tearing down service...
2024/01/22 18:40:05 DEBUG tearing down service using Docker Compose runner
2024/01/22 18:40:05 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:05 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:05 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service logs
2024/01/22 18:40:05  INFO Write container logs to file: /root/integrations/build/container-logs/m365-defender-http-1705929005888924174.log
2024/01/22 18:40:05 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service down --volumes
[+] Running 2/2
 ✔ Container elastic-package-service-m365-defender-http-1  Removed                                                                              0.3s 
 ✔ Network elastic-package-service_default                 Removed                                                                              0.1s 
2024/01/22 18:40:06 DEBUG deleting data in data stream...
2024/01/22 18:40:06 DEBUG Dump Elastic stack data
2024/01/22 18:40:06 DEBUG Dump stack logs (location: /tmp/test-system-2192571953)
2024/01/22 18:40:06 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:40:06 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:40:06 DEBUG Dump stack logs for elastic-agent
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs elastic-agent
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG run command: /usr/bin/docker cp elastic-package-stack-elastic-agent-1:/usr/share/elastic-agent/state/data/logs/ /tmp/test-system-2192571953/logs/elastic-agent-internal
2024/01/22 18:40:06 DEBUG Dump stack logs for fleet-server
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs fleet-server
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG run command: /usr/bin/docker cp elastic-package-stack-fleet-server-1:/usr/share/elastic-agent/state/data/logs/ /tmp/test-system-2192571953/logs/fleet-server-internal
2024/01/22 18:40:06 DEBUG Dump stack logs for kibana
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs kibana
2024/01/22 18:40:06 DEBUG Dump stack logs for elasticsearch
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs elasticsearch
2024/01/22 18:40:06 DEBUG Dump stack logs for package-registry
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs package-registry
2024/01/22 18:40:06 DEBUG Running system tests for data stream
2024/01/22 18:40:06 DEBUG running test with configuration 'httpjson'
2024/01/22 18:40:06 DEBUG setting up service...
2024/01/22 18:40:06 DEBUG setting up service using Docker Compose service deployer
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:06 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:06 DEBUG output command: /usr/bin/docker network inspect elastic-package-stack_default
2024/01/22 18:40:06 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service up --build -d
[+] Running 2/2
 ✔ Network elastic-package-service_default                 Created                                                                              0.2s 
 ✔ Container elastic-package-service-m365-defender-http-1  Started                                                                              0.0s 
2024/01/22 18:40:07 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service ps -a -q
2024/01/22 18:40:07 DEBUG Wait for healthy containers: 3501b9f052b1ae72d93e33ea049e91213451e64eab7a2d0b9724b812fbc11caa
2024/01/22 18:40:07 DEBUG output command: /usr/bin/docker inspect 3501b9f052b1ae72d93e33ea049e91213451e64eab7a2d0b9724b812fbc11caa
2024/01/22 18:40:07 DEBUG Container status: {"Config":{"Image":"docker.elastic.co/observability/stream:v0.8.0","Labels":{"BRANCH_NAME":"v0.8.0","GIT_SHA":"3df2f6636c0b047f4e9903ff226dab5064da0ad4","GO_VERSION":"1.19.1","TIMESTAMP":"2022-09-15_16:29","com.docker.compose.config-hash":"ec88ddce0d37976e2f1f43621d3e40615e9f2a45474d59c62b51a640a08245c8","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:62eb4cdf2c37cd9619e21a06f9639399a187e970c88adec4ed8cd166ffb5c5a8","com.docker.compose.oneoff":"False","com.docker.compose.project":"elastic-package-service","com.docker.compose.project.config_files":"/root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml","com.docker.compose.project.working_dir":"/root/integrations/packages/m365_defender/_dev/deploy/docker","com.docker.compose.service":"m365-defender-http","com.docker.compose.version":"2.23.3"}},"ID":"3501b9f052b1ae72d93e33ea049e91213451e64eab7a2d0b9724b812fbc11caa","State":{"Status":"running","ExitCode":0,"Health":null}}
2024/01/22 18:40:07 DEBUG run command: /usr/bin/docker network connect elastic-package-stack_default elastic-package-service-m365-defender-http-1
2024/01/22 18:40:07 DEBUG adding service container elastic-package-service-m365-defender-http-1 internal ports to context
2024/01/22 18:40:07 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service config
2024/01/22 18:40:07 DEBUG Installing package...
2024/01/22 18:40:07 DEBUG Build directory: /root/integrations/build/packages/m365_defender/2.7.0
2024/01/22 18:40:07 DEBUG Clear target directory (path: /root/integrations/build/packages/m365_defender/2.7.0)
2024/01/22 18:40:07 DEBUG Copy package content (source: /root/integrations/packages/m365_defender)
2024/01/22 18:40:07 DEBUG Copy license file if needed
2024/01/22 18:40:07  INFO License text found in "/root/integrations/LICENSE.txt" will be included in package
2024/01/22 18:40:07 DEBUG Encode dashboards
2024/01/22 18:40:07 DEBUG Resolve external fields
2024/01/22 18:40:07 DEBUG Package has external dependencies defined
2024/01/22 18:40:07 DEBUG data_stream/alert/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/alert/fields/beats.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/alert/fields/fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/event/fields/agent.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/event/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/event/fields/ecs.yml: source file has been changed
2024/01/22 18:40:07 DEBUG data_stream/event/fields/fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/incident/fields/agent.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/incident/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/incident/fields/ecs.yml: source file has been changed
2024/01/22 18:40:07 DEBUG data_stream/incident/fields/fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/log/fields/agent.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/log/fields/base-fields.yml: source file hasn't been changed
2024/01/22 18:40:07 DEBUG data_stream/log/fields/ecs.yml: source file has been changed
2024/01/22 18:40:07 DEBUG data_stream/log/fields/fields.yml: source file hasn't been changed
2024/01/22 18:40:07  INFO Import ECS mappings into the built package (technical preview)
2024/01/22 18:40:07 DEBUG Build zipped package
2024/01/22 18:40:07 DEBUG Compress using archiver.Zip (destination: /root/integrations/build/packages/m365_defender-2.7.0.zip)
2024/01/22 18:40:07 DEBUG Create work directory for archiving: /tmp/elastic-package-3155522029/m365_defender-2.7.0
2024/01/22 18:40:08 DEBUG Skip validation of the built .zip package
2024/01/22 18:40:08 DEBUG POST https://127.0.0.1:5601/api/fleet/epm/packages
2024/01/22 18:40:09 DEBUG creating test policy...
2024/01/22 18:40:09 DEBUG POST https://127.0.0.1:5601/api/fleet/agent_policies
2024/01/22 18:40:13 DEBUG adding package data stream to test policy...
2024/01/22 18:40:13 DEBUG POST https://127.0.0.1:5601/api/fleet/package_policies
2024/01/22 18:40:16 DEBUG deleting old data in data stream...
2024/01/22 18:40:16 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:16 DEBUG GET https://127.0.0.1:5601/api/fleet/agents
2024/01/22 18:40:16 DEBUG filter agents using criteria: NamePrefix=docker-fleet-agent
2024/01/22 18:40:16 DEBUG found 1 enrolled agent(s)
2024/01/22 18:40:16 DEBUG GET https://127.0.0.1:5601/api/fleet/agent_policies/91ed5fa0-b927-11ee-a654-fdc8fb5df46b
2024/01/22 18:40:16 DEBUG assigning package data stream to agent...
2024/01/22 18:40:16 DEBUG PUT https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237/reassign
2024/01/22 18:40:18 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:18 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"91ed5fa0-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:18 DEBUG Wait until the policy (ID: 91ed5fa0-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:20 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:20 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"91ed5fa0-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:20 DEBUG Wait until the policy (ID: 91ed5fa0-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:22 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:22 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"91ed5fa0-b927-11ee-a654-fdc8fb5df46b","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:22 DEBUG Wait until the policy (ID: 91ed5fa0-b927-11ee-a654-fdc8fb5df46b, revision: 2) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:24 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:24 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"91ed5fa0-b927-11ee-a654-fdc8fb5df46b","policy_revision":2,"local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:24 DEBUG Policy revision assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:24 DEBUG checking for expected data in data stream...
2024/01/22 18:40:24 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:25 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:26 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:27 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:28 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:29 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:30 DEBUG found 0 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:31 DEBUG found 11 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:35 DEBUG found 11 hits in logs-m365_defender.log-ep data stream
2024/01/22 18:40:35 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:35 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:35 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service ps -a -q m365-defender-http
2024/01/22 18:40:35 DEBUG output command: /usr/bin/docker inspect 3501b9f052b1ae72d93e33ea049e91213451e64eab7a2d0b9724b812fbc11caa
2024/01/22 18:40:35 DEBUG check whether or not synthetics is enabled (component template logs-m365_defender.log@package)...
2024/01/22 18:40:35 DEBUG data stream logs-m365_defender.log-ep has synthetics enabled: false
2024/01/22 18:40:35 DEBUG assert hit count expected 11, observed 11
2024/01/22 18:40:35 DEBUG reassigning original policy back to agent...
2024/01/22 18:40:35 DEBUG PUT https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237/reassign
2024/01/22 18:40:37 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:37 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:37 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:39 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:39 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:39 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:41 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:41 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:41 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:43 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:43 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:43 DEBUG Wait until the policy (ID: elastic-agent-managed-ep, revision: 3) is assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:45 DEBUG GET https://127.0.0.1:5601/api/fleet/agents/94873353-7ce6-47b9-aba5-fb4e303de237
2024/01/22 18:40:45 DEBUG Agent data: {"id":"94873353-7ce6-47b9-aba5-fb4e303de237","policy_id":"elastic-agent-managed-ep","policy_revision":3,"local_metadata":{"host":{"name":"docker-fleet-agent"}}}
2024/01/22 18:40:45 DEBUG Policy revision assigned to the agent (ID: 94873353-7ce6-47b9-aba5-fb4e303de237)...
2024/01/22 18:40:45 DEBUG deleting test policy...
2024/01/22 18:40:45 DEBUG POST https://127.0.0.1:5601/api/fleet/agent_policies/delete
2024/01/22 18:40:48 DEBUG DELETE https://127.0.0.1:5601/api/fleet/epm/packages/m365_defender/2.7.0
2024/01/22 18:40:49 DEBUG tearing down service...
2024/01/22 18:40:49 DEBUG tearing down service using Docker Compose runner
2024/01/22 18:40:49 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:49 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:49 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service logs
2024/01/22 18:40:49  INFO Write container logs to file: /root/integrations/build/container-logs/m365-defender-http-1705929049989438425.log
2024/01/22 18:40:49 DEBUG running command: /usr/local/bin/docker-compose -f /root/integrations/packages/m365_defender/_dev/deploy/docker/docker-compose.yml -p elastic-package-service down --volumes
[+] Running 2/2
 ✔ Container elastic-package-service-m365-defender-http-1  Removed                                                                              0.3s 
 ✔ Network elastic-package-service_default                 Removed                                                                              0.2s 
2024/01/22 18:40:50 DEBUG deleting data in data stream...
2024/01/22 18:40:50 DEBUG Dump Elastic stack data
2024/01/22 18:40:50 DEBUG Dump stack logs (location: /tmp/test-system-240027907)
2024/01/22 18:40:50 DEBUG output command: /usr/bin/docker ps -a --filter label=com.docker.compose.project=elastic-package-stack --format {{.ID}}
2024/01/22 18:40:50 DEBUG output command: /usr/bin/docker inspect 0dc6c70a4bcf f0f35a2600c3 0f131d6564c1 6c4c061c1a02 b5f96a7db109 34926d485c04 e313199d4790 928f42d88b1d 1d2ca5e1bb2e 0263446122b1
2024/01/22 18:40:50 DEBUG Dump stack logs for elastic-agent
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:50 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs elastic-agent
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:50 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:50 DEBUG run command: /usr/bin/docker cp elastic-package-stack-elastic-agent-1:/usr/share/elastic-agent/state/data/logs/ /tmp/test-system-240027907/logs/elastic-agent-internal
2024/01/22 18:40:50 DEBUG Dump stack logs for fleet-server
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:50 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs fleet-server
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:50 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:50 DEBUG run command: /usr/bin/docker cp elastic-package-stack-fleet-server-1:/usr/share/elastic-agent/state/data/logs/ /tmp/test-system-240027907/logs/fleet-server-internal
2024/01/22 18:40:50 DEBUG Dump stack logs for kibana
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:50 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs kibana
2024/01/22 18:40:50 DEBUG Dump stack logs for elasticsearch
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:50 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:50 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs elasticsearch
2024/01/22 18:40:51 DEBUG Dump stack logs for package-registry
2024/01/22 18:40:51 DEBUG running command: /usr/local/bin/docker-compose version --short
2024/01/22 18:40:51 DEBUG Determined Docker Compose version: 2.23.3
2024/01/22 18:40:51 DEBUG running command: /usr/local/bin/docker-compose -f /root/.elastic-package/profiles/default/stack/snapshot.yml -p elastic-package-stack logs package-registry
--- Test results for package: m365_defender - START ---
╭───────────────┬─────────────┬───────────┬───────────┬────────┬───────────────╮
│ PACKAGE       │ DATA STREAM │ TEST TYPE │ TEST NAME │ RESULT │  TIME ELAPSED │
├───────────────┼─────────────┼───────────┼───────────┼────────┼───────────────┤
│ m365_defender │ alert       │ system    │ default   │ PASS   │ 29.037944918s │
│ m365_defender │ incident    │ system    │ default   │ PASS   │ 23.722995351s │
│ m365_defender │ log         │ system    │ httpjson  │ PASS   │ 28.730290409s │
╰───────────────┴─────────────┴───────────┴───────────┴────────┴───────────────╯
--- Test results for package: m365_defender - END   ---
Done

@mohitjha-elastic mohitjha-elastic requested a review from a team as a code owner January 23, 2024 13:08
"tenantId": "b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c",
"title": "Suspicious execution of hidden file",
"description": "A hidden file has been launched. This activity could indicate a compromised host. Attackers often hide files associated with malicious tools to evade file system inspection and defenses.",
"recommendedActions": "Collect artifacts and determine scope\n�\tReview the machine timeline for suspicious activities that may have occurred before and after the time of the alert, and record additional related artifacts (files, IPs/URLs) \n�\tLook for the presence of relevant artifacts on other systems. Identify commonalities and differences between potentially compromised systems.\n�\tSubmit relevant files for deep analysis and review resulting detailed behavioral information.\n�\tSubmit undetected files to the MMPC malware portal\n\nInitiate containment & mitigation \n�\tContact the user to verify intent and initiate local remediation actions as needed.\n�\tUpdate AV signatures and run a full scan. The scan might reveal and remove previously-undetected malware components.\n�\tEnsure that the machine has the latest security updates. In particular, ensure that you have installed the latest software, web browser, and Operating System versions.\n�\tIf credential theft is suspected, reset all relevant users passwords.\n�\tBlock communication with relevant URLs or IPs at the organization�s perimeter.",
Copy link
Contributor

@efd6 efd6 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains invalid UTF-8. How was the data collected? (this is also true of the cases already in this file).

00006440  6e 64 20 64 65 74 65 72  6d 69 6e 65 20 73 63 6f  |nd determine sco|
00006450  70 65 5c 6e>ef bf bd<5c  74 52 65 76 69 65 77 20  |pe\n...\tReview |
00006460  74 68 65 20 6d 61 63 68  69 6e 65 20 74 69 6d 65  |the machine time|

0xef 0xbf 0xbd is 0xfffd which is the Unicode replacement character.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to the other additions. Can you explain why this is happening?

Comment on lines 44 to 64
if (['#microsoft.graph.security.analyzedMessageEvidence', '#microsoft.graph.security.mailboxEvidence', '#microsoft.graph.security.mailClusterEvidence'].contains(evidence["@odata.type"])) {
eventCategory.add('email');
eventType.add('info');
} else if (evidence["@odata.type"] == '#microsoft.graph.security.deviceEvidence') {
eventCategory.add('host');
eventType.add('info');
} else if (evidence["@odata.type"] == '#microsoft.graph.security.fileEvidence') {
eventCategory.add('file');
eventType.add('info');
} else if (evidence["@odata.type"] == '#microsoft.graph.security.ipEvidence') {
eventCategory.add('network');
eventType.add('info');
} else if (evidence["@odata.type"] == '#microsoft.graph.security.processEvidence') {
eventCategory.add('process');
eventType.add('info');
} else if (['#microsoft.graph.security.registryValueEvidence', '#microsoft.graph.security.registryKeyEvidence'].contains(evidence["@odata.type"])) {
eventCategory.add('registry');
eventType.add('access')
} else if (['#microsoft.graph.security.userEvidence', '#microsoft.graph.security.securityGroupEvidence'].contains(evidence["@odata.type"])) {
eventCategory.add('iam');
eventType.add('info');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be done with a param map for a look-up?

def processUserId = new HashSet();
def processUserName = new HashSet();
for (evidence in ctx.json.evidence) {
if (evidence?.odata_type != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for this first condition, can we invert the logic and continue instead. This will de-indent the rest of the loop body by one level.

Suggested change
if (evidence?.odata_type != null) {
if (evidence?.odata_type == null) {
continue
}

def processPid = new HashSet();
def processParentPid = new HashSet();
for (evidence in ctx.json.evidence) {
if (evidence.odata_type != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@efd6
Copy link
Contributor

efd6 commented Jan 24, 2024

/test

@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@mohitjha-elastic mohitjha-elastic requested a review from a team as a code owner January 30, 2024 08:54
@@ -0,0 +1 @@
{"@odata.type":"#microsoft.graph.security.alert","id":"da637551227677560813_-961444813","providerAlertId":"da637551227677560813_-961444813","incidentId":"28282","status":"new","severity":"low","classification":"unknown","determination":"apt","serviceSource":"microsoftDefenderForEndpoint","detectionSource":"antivirus","detectorId":"e0da400f-affd-43ef-b1d5-afc2eb6f2756","tenantId":"b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c","title":"Suspicious execution of hidden file","description":"A hidden file has been launched. This activity could indicate a compromised host. Attackers often hide files associated with malicious tools to evade file system inspection and defenses.","recommendedActions":"Collect artifacts and determine scope\n\ufffd\tReview the machine timeline for suspicious activities that may have occurred before and after the time of the alert, and record additional related artifacts (files, IPs\/URLs) \n\ufffd\tLook for the presence of relevant artifacts on other systems. Identify commonalities and differences between potentially compromised systems.\n\ufffd\tSubmit relevant files for deep analysis and review resulting detailed behavioral information.\n\ufffd\tSubmit undetected files to the MMPC malware portal\n\nInitiate containment & mitigation \n\ufffd\tContact the user to verify intent and initiate local remediation actions as needed.\n\ufffd\tUpdate AV signatures and run a full scan. The scan might reveal and remove previously-undetected malware components.\n\ufffd\tEnsure that the machine has the latest security updates. In particular, ensure that you have installed the latest software, web browser, and Operating System versions.\n\ufffd\tIf credential theft is suspected, reset all relevant users passwords.\n\ufffd\tBlock communication with relevant URLs or IPs at the organization\ufffds perimeter.","category":"DefenseEvasion","assignedTo":null,"alertWebUrl":"https:\/\/security.microsoft.com\/alerts\/da637551227677560813_-961444813?tid=b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c","incidentWebUrl":"https:\/\/security.microsoft.com\/incidents\/28282?tid=b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c","actorDisplayName":null,"threatDisplayName":null,"threatFamilyName":null,"mitreTechniques":["T1564.001"],"createdDateTime":"2021-04-27T12:19:27.7211305Z","lastUpdateDateTime":"2021-05-02T14:19:01.3266667Z","resolvedDateTime":null,"firstActivityDateTime":"2021-04-26T07:45:50.116Z","lastActivityDateTime":"2021-05-02T07:56:58.222Z","comments":[],"evidence":[{"@odata.type":"#microsoft.graph.security.analyzedMessageEvidence","createdDateTime":"2021-04-27T12:19:27.7211305Z","verdict":"unknown","remediationStatus":"none","remediationStatusDetails":null,"firstSeenDateTime":"2020-09-12T07:28:32.4321753Z","mdeDeviceId":"73e7e2de709dff64ef64b1d0c30e67fab63279db","azureAdDeviceId":null,"deviceDnsName":"tempDns","osPlatform":"Windows10","osBuild":22424,"version":"Other","healthStatus":"active","riskScore":"medium","rbacGroupId":75,"rbacGroupName":"UnassignedGroup","onboardingStatus":"onboarded","defenderAvStatus":"unknown","ipInterfaces":["1.1.1.1"],"loggedOnUsers":[],"roles":["compromised"],"detailedRoles":["Main device"],"tags":["Test Machine"],"vmMetadata":{"vmId":"ca1b0d41-5a3b-4d95-b48b-f220aed11d78","cloudProvider":"azure","resourceId":"\/subscriptions\/8700d3a3-3bb7-4fbe-a090-488a1ad04161\/resourceGroups\/WdatpApi-EUS-STG\/providers\/Microsoft.Compute\/virtualMachines\/NirLaviTests","subscriptionId":"8700d3a3-3bb7-4fbe-a090-488a1ad04161"}},{"@odata.type":"#microsoft.graph.security.analyzedMessageEvidence","createdDateTime":"2021-04-27T12:19:27.7211305Z","verdict":"unknown","remediationStatus":"none","remediationStatusDetails":null,"detectionStatus":"detected","mdeDeviceId":"73e7e2de709dff64ef64b1d0c30e67fab63279db","roles":[],"detailedRoles":["Referred in command line"],"tags":[],"fileDetails":{"sha1":"5f1e8acedc065031aad553b710838eb366cfee9a","sha256":"8963a19fb992ad9a76576c5638fd68292cffb9aaac29eb8285f9abf6196a7dec","fileName":"MsSense.exe","filePath":"C:\\Program Files\\temp","fileSize":6136392,"filePublisher":"Microsoft Corporation","signer":null,"issuer":null}},{"@odata.type":"#microsoft.graph.security.fileEvidence","createdDateTime":"2021-04-27T12:19:27.7211305Z","verdict":"unknown","remediationStatus":"none","remediationStatusDetails":null,"processId":4780,"parentProcessId":668,"processCommandLine":"\"MsSense.exe\"","processCreationDateTime":"2021-08-12T12:43:19.0772577Z","parentProcessCreationDateTime":"2021-08-12T07:39:09.0909239Z","detectionStatus":"detected","mdeDeviceId":"73e7e2de709dff64ef64b1d0c30e67fab63279db","roles":[],"detailedRoles":[],"tags":[],"imageFile":{"sha1":"5f1e8acedc065031aad553b710838eb366cfee9a","sha256":"8963a19fb992ad9a76576c5638fd68292cffb9aaac29eb8285f9abf6196a7dec","fileName":"MsSense.exe","filePath":"C:\\Program Files\\temp","fileSize":6136392,"filePublisher":"Microsoft Corporation","signer":null,"issuer":null},"parentProcessImageFile":{"sha1":null,"sha256":null,"fileName":"services.exe","filePath":"C:\\Windows\\System32","fileSize":731744,"filePublisher":"Microsoft Corporation","signer":null,"issuer":null},"userAccount":{"accountName":"SYSTEM","domainName":"NT AUTHORITY","userSid":"S-1-5-18","azureAdUserId":null,"userPrincipalName":null,"displayName":"System"}},{"@odata.type":"#microsoft.graph.security.registryKeyEvidence","createdDateTime":"2021-04-27T12:19:27.7211305Z","verdict":"unknown","remediationStatus":"none","remediationStatusDetails":null,"registryKey":"SYSTEM\\CONTROLSET001\\CONTROL\\WMI\\AUTOLOGGER\\SENSEAUDITLOGGER","registryHive":"HKEY_LOCAL_MACHINE","roles":[],"detailedRoles":[],"tags":[]}]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still has errer runes.

@efd6
Copy link
Contributor

efd6 commented Feb 5, 2024

/test

Copy link

@elasticmachine
Copy link

💚 Build Succeeded

History

@efd6 efd6 merged commit 5f36e2a into elastic:main Feb 5, 2024
5 checks passed
@elasticmachine
Copy link

Package m365_defender - 2.7.0 containing this change is available at https://epr.elastic.co/search?package=m365_defender

The Microsoft 365 Defender integration collects logs for three types of events: Event, Incident and Log.
The Microsoft 365 Defender integration collects logs for four types of events: Alert, Event, Incident and Log.

**Alert:** This data streams leverages the [M365 Defender Streaming API](https://learn.microsoft.com/en-us/graph/api/resources/security-alert?view=graph-rest-1.0) to collect alerts including suspicious activities in a customer's tenant that Microsoft or partner security providers have identified and flagged for action.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the "s" on data stream so it reads:

This data stream leverages the...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration: M365_Defender Team:Security-Service Integrations Security Service Integrations Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

M365 Defender Broken Assets with change from m365_defender.event -> m365_defender.incident
6 participants