Skip to content

Commit

Permalink
[Fleet] added unprivileged mapping to kql validation (#183239)
Browse files Browse the repository at this point in the history
## Summary

Fixed error with new `unprivileged` field search when strict KQL
validation is turned on.

elastic/ingest-dev#3250 (comment)

To verify:
- enable KQL validation to `kibana.dev.yml`:
`xpack.fleet.enableExperimental: ['enableStrictKQLValidation']`
- start kibana and enroll an agent with docker
- search on `local_metadata.elastic.agent.unprivileged: true` in Agent
list UI
- expect no error

<img width="1340" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/e00c07eb-0e14-40b5-8ca6-6c559e25224b">
  • Loading branch information
juliaElastic authored May 14, 2024
1 parent a5dcc10 commit 230e789
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions x-pack/plugins/fleet/common/constants/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export const AGENT_MAPPINGS = {
},
},
},
unprivileged: {
type: 'boolean',
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('SearchBar', () => {

describe('getFieldSpecs', () => {
it('returns fieldSpecs for fleet-agents', () => {
expect(getFieldSpecs(`.${AGENTS_PREFIX}`)).toHaveLength(66);
expect(getFieldSpecs(`.${AGENTS_PREFIX}`)).toHaveLength(67);
});
it('returns getFieldSpecs for fleet-enrollment-api-keys', () => {
const indexPattern = `.${FLEET_ENROLLMENT_API_PREFIX}`;
Expand Down

0 comments on commit 230e789

Please sign in to comment.