Skip to content

[network_traffic] Add missing field mappings in DNS and TLS#3078

Merged
andrewkroh merged 7 commits intoelastic:mainfrom
andrewkroh:network_traffic/bugfix/add-missing-field-mappings
Apr 19, 2022
Merged

[network_traffic] Add missing field mappings in DNS and TLS#3078
andrewkroh merged 7 commits intoelastic:mainfrom
andrewkroh:network_traffic/bugfix/add-missing-field-mappings

Conversation

@andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Apr 12, 2022

What does this PR do?

A user reported missing mappings for the following fields which caused a conflict with ECS data types.

  • dns.answers.ttl
  • tls.server.not_after
  • tls.server.not_before
  • tls.server.x509.not_after
  • tls.server.x509.not_before
  • tls.server.x509.version_number

dns.answers is an array of objects and IIUC elastic-package does not validate this data type. So I added the ECS dns.answer.* fields.

For tls we did not have a system test in place that generated tls.server fields so I added one. This uncovered some issues and inconsistencies between Agent 7.17 and 8.2.

  • Add mappings from ECS tls.*.
  • Remove tls.detailed.{client,server}_certificate (legacy/pre-ECS fields that are now duplicated into ECS fields).
  • Update dashboards to use tls.{client,server}.x509.* instead of tls.detailed.{client,server}_certificate.*.
  • Remove mappings for 'province'. Those fields was renamed in Packetbeat 7.9 to state_or_province (per ECS) ([Packetbeat] ECS 1.5 update beats#19167).

I also found some event.* fields that were not documented due to elastic/elastic-package#147.

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.

@andrewkroh andrewkroh added bug Something isn't working, use only for issues Team:Security-External Integrations Integration:network_traffic Network Packet Capture labels Apr 12, 2022
@andrewkroh andrewkroh requested a review from a team as a code owner April 12, 2022 21:37
@elasticmachine
Copy link

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

@elasticmachine
Copy link

elasticmachine commented Apr 12, 2022

💚 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: 2022-04-13T21:54:43.886+0000

  • Duration: 67 min 48 sec

Test stats 🧪

Test Results
Failed 0
Passed 264
Skipped 0
Total 264

🤖 GitHub comments

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

  • /test : Re-trigger the build.

[git-generate]
cd packages/network_traffic
for ds in $(ls data_stream); do yq -i '. | sort_by(.name)' data_stream/$ds/fields/ecs.yml; done
for ds in $(ls data_stream); do yq -i 'sort_keys(..)' data_stream/$ds/fields/ecs.yml; done
elastic-package format
Arrays fields are not validated by elastic-package so these were missed.
Add another TLS test case to expose more TLS fields.
Import ECS mappings for all of `tls.*`.
Convert tls.*.x509.version_number to string
Remove unused tls.*.x509.version mapping
@andrewkroh andrewkroh marked this pull request as draft April 13, 2022 04:34
- Remove tls.detailed.{client,server}_certificate.
- Update dashboards to use tls.{client,server}.x509.* instead of tls.detailed.{client,server}_certificate.*
- Remove mappings for 'province'. Those fields was renamed in Packetbeat 7.9 to state_or_province (per ECS) (elastic/beats#19167).
[git-generate]
cd packages/network_traffic
elastic-package build
[git-generate]
cd packages/network_traffic
elastic-package-changelog add-next -d "Add missing field mappings to DNS and TLS data streams." --type=bug --pr 3078
@andrewkroh andrewkroh marked this pull request as ready for review April 13, 2022 23:08
Copy link
Contributor

@r00tu53r r00tu53r left a comment

Choose a reason for hiding this comment

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

LGTM

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 Integration:network_traffic Network Packet Capture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants