diff --git a/changes/10631-updated-action-on-host-search b/changes/10631-updated-action-on-host-search new file mode 100644 index 0000000000..391a8a8d26 --- /dev/null +++ b/changes/10631-updated-action-on-host-search @@ -0,0 +1 @@ +Bug: Updated authorization action used on host/search endpoint \ No newline at end of file diff --git a/server/service/hosts.go b/server/service/hosts.go index a860d1a052..99897de4ed 100644 --- a/server/service/hosts.go +++ b/server/service/hosts.go @@ -324,7 +324,7 @@ func searchHostsEndpoint(ctx context.Context, request interface{}, svc fleet.Ser } func (svc *Service) SearchHosts(ctx context.Context, matchQuery string, queryID *uint, excludedHostIDs []uint) ([]*fleet.Host, error) { - if err := svc.authz.Authorize(ctx, &fleet.Host{}, fleet.ActionRead); err != nil { + if err := svc.authz.Authorize(ctx, &fleet.Host{}, fleet.ActionList); err != nil { return nil, err }