Skip to content

Fixes known devices values absent in Sophos policy - #1888

Merged
r00tu53r merged 7 commits into
elastic:masterfrom
r00tu53r:fix/sophos-xg-known-devices-issue
Oct 11, 2021
Merged

Fixes known devices values absent in Sophos policy#1888
r00tu53r merged 7 commits into
elastic:masterfrom
r00tu53r:fix/sophos-xg-known-devices-issue

Conversation

@r00tu53r

@r00tu53r r00tu53r commented Oct 11, 2021

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes known devices values absent in Sophos policy

  • YAML values entered into 'Known Devices' (known_devices) variable
    are absent in policy when assigning Sophos integration to policy.
  • Embeds yaml value as an object instead of iterating over it.

Closes #1071

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.

How to test this PR locally

elastic-package test system

Related issues

* YAML values entered into 'Known Devices' (known_devices) variable
  are absent in policy when assigning Sophos integration to policy.
* Embeds yaml value as an object instead of iterating over it.

Closes elastic#1071
@r00tu53r r00tu53r added bug Something isn't working, use only for issues Team:Security-External Integrations labels Oct 11, 2021
@elasticmachine

Copy link
Copy Markdown

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

@r00tu53r
r00tu53r requested review from P1llus and marc-gr October 11, 2021 03:05
@elasticmachine

elasticmachine commented Oct 11, 2021

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-11T11:56:32.631+0000

  • Duration: 24 min 59 sec

  • Commit: ddd3521

Test stats 🧪

Test Results
Failed 0
Passed 13
Skipped 0
Total 13

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@P1llus P1llus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but we should test if this actually works as well. Would you mind adding an example config in to the _dev/system folder for the xg datastream?

There should be a format like this there already:

data_stream:
  vars:
    paths:
      - "{{SERVICE_LOGS_DIR}}/sophos-xg*.log"

And under vars you can add your known_devices object you can add maybe 1-2 known_devices?

You can use the serial number: 1234567890123456 and S4000806149EE49 and 2 random example hostnames.

Example system test with variables:
https://github.com/elastic/integrations/blob/master/packages/microsoft_dhcp/data_stream/log/_dev/test/system/test-default-config.yml

* Add known_devices to system test variables
* Add known_devices to system test variables
…3r/integrations into fix/sophos-xg-known-devices-issue
@r00tu53r

Copy link
Copy Markdown
Contributor Author

@P1llus Thanks. I have added known_devices to the system tests. Does this look okay? I ran the system tests they are passing.

@P1llus

P1llus commented Oct 11, 2021

Copy link
Copy Markdown
Member

Looks good @r00tu53r , though I would have expected the output of the system test to also have become updated.
Did you generate new system output with (while elastic-package stack up -d -v):
elastic-package test system -v --generate

It should update the sample_event.json in the package

@r00tu53r

Copy link
Copy Markdown
Contributor Author

Thanks again @P1llus I've added the generated sample event file. I see the known devices entry in there.

@P1llus P1llus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All good to merge

@P1llus

P1llus commented Oct 11, 2021

Copy link
Copy Markdown
Member

You need to run elastic-package build in the sophos folder to regenerate the readme, and add it to this commit, so that CI passes.

@r00tu53r
r00tu53r merged commit 60df5a9 into elastic:master Oct 11, 2021
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
* YAML values entered into 'Known Devices' (known_devices) variable
  are absent in policy when assigning Sophos integration to policy.
* Embed yaml value as an object instead of iterating over it.
* Update system tests for sophos xg
  - Add known_devices to system test variables
* Generate sample event with known_devices entries
* Update README.md

Closes elastic#1071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working, use only for issues

3 participants