Skip to content

Updates related_integrations field API docs#5183

Merged
joepeeples merged 4 commits into
elastic:mainfrom
maximpn:allow-editing-related-integrations
Jul 5, 2024
Merged

Updates related_integrations field API docs#5183
joepeeples merged 4 commits into
elastic:mainfrom
maximpn:allow-editing-related-integrations

Conversation

@maximpn

@maximpn maximpn commented May 8, 2024

Copy link
Copy Markdown
Contributor

Relates to: elastic/kibana#173595
Epic: https://github.com/elastic/security-team/issues/1974

Summary

API updates for elastic/kibana#173595.

Updates related API docs for related_integration field changes made in elastic/kibana#178295.

@maximpn maximpn added Team: Detections/Response Detections and Response API Feature: Rules Docset: ESS Issues that apply to docs in the Stack release v8.15.0 labels May 8, 2024
@maximpn maximpn self-assigned this May 8, 2024
@maximpn
maximpn requested a review from a team as a code owner May 8, 2024 10:57
@github-actions

github-actions Bot commented May 8, 2024

Copy link
Copy Markdown

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

dplumlee
dplumlee previously approved these changes May 8, 2024

@dplumlee dplumlee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a few comments that apply to all the identical blocks as well but from a rules management definition pov, this looks good to me

|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:

* `package` (String, required): Integration package's name EPR uses
* `integration` (String, optional): Integration's name. It's optional for packages with the only one integration whose name matches package name but required for packages with multiple integrations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We might want to sort these by required and optional, although this is a weird field where in some cases it's optional and in others it's not

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dplumlee Yeah, if this was strictly optional all the time, I'd say re-order the list, but since it's a little of both it's good ordered as it is.

Comment thread docs/detections/api/rules/rules-api-create.asciidoc
@mergify

mergify Bot commented May 8, 2024

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @maximpn? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b allow-editing-related-integrations upstream/allow-editing-related-integrations
git merge upstream/main
git push upstream allow-editing-related-integrations

@joepeeples joepeeples left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @maximpn for creating these updates! Added a few suggestions and comments. I'm not sure what's causing the conflicts in the PR but will look at that next.


* `field_names`: String[] , required

|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:
|related_integrations |Object[] a| {integrations-docs}[Elastic integrations] the rule depends on. The object has these fields:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@joepeeples,

It seems vscode doesn't properly parse integrations-docs link and shows it as is. Is there a way to verify it locally?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@maximpn you can build the Security docs locally if you also have elastic/docs cloned on your machine. Run the command line build alias docbldsec --open to build the Security docs, and they'll open in a browser.

That can be a bit involved, so the PR preview from CI is another way to verify. I checked and the link resolves correctly.


|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:

* `package` (String, required): Integration package's name EPR uses

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some users might not know what EPR stands for, or maybe they're unfamiliar with Elastic Package Registry in general. I'm also wondering how they'd find out what a given package's name is; maybe we can add a link to help them find the integration/packages they're trying to add?

I tried looking for a list in elastic/package-registry but didn't find anything. Maybe elastic/integrations/tree/main/packages?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we have package name documented somewhere. For example this page shows integrations list. Package's name as well as integration's name are in fact identifies and hidden from users. UI fetches integrations list from EPR (of course not directly but via Fleet) and uses that ids for API requests. To be 100% sure about id correctness users should use EPR. EPR allows to search for a package while the package contains integrations. After that package or integration ids can be saved since these a stable.

@joepeeples what do you think the best approach to describe it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@maximpn Simpler is probably better; we can link users to the EPR repo, which documents the API requests that can help them search for the right packages and integrations.

Suggested change
* `package` (String, required): Integration package's name EPR uses
* `package` (String, required): The integration package's name, as used by the https://github.com/elastic/package-registry[Elastic Package Registry].

|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:

* `package` (String, required): Integration package's name EPR uses
* `integration` (String, optional): Integration's name. It's optional for packages with the only one integration whose name matches package name but required for packages with multiple integrations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `integration` (String, optional): Integration's name. It's optional for packages with the only one integration whose name matches package name but required for packages with multiple integrations.
* `integration` (String, optional): The integration's name. This field is optional for packages with only one integration whose name matches the package name, but it's required for packages with multiple integrations.

`PATCH` calls enabling and disabling the rule do not increment its version
number.

|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:
|related_integrations |Object[] a| {integrations-docs}[Elastic integrations] the rule depends on. The object has these fields:

|related_integrations |Object[] a| Fleet integrations the rule depends on. The object has three fields:

* `package` (String, required): Integration package's name EPR uses
* `integration` (String, optional): Integration's name. It's optional for packages with the only one integration whose name matches package name but required for packages with multiple integrations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `integration` (String, optional): Integration's name. It's optional for packages with the only one integration whose name matches package name but required for packages with multiple integrations.
* `integration` (String, optional): The integration's name. This field is optional for packages with only one integration whose name matches the package name, but it's required for packages with multiple integrations.

@mergify

mergify Bot commented May 22, 2024

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @maximpn? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b allow-editing-related-integrations upstream/allow-editing-related-integrations
git merge upstream/main
git push upstream allow-editing-related-integrations

@maximpn
maximpn force-pushed the allow-editing-related-integrations branch from acff659 to e8dbbbb Compare May 22, 2024 11:09
@maximpn

maximpn commented May 22, 2024

Copy link
Copy Markdown
Contributor Author

Hi @joepeeples,

I've updated the PR according to your comments. The last this left is to describe how to get a package name and a link to EPR documentation. Check my comment above.

Comment thread docs/detections/api/rules/rules-api-update.asciidoc Outdated
@maximpn

maximpn commented May 27, 2024

Copy link
Copy Markdown
Contributor Author

@joepeeples,

I've addressed your last comments. Could you review the recent changes?

@maximpn
maximpn requested a review from joepeeples May 27, 2024 12:40

@joepeeples joepeeples left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything looks good, and now that we have an 8.15 branch we can merge and backport to that.

@joepeeples
joepeeples merged commit c8aa530 into elastic:main Jul 5, 2024
mergify Bot pushed a commit that referenced this pull request Jul 5, 2024
* allow editing related integrations

* improve readability

* add an EPR link

---------

Co-authored-by: Joe Peeples <joe.peeples@elastic.co>
(cherry picked from commit c8aa530)
joepeeples pushed a commit that referenced this pull request Jul 5, 2024
* allow editing related integrations

* improve readability

* add an EPR link

---------

Co-authored-by: Joe Peeples <joe.peeples@elastic.co>
(cherry picked from commit c8aa530)

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
@maximpn
maximpn deleted the allow-editing-related-integrations branch July 9, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Docset: ESS Issues that apply to docs in the Stack release Feature: Rules Team: Detections/Response Detections and Response v8.15.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants