kibana/x-pack/test/fleet_api_integration
Jen Huang d4cc532919
[UII] Restrict non-local ES output types for agentless integrations and policies (#207296)
## Summary

Resolves #202090.
Incidentally also fixes and unskips the failing test reported in
#203346.

This PR makes it so that:

- Agentless agent policies and package policies (those with
`supports_agentless: true` set) cannot be directly set to use a
non-local ES output for integration data
  - This restriction applies to UI and API level
- When a non-local ES output would be updated to be the global Fleet
default integration data output, existing agentless policies without an
explicit output set will have their output directly set to the current
default output ID
- This is the same mechanism used today to ensure that Fleet Server and
Synthetics integrations do not accidentally have their output set to
non-ES as well

## Testing
1. Apply
[patch](https://gist.github.com/jen-huang/dfc3e02ceb63976ad54bd1f50c524cb4)
to skip actual agentless creation
2. Create different types of outputs in addition to default local ES
3. Enable beta integrations
4. Add an agentless integration, for example Box Connector, observe that
outputs list only shows ES outputs:
<img width="1422" alt="image"
src="https://github.com/user-attachments/assets/72e43220-702f-4bb7-8e37-8be69aa4e6ea"
/>
5. Switch to agent-based setup technology, observe that outputs list now
shows all outputs
6. Create the agentless integration, go to its agent policy
7. Observe that outputs list only enables ES outputs:
<img width="1425" alt="image"
src="https://github.com/user-attachments/assets/3bc5985f-07bf-407a-8b62-4248b28904a5"
/>
8. Play around with setting global default outputs, it should be not
possible to get into a state where an agentless policy is using a
non-local ES output

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-24 00:32:42 +00:00
..
apis [UII] Restrict non-local ES output types for agentless integrations and policies (#207296) 2025-01-24 00:32:42 +00:00
config.agent.ts [functional tests] split fleet_api_integration config into smaller ones (#156407) 2023-05-03 16:26:58 +02:00
config.agent_policy.ts [functional tests] split fleet_api_integration config into smaller ones (#156407) 2023-05-03 16:26:58 +02:00
config.base.ts [Fleet] Added required_versions to agent policy and API with validation (#206600) 2025-01-16 09:18:34 +01:00
config.epm.ts [functional tests] split fleet_api_integration config into smaller ones (#156407) 2023-05-03 16:26:58 +02:00
config.event_ingested.ts [Fleet] added eventIngestedEnabled flag (#199733) 2024-11-13 12:41:40 +01:00
config.fleet.ts [functional tests] split fleet_api_integration config into smaller ones (#156407) 2023-05-03 16:26:58 +02:00
config.package_policy.ts [functional tests] split fleet_api_integration config into smaller ones (#156407) 2023-05-03 16:26:58 +02:00
config.space_awareness.ts [Fleet] Clean up feature flag enablePackagesStateMachine (#191052) 2024-08-26 04:18:32 -05:00
helpers.ts [Fleet] Use multiple saved object type for agent and package policies with opt-in migration (#189387) 2024-08-14 17:22:01 -04:00
privileges_helpers.ts [FTR] move supertestWithoutAuth service to kbn-ftr-common-functional-services (#189613) 2024-08-05 04:20:38 -05:00