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

[microsoft_dhcp] changes/fix to set values for source and the right values for host; #… #7633

Merged
merged 17 commits into from
Nov 2, 2023

Conversation

xtruthx
Copy link
Contributor

@xtruthx xtruthx commented Sep 1, 2023

…7630

Type of change

  • Bug
  • Enhancement

What does this PR do?

Explainend in #7630

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.

Author's Checklist

  • Is the handling for the field object host complete and valid (not sure actually how they created normally)
  • Not sure about the test *-expected.json i adapt the non DHCPv6 as example like i think it should bee

Related issues

Pinging @elastic/integrations (Team:Integrations)

@xtruthx xtruthx requested a review from a team as a code owner September 1, 2023 07:58
@elasticmachine
Copy link

elasticmachine commented Sep 1, 2023

💚 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: 2023-11-02T07:04:25.120+0000

  • Duration: 16 min 17 sec

Test stats 🧪

Test Results
Failed 0
Passed 6
Skipped 0
Total 6

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

@xtruthx xtruthx changed the title changes/fix to set values for source and the right values for host; #… [microsoft_dhcp] changes/fix to set values for source and the right values for host; #… Sep 4, 2023
@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 2, 2023

Can some one look into this please? If i am wrong with my thoughts and the thoughts behind the merge request please let me know that. Ping @elastic/security-external-integrations

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

This seems reasonable. Please resolve the conflict and I will run the test build.

@efd6
Copy link
Contributor

efd6 commented Oct 3, 2023

Can you also resolve the conflict in the changelog (and ensure the manifest matches the resolution).

@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 19, 2023

Is there still something to do? did i miss something?

@efd6
Copy link
Contributor

efd6 commented Oct 22, 2023

/test

@efd6
Copy link
Contributor

efd6 commented Oct 22, 2023

Please run elastic-package build.

@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 23, 2023

i did a rebase with latest changes from main.
Ran the tests again and noticed that I just missed the failed tests for the pipeline The fields of the "host" object are filled by "observer", these are created by the agent. Do these also need to be in test-logs or where do I place these fields?

@efd6
Copy link
Contributor

efd6 commented Oct 23, 2023

/test

2 similar comments
@efd6
Copy link
Contributor

efd6 commented Oct 23, 2023

/test

@efd6
Copy link
Contributor

efd6 commented Oct 23, 2023

/test

@elasticmachine
Copy link

elasticmachine commented Oct 24, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (3/3) 💚
Classes 100.0% (3/3) 💚
Methods 95.238% (20/21)
Lines 97.585% (687/704)
Conditionals 100.0% (0/0) 💚

@efd6
Copy link
Contributor

efd6 commented Oct 24, 2023

/test

@efd6
Copy link
Contributor

efd6 commented Oct 24, 2023

@xtruthx Please check that the changes that I've made match your expected semantics.

To answer your question, yes, the agent adds those fields in automatically. They don't need to be added into the tests, but the pipeline does need to be robust to their absence. These are the changes that I've made.

@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 24, 2023

Thanks @efd6 . That looks great.
Ok I see, so it is better to work with "ignore_empty_value".
Also that the description of the fields must match with the ECS I got now.

Sorry for the stuttering in progress and thanks for the patience. In the next post I know now how to do it:) 😄

@efd6
Copy link
Contributor

efd6 commented Oct 26, 2023

/test

@efd6
Copy link
Contributor

efd6 commented Oct 26, 2023

The deconfliction needs to have an update to the manifest as well; this is an irritation with how merge conflict get resolved if you do it purely in a merge conflict editor.

@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 26, 2023

/test

@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 26, 2023

The deconfliction needs to have an update to the manifest as well; this is an irritation with how merge conflict get resolved if you do it purely in a merge conflict editor.

Done and sorry i forgot the manifest. Now i hope it looks good. Time hits me now.

@efd6
Copy link
Contributor

efd6 commented Oct 26, 2023

/test

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Thanks

@efd6
Copy link
Contributor

efd6 commented Oct 31, 2023

@xtruthx I'm just wondering whether client wouldn't be better than source; this is the terminology used in the MS documentation.

@xtruthx
Copy link
Contributor Author

xtruthx commented Oct 31, 2023

@efd6 I first thought about putting it into the ECS object 'client'. But then I thought it might be better to use 'source' so that it is also used correctly in the SIEM/Security in the Network overview. I am not sure if the field 'client.source' is also asked. I'll have a look at it again in a moment.

Additional:
This would be an example I think:
https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.ts#L26

But yes from the terminology it would not be wrong to use 'client'.

@efd6
Copy link
Contributor

efd6 commented Oct 31, 2023

Thanks.

@xtruthx
Copy link
Contributor Author

xtruthx commented Nov 2, 2023

@efd6 as it thank last

Thanks.

@efd6 i think that means yes please do the change and i did so.

When building the integration I got the following validation error:

README.md file rendered: /home/daniel/git/elastic/integrations-fork/packages/microsoft_dhcp/docs/README.md
2023/11/02 06:23:30  INFO License text found in "/home/daniel/git/elastic/integrations-fork/LICENSE.txt" will be included in package
2023/11/02 06:23:30  INFO Skipped errors: found 1 validation error:
   1. conditions.kibana.version must be ^8.10.0 or greater to include saved object tags file: kibana/tags.yml (SVR00005)
Package built: /home/daniel/git/elastic/integrations-fork/build/packages/microsoft_dhcp-1.23.0.zip
Done

I think it makes sense to act accordingly and I have set the kibana version to ^8..10.0 only.

I hope now the merge is possible soon

@efd6
Copy link
Contributor

efd6 commented Nov 2, 2023

i think that means yes please do the change and i did so.

Oh, sorry. "Thanks" was for the explanation. If source is commonly used in the rules then it makes sense to use it. But rather than more churn, I'll discuss this with others. So don't make any change on that yet.

I think it makes sense to act accordingly and I have set the kibana version to ^8..10.0 only.

We'd rather this wasn't done since it cuts off users. The validation error really should be noted as a warning rather than an error as it is not something that blocks the build.

Please revert that line change.

@efd6
Copy link
Contributor

efd6 commented Nov 2, 2023

We've had a discussion; please revert the source to client change.

@xtruthx
Copy link
Contributor Author

xtruthx commented Nov 2, 2023

sorry reverted

@efd6
Copy link
Contributor

efd6 commented Nov 2, 2023

/test

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Thanks

@efd6 efd6 merged commit 31da033 into elastic:main Nov 2, 2023
4 checks passed
@elasticmachine
Copy link

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

@xtruthx xtruthx deleted the microsoft_dhcp branch November 3, 2023 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[microsoft_dhcp] Wrong field name usage in processing conflict with the content host.name
4 participants