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

[8.x] [UII] Restrict agentless integrations to deployments with agentless enabled (#194885) #196459

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…nabled (elastic#194885)

## Summary

Resolves elastic#192486. This PR makes it so that on deployments without
agentless enabled:
1. Agentless-only integrations are hidden from the browse integration UI
2. Agentless-only integrations cannot be installed via API (unless force
flag is used)

⚠️ elastic/package-registry#1238 needs to be
completed for the below testing steps to work. Currently EPR does not
return `deployment_modes` property which is necessary for Fleet to know
which packages are agentless.

## How to test

1. Simulate agentless being available by adding the following to
kibana.yml:
```
xpack.fleet.agentless.enabled: true

# Simulate cloud
xpack.cloud.id: "foo"
xpack.cloud.base_url: "https://cloud.elastic.co"
xpack.cloud.organization_url: "/account/"
xpack.cloud.billing_url: "/billing/"
xpack.cloud.profile_url: "/user/settings/"
```
2. Go to `Integrations > Browse` and enable showing Beta integrations,
search for `connector` and you should see the agentless integrations:
Elastic Connectors, GitHub & GitHub Enterprise Server Connector, Google
Drive Connector
3. Install any one of them (they all come from the same package), it
should be successful
4. Uninstall them
5. Remove config changes to go back to a non-agentless deployment
6. Refresh Integrations list, the three integrations should no longer
appear
7. Try installing via API, an error should appear
```
POST kbn:/api/fleet/epm/packages/elastic_connectors/0.0.2
```
8. Try installing via API again with force flag, it should be
successful:
```
POST kbn:/api/fleet/epm/packages/elastic_connectors/0.0.2
{
  "force": true
}
```

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 8cadf88)
@kibanamachine kibanamachine enabled auto-merge (squash) October 16, 2024 00:02
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 16, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibanamachine kibanamachine merged commit 34b0772 into elastic:8.x Oct 16, 2024
27 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1290 1291 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.8MB 1.8MB +717.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
fleet 74 75 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 171.6KB 171.8KB +173.0B
Unknown metric groups

API count

id before after diff
fleet 1413 1414 +1

ESLint disabled line counts

id before after diff
fleet 47 48 +1

Total ESLint disabled count

id before after diff
fleet 59 60 +1

cc @jen-huang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants