kibana/x-pack/test/fleet_api_integration/apis
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
..
agent_policy [UII] Restrict non-local ES output types for agentless integrations and policies (#207296) 2025-01-24 00:32:42 +00:00
agents [Fleet] Show reason for agent/endpoint uninstall (#205815) 2025-01-14 20:55:12 +00:00
data_streams FTR: enable ESLint mocha rules for api integration tests (#191267) 2024-08-30 18:50:35 +02:00
download_sources [Fleet] Fleet APIs using kbn/config-schema part 3 (#193698) 2024-10-03 09:09:14 +02:00
enrollment_api_keys [Fleet] Revert enrollment api key list removal (#200087) 2024-11-14 07:52:13 -05:00
epm [FTR] migrate p-retry usage to Retry service (#206088) 2025-01-16 13:19:14 +00:00
event_ingested [Fleet] added eventIngestedEnabled flag (#199733) 2024-11-13 12:41:40 +01:00
fixtures [Fleet] Remove deprecated ML job property from test fixtures (#207857) 2025-01-22 17:03:55 +00:00
fleet_proxies skip flaky suite (#207024) 2025-01-22 20:37:42 +00:00
fleet_server_hosts FTR: enable ESLint mocha rules for api integration tests (#191267) 2024-08-30 18:50:35 +02:00
integrations enable skipped inputs_with_standalone_docker_agent test (#202131) 2024-11-28 16:41:26 +01:00
outputs [Fleet] Remove deprecated topics property for kafka output in favor of topic (#199226) 2024-11-08 16:45:09 +01:00
package_policy [UII] Restrict non-local ES output types for agentless integrations and policies (#207296) 2025-01-24 00:32:42 +00:00
settings [Fleet] remove deprecated settings API endpoints (#198799) 2024-11-06 08:01:46 -05:00
space_awareness [Fleet] Fix migrating enrollment api keys for space awareness (#207847) 2025-01-22 16:24:51 +00:00
uninstall_token FTR: enable ESLint mocha rules for api integration tests (#191267) 2024-08-30 18:50:35 +02:00
fleet_settings_privileges.ts [Fleet] Adjust privileges for GET output and GET download_source endpoints (#194951) 2024-10-08 16:36:19 +02:00
fleet_setup.ts [FTR] migrate p-retry usage to Retry service (#206088) 2025-01-16 13:19:14 +00:00
fleet_telemetry.ts [Fleet] remove deprecated settings API endpoints (#198799) 2024-11-06 08:01:46 -05:00
index.js [Fleet] Add api integration test for subfeature privileges (#179574) 2024-04-02 09:21:01 +08:00
policy_secrets.ts [Fleet] Remove deprecated topics property for kafka output in favor of topic (#199226) 2024-11-08 16:45:09 +01:00
service_tokens.ts [Fleet] Remove deprecated APIs for agents endpoints (#198313) 2024-11-01 08:00:12 -04:00
test_users.ts [SecuritySolution] Breaking out timeline & note privileges (#201780) 2025-01-20 14:09:16 +01:00