Commit Graph

1155 Commits

Author SHA1 Message Date
Lucas Manuel Rodriguez
e926581427
Observers can observe team settings (#10447)
#9984

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- [X] Documented any permissions changes: Done by @noahtalerman, see
#10440
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- ~[ ] Manual QA for all new/changed functionality~
  - For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-13 15:34:39 -03:00
Lucas Manuel Rodriguez
3757aace08
Add UUID to Fleet errors and clean up error msgs (#10411)
#8129 

Apart from fixing the issue in #8129, this change also introduces UUIDs
to Fleet errors. To be able to match a returned error from the API to a
error in the Fleet logs. See
https://fleetdm.slack.com/archives/C019WG4GH0A/p1677780622769939 for
more context.

Samples with the changes in this PR:
```
curl -k -H "Authorization: Bearer $TEST_TOKEN" -H 'Content-Type:application/json' "https://localhost:8080/api/v1/fleet/sso" -d ''
{
  "message": "Bad request",
  "errors": [
    {
      "name": "base",
      "reason": "Expected JSON Body"
    }
  ],
  "uuid": "a01f6e10-354c-4ff0-b96e-1f64adb500b0"
}
```
```
curl -k -H "Authorization: Bearer $TEST_TOKEN" -H 'Content-Type:application/json' "https://localhost:8080/api/v1/fleet/sso" -d 'asd'
{
  "message": "Bad request",
  "errors": [
    {
      "name": "base",
      "reason": "json decoder error"
    }
  ],
  "uuid": "5f716a64-7550-464b-a1dd-e6a505a9f89d"
}
```
```
curl -k -X GET -H "Authorization: Bearer badtoken" "https://localhost:8080/api/latest/fleet/teams"
{
  "message": "Authentication required",
  "errors": [
    {
      "name": "base",
      "reason": "Authentication required"
    }
  ],
  "uuid": "efe45bc0-f956-4bf9-ba4f-aa9020a9aaaf"
}
```
```
curl -k -X PATCH -H "Authorization: Bearer $TEST_TOKEN" "https://localhost:8080/api/latest/fleet/users/14" -d '{"name": "Manuel2", "password": "what", "new_password": "p4ssw0rd.12345"}'
{
  "message": "Authorization header required",
  "errors": [
    {
      "name": "base",
      "reason": "Authorization header required"
    }
  ],
  "uuid": "57f78cd0-4559-464f-9df7-36c9ef7c89b3"
}
```
```
curl -k -X PATCH -H "Authorization: Bearer $TEST_TOKEN" "https://localhost:8080/api/latest/fleet/users/14" -d '{"name": "Manuel2", "password": "what", "new_password": "p4ssw0rd.12345"}'
{
  "message": "Permission Denied",
  "uuid": "7f0220ad-6de7-4faf-8b6c-8d7ff9d2ca06"
}
```

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [X] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-13 13:44:06 -03:00
Lucas Manuel Rodriguez
02ea8b104b
Remove attach check on queries and return proper bad request error (#10427)
Fixes both #10378 and
https://github.com/fleetdm/confidential/issues/2133

On `main`:
```sh
curl -v -k -X POST -H "Authorization: Bearer $TEST_TOKEN" \
https://localhost:8080/api/latest/fleet/queries/run \
-d '{ "query": "select \"With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves.\" as Rationale;" }'

< HTTP/2 500
< content-type: application/json; charset=utf-8
< content-length: 130
< date: Fri, 10 Mar 2023 17:50:40 GMT
<
{
  "message": "invalid query's SQL",
  "errors": [
    {
      "name": "base",
      "reason": "invalid query's SQL"
    }
  ]
}
```
With changes in this PR:
```sh
curl -v -k -X POST -H "Authorization: Bearer $TEST_TOKEN" \
https://localhost:8080/api/latest/fleet/queries/run \
-d '{ "query": "select \"With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves.\" as Rationale;", "selected": { "hosts": [57] } }'

< HTTP/2 200
< content-type: application/json; charset=utf-8
< content-length: 325
< date: Fri, 10 Mar 2023 17:49:40 GMT
<
{
  "campaign": {
    "created_at": "0001-01-01T00:00:00Z",
    "updated_at": "0001-01-01T00:00:00Z",
    "Metrics": {
      "TotalHosts": 1,
      "OnlineHosts": 1,
      "OfflineHosts": 0,
      "MissingInActionHosts": 0,
      "NewHosts": 0
    },
    "id": 87,
    "query_id": 85,
    "status": 0,
    "user_id": 1
  }
}
```

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-13 11:42:26 -03:00
Roberto Dip
a1ca172c95
allow to set up a DEP flow gated by Okta auth (#10338)
#10271
2023-03-13 10:33:32 -03:00
Juan Fernandez
56ed2727b5
Updated translation rules so that Docker Desktop can be mapped to the proper CPE (#10326)
Updated translation rules so that Docker Desktop can be mapped to the proper CPE.
2023-03-09 17:46:57 -04:00
Martin Angers
28c02448bf
Various mdm-related documentation fixes (#10398) 2023-03-09 09:53:40 -06:00
Martin Angers
0d6b9b98d4
Add mdm.macos_settings disk encryption fields to the response of GET /hosts/{id} and device. (#10371) 2023-03-08 15:42:23 -05:00
Jacob Shandling
4fb958770c
UI: Aggregate mac settings indicators (#10303)
**Addresses** #9415 

**Implements**
<img width="1225" alt="Screenshot 2023-03-03 at 3 29 06 PM"
src="https://user-images.githubusercontent.com/61553566/222854277-5585f6d7-cb4d-4946-881f-01f79bf8342a.png">

**Demo**
https://www.loom.com/share/1cb3dbb9a1194581be89102029b0d6ba

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` 
- [x] Updated [testing
inventory](https://docs.google.com/spreadsheets/d/1HyKnq7jTk4IJmDHVwU-x9kcH7bgvjDTxohML4hPGfK8/edit#gid=0)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-03-08 11:43:00 -08:00
Martin Angers
765c8754b6
Add enabled/disabled disk encryption activities and trigger profiles generation (#10319) 2023-03-08 08:31:53 -05:00
RachelElysia
04169ec84b
Fleet UI: Critical icon on policy table (#10313) 2023-03-06 15:57:15 -05:00
Roberto Dip
074ea7dc8d
add config values for MDM Okta integration (#10295)
For #10228 , all new config values are automagically tested by
`TestConfigRoundtrip`.
2023-03-06 14:47:29 -03:00
Martin Angers
50a2739609
Allow updating enable_disk_encryption via the Modify Team endpoint (#10208) 2023-03-06 09:54:51 -05:00
gillespi314
36ac72d697
Add mdm profiles status filter to hosts endpoints (#10246) 2023-03-03 18:19:46 -06:00
RachelElysia
db9ed90b0c
CIS - WIN10 - 9.3.X policies (#10253) 2023-03-03 13:37:03 -05:00
gillespi314
21c6733c1b
Release schedule lock when triggered run spans schedule interval (#10240) 2023-03-03 12:14:10 -06:00
RachelElysia
82e81a7b06
CIS - WIN10 - 9.2.X policies (#10254) 2023-03-03 13:13:09 -05:00
RachelElysia
0b4ae4f621
CIS - WIN10 - 18.X.X policies (#10286) 2023-03-03 12:52:18 -05:00
RachelElysia
6b2cebd4f1
CIS - WIN10 - 2.3.17.X (#10275) 2023-03-02 17:18:02 -05:00
gillespi314
615052a9ac
Create new API endpoint to provide aggregate status count of MDM profiles applying to hosts (#10194) 2023-03-01 18:36:59 -06:00
Lucas Manuel Rodriguez
9864048ee9
Allow setting user roles during JIT provisioning (#10193)
#8411

PS: I've opened #10209 to solve the issue with Golang Code Coverage CI
checks.

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- ~[] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [x] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-01 20:18:40 -03:00
StepSecurity Bot
fb152b9114
Pin image SHA in Dockerfiles (#10205)
## Summary

This pull request is created by [Secure
Repo](https://app.stepsecurity.io/securerepo) at the request of @zwass.
Please merge the Pull Request to incorporate the requested changes.
Please tag @zwass on your message if you have any questions related to
the PR. You can also engage with the
[StepSecurity](https://github.com/step-security) team by tagging
@step-security-bot.

## Security Fixes

### Secure Dockerfiles

Pin image tags to digests in Dockerfiles. With the Docker v2 API
release, it became possible to use digests in place of tags when pulling
images or to use them in FROM lines in Dockerfiles.

- [The Open Source Security Foundation (OpenSSF) Security
Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies)


## Feedback
For bug reports, feature requests, and general feedback; please create
an issue in
[step-security/secure-repo](https://github.com/step-security/secure-repo).
To create such PRs, please visit https://app.stepsecurity.io/securerepo.


Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>

---------

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2023-03-01 11:37:00 -08:00
RachelElysia
4c80e1808b
CIS - WIN10 - 2.3.10.X policies (#10178) 2023-03-01 10:28:45 -05:00
Martin Angers
4593c49ec4
Add disk_encryption option to config and team YAML (#10185) 2023-02-28 15:34:46 -05:00
RachelElysia
7408a0df90
Fleet UI: Show query button added to policy results page (#10164) 2023-02-28 12:55:56 -05:00
Martin Angers
e3ddb5f3ce
Support matching a host in orbit enrollment using the serial number (#9612) 2023-02-28 12:55:04 -05:00
Luke Heath
71f2a62b4c
Prepare for 4.28.0 (#10103) 2023-02-27 15:19:15 -08:00
gillespi314
6fec539fbf
Update API responses for hosts and labels endpoints to include host mdm info (#10141)
Issue #10126 

- Add mdm solution name to host mdm inf
- Add host mdm info in labels API response;
2023-02-27 18:40:34 -03:00
RachelElysia
1a37f9bf5a
Fleet UI: Use app context currentTeam as source of truth for teamId (#10118) 2023-02-27 11:06:18 -06:00
Juan Fernandez
7e366272c0
Feature 9386: Parse the Mac Office release notes for vulnerability processing (#9993)
This PR adds the capability of parsing the release notes posted in https://learn.microsoft.com/en-us/officeupdates/release-notes-office-for-mac into a JSON metadata file (to be released in the NVD repo) and use it for detecting vulnerabilities on Mac Office apps.
2023-02-24 14:18:25 -04:00
Gabriel Hernandez
75a0436f12
max height for org logo images, ensured consistant nav height (#10095) 2023-02-24 11:27:39 -06:00
RachelElysia
ea42eff8e4
Fleet UI: Saving policy platforms always successful even if incompatible (#10058) 2023-02-24 10:38:29 -05:00
RachelElysia
dbaa25104e
Fleet UI: Wrap activity feed (#10075) 2023-02-24 09:05:42 -05:00
Benjamin Edwards
f3b0e4da72
add configuration parameters for filesystem logging file rotation (#10048) 2023-02-24 07:44:56 -05:00
RachelElysia
b4330c873e
Fleet UI: Fix host count for hosts filtered by operating system version (#10070) 2023-02-23 13:50:11 -05:00
RachelElysia
549a7c7fd8
Fleet UI: Use currentTeam.id from app context to set teamId for API calls on Manage host page (#10053) 2023-02-23 11:37:09 -05:00
Zach Wasserman
7c9454c92d
Changes in Fleet server to support Fleetd for Chrome (#10047)
These are minor changes needed to support the new ChromeOS extension.
This should have no effect on non-Chrome platforms.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2023-02-23 09:18:04 -03:00
RachelElysia
1dcf9781ab
Fleet UI: Select targets distributed interval tooltips (#9975) 2023-02-22 16:27:02 -05:00
Jacob Shandling
ba34351f4b
UI: Implement new activity types for macOS profiles (#9894)
# Addresses #9595

# Implements

- new Activity types:
    - CreatedMacOSProfile
    - DeletedMacOSProfile
    - EditedMacOSProfile
- Activity message depends on isPremium:
- true: '...macOS hosts with no team' or '...macOS hosts assigned to the
**Team Name** team {?via fleetctl}.'
    - false: '...{to | from | for} all macOS hosts.'
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`
- [ ] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-02-22 10:42:40 -08:00
Lucas Manuel Rodriguez
407d05eab9
Workaround to set policy specs on a team (#9978)
For the CIS benchmark feature, we need a way to import a group of
policies (spec yml) into a team.
This PR adds a flag to `apply -f` to allow setting a team name to a
group of policies.

Sample:
```sh
fleetctl apply --context dogfood --policies-team "📊 CIS Benchmarks" -f ee/cis/macos-13/cis-policy-queries.yml
```

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [ ] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-22 13:14:53 -03:00
Jacob Shandling
a578e20930
UI: Add macOS settings (profiles) indicator and modal with data table (#9809)
# Addresses #9413

# Implements
https://www.loom.com/share/d1b66a3076b94bf2add4fcf8666649a4

- macOS settings indicator on host details and device user pages. Only
displayed if (1) the host is enrolled in a Fleet MDM server and (2) the
host has at least one setting (profile) enforced.
- macOS settings modal, toggled by clicking on above indicator. Contains
a data table with the name, status, and error messages, if any, of each
enforced macOS setting on the host.

# Notes
- To aid in reviewing, you'll probably want to focus on:
-
[DeviceUserPage.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-be9f14d3cee9f345058212985c26b3452688c6d75853a5e9dcb968a69dfcbbd7)
and
[HostDetailsPage.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-72f7403682d211fc8a84a411fc39c4a33c3eb6a33549a33f1179dd7da6a893cc)
-
[HostSummary.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-435e720f1ad82e892bec00fbc9c14e01e9488b776ae293f9158500c66d85bd0d)
-
[MacSettingsIndicator.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-e23079f72b13bd34eb978eded467265dad4f366a6fece60cd52c887f355f92d1)
-
[MacSettingsModal.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-75a08aa5b66cc2b63fc616d8ba012e552376f23d3c3df01d875586857f326f53)
-
[MacSettingsTable.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-5dc441b06f770f112bb32bb618e2140e9bbccb7ebf80d86ee57c2754e067a421)
and its associated
[MacSettingsTableConfig.tsx](https://github.com/fleetdm/fleet/pull/9809/files#diff-0ab0cb34e249e2a41bf51508d38bea018dc5e683b705308250241c42549ab093)
   
- Currently using mock data. Once #9599 is completed, #9888 will change
these components to use the real data
- 2/21 - removed mock data. Until the API returns the host.mdm.profiles
data, settings indicator and modal will not render
# Checklist

- [x] Changes file added
- [x] Manual QA
- [x] Updated testing inventory

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-02-22 08:13:12 -08:00
RachelElysia
37c90502a6
Fleet UI: Select targets logic for "All hosts" to be mutually exclusive from other filters (#9992) 2023-02-22 10:32:43 -05:00
RachelElysia
dbec2f85df
Fleet UI: Consistent URL validation (#9806) 2023-02-22 09:05:38 -05:00
Gabriel Hernandez
a11e2cce3d
implement UI for uploading, downloading, deleting macOS profiles (#9901)
relates to #9593 

Implements the UI for users to upload, download, and delete macos
profiles


![image](https://user-images.githubusercontent.com/1153709/219685914-6f44e77b-c2cb-47c3-897d-1ba137510fed.png)

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2023-02-21 15:31:19 +00:00
RachelElysia
7f6a42e4ac
Fleet UI: Undetermined public ip tooltip (#9907) 2023-02-21 09:16:38 -05:00
Martin Angers
c3a9a1cd94
Fix panic when loading mdm-enrolled host by orbit key and is_server is null (#9957) 2023-02-21 08:41:04 -05:00
Zach Wasserman
7b1e63189e
Fix macOS pkg file permission warnings (#9940)
Fixes warnings reported by Suspicious Package about the declared
permissions not matching the actual permissions. This was tested on
macOS and Linux (in the `fleetdm/fleetctl` Docker container) with the
"native tooling" option.

#7852

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2023-02-20 14:29:49 -08:00
RachelElysia
b8811f04e5
Fleet UI: Add source link to query table side panel (#9948) 2023-02-20 15:39:57 -05:00
Zach Wasserman
ec8067e9b3
Remove Rosetta requirement for macOS installers (#9933)
Even though the binaries are "universal" (compatible with both arm64 and
x86_64), this configuration must be provided in the Distribution XML in
order to prevent macOS from installing Rosetta when the user goes to
install the package. Verified with Suspicious Package.

For #9932

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Manual QA for all new/changed functionality
2023-02-20 09:24:38 -08:00
Martin Angers
fa695cef34
Fix server URL for hosts enrolled in Fleet MDM (#9952) 2023-02-20 12:16:56 -05:00
Roberto Dip
314e8fe3d5
standardize a default value for empty cells (#9899) 2023-02-17 15:25:28 -03:00