fleet/server
Roberto Dip 19f995d3b5
only include policies in device endpoints for premium users (#6077)
This removes policy information from `GET /api/_version_/fleet/device/{token}` from non-premium Fleet instances.

Starting the server with `./build/fleet serve --dev --dev_license`

```bash
$ curl -s https://localhost:8080/api/latest/fleet/device/1804e808-171f-4dda-9bec-f695b2f2371a | jq '.host.policies // "not present"'
[
  {
    "id": 3,
    "name": "Antivirus healthy (Linux)",
    "query": "SELECT score FROM (SELECT case when COUNT(*) = 2 then 1 ELSE 0 END AS score FROM processes WHERE (name = 'clamd') OR (name = 'freshclam')) WHERE score == 1;",
    "description": "Checks that both ClamAV's daemon and its updater service (freshclam) are running.",
    "author_id": 1,
    "author_name": "Roberto",
    "author_email": "test@example.com",
    "team_id": null,
    "resolution": "Ensure ClamAV and Freshclam are installed and running.",
    "platform": "darwin,linux",
    "created_at": "2022-05-23T20:53:36Z",
    "updated_at": "2022-06-03T13:17:42Z",
    "response": ""
  }
]
```

Starting the server with `./build/fleet serve --dev`

```bash
$ curl -s https://localhost:8080/api/latest/fleet/device/1804e808-171f-4dda-9bec-f695b2f2371a | jq '.host.policies // "not present"'
"not present"
```
2022-06-07 13:27:13 -03:00
..
authz Merge pull request from GHSA-pr2g-j78h-84cr 2022-04-18 10:27:30 -07:00
bindata Allow users to be readded if they were ever removed (#1945) 2021-09-07 13:33:40 -03:00
config Editor pass - Support per-task configuration for async host processing configuration (#5810) 2022-05-20 12:07:32 -05:00
contexts Fix some go lint warnings (#5888) 2022-05-31 07:19:57 -03:00
datastore Sync CVE scores periodically (#5838) 2022-06-01 10:06:57 -06:00
errorstore Fix some go lint warnings (#5888) 2022-05-31 07:19:57 -03:00
fleet only include policies in device endpoints for premium users (#6077) 2022-06-07 13:27:13 -03:00
health Fix documentation typos (#1682) 2017-12-21 18:37:32 -08:00
launcher Upgrade osquery-go (#4728) 2022-03-23 12:15:37 -03:00
live_query Migrate team-related endpoints to new pattern (#3740) 2022-01-19 10:52:14 -05:00
logging Sync CVE scores periodically (#5838) 2022-06-01 10:06:57 -06:00
mail update copyright year in core product transactional email templates (#3549) 2022-01-01 12:41:32 -06:00
mock Sync CVE scores periodically (#5838) 2022-06-01 10:06:57 -06:00
policies Support failing policies integrations (#5973) 2022-06-06 10:41:51 -04:00
ptr Include CVE scores when listing software (#5673) 2022-05-20 10:58:40 -06:00
pubsub Migrate team-related endpoints to new pattern (#3740) 2022-01-19 10:52:14 -05:00
service only include policies in device endpoints for premium users (#6077) 2022-06-07 13:27:13 -03:00
sso Fix SSO paths to always use /v1/ instead of /latest/ (#5246) 2022-04-20 12:46:45 -04:00
test Increase minimum password length to 12 characters (#5712) 2022-05-18 12:03:00 -05:00
vulnerabilities fix epss probability (#6083) 2022-06-03 11:37:47 -06:00
webhooks Support failing policies integrations (#5973) 2022-06-06 10:41:51 -04:00
websocket Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
worker Support failing policies integrations (#5973) 2022-06-06 10:41:51 -04:00
utils.go Modify /server/utils to handle all 2xx codes as POST success (#3534) 2021-12-30 16:00:10 -06:00