[Fleet] GET fleet/agent_policies returns space ids unavailable to the user #201400
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Fleet
Team label for Observability Data Collection Fleet team
This was discovered while investigating #193827.
Description
GET fleet/agent_policies
always returns all space ids assigned to each agent policy. This means that a user with access to only some of these spaces is able to see the ids of unavailable spaces.In contrast,
GET fleet/agent_policies/<policyId>
returns?
for space ids unavailable to the user.Expectation
GET fleet/agent_policies
should return?
for unavailable spaces.Explanation
This difference comes from the Saved Object API.
GET fleet/agent_policies
is handled byagentPolicy.list
, which usessoClient.find
, which returns all the space ids:kibana/x-pack/plugins/fleet/server/services/agent_policy.ts
Lines 615 to 618 in 04d04d9
In contrast,
GET fleet/agent_policies/<policyId>
is handled byagentPolicy.get
, which usessoClient.get
, which returns?
for unavailable space ids:kibana/x-pack/plugins/fleet/server/services/agent_policy.ts
Line 480 in 04d04d9
Steps to reproduce
GET fleet/agent_policies
GET fleet/agent_policies/<policyId>
The text was updated successfully, but these errors were encountered: