Commit Graph

103 Commits

Author SHA1 Message Date
gillespi314
c42f8230f7
Check assigned DEP in Orbit MDM migration (#13232) 2023-08-10 17:36:34 -05:00
Roberto Dip
11a78e27db
Avoid migration actions if the host is already enrolled into Fleet (#12882)
for #12068
2023-07-20 19:08:08 -03:00
Marcos Oviedo
821f6b064f
Adding support for GetPolicies message (#12477)
This relates to #12262 

- [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-06-27 12:59:33 -03:00
Lucas Manuel Rodriguez
7a33a108cb
Add --verbose flag to fleetd_tables (needed when osqueryd runs in verbose mode) (#12504)
Found while load testing the macOS CIS benchmark policy queries using
`fleetd_tables` as an extension (#10292).

Basically, osqueryd passes the `--verbose` flag to the extension, so we
need to add it here to not fail the extension execution.
2023-06-27 10:42:48 -03:00
Martin Angers
ca02abb660
Trigger Windows MDM host enrollment on device when notified that it is enabled (#12426) 2023-06-26 12:13:17 -04:00
Roberto Dip
1eb1e93e26
don't automatically kickstart softwareupdated in Orbit (#12072)
Related to #11777, this disables the kickstart of softwareupdated in
Orbit.

I have kept the `--disable-kickstart-softwareupdated` for backwards
compatibility, but it doesn't have any effect anymore.
2023-06-02 12:33:40 -03:00
Roberto Dip
e57f90fbac
fix display issues with screenshot in MDM migration flow (#11866)
For #11858, I reproduced the issue by running a local server behind
ngrok, _with the exact_ same path as the one in the website:
`https://server-url/images/permanent/mdm-migration-screenshot-768x180@2x.png`

I tried multiple combinations, but at the end, removing the `@` made the
trick. My guess is that's something to do with the markdown parser
library used by swiftDIalog.

I also removed a rogue `\` that was being displayed.
2023-05-23 14:29:42 -03:00
Roberto Dip
8829b84a63
add migration support to FD and orbit (#11741)
https://github.com/fleetdm/fleet/issues/11534
2023-05-18 14:21:54 -03:00
Juan Fernandez
827c4a7c33
Feature 8058: Added resource.syso metadata file (#10783)
Addresses https://github.com/fleetdm/fleet/issues/8058, https://github.com/fleetdm/fleet/issues/11012 and https://github.com/fleetdm/fleet/issues/11013

This PR adds a new VERSIONINFO metadata file using the
https://github.com/josephspurrier/goversioninfo library.
2023-05-17 18:53:25 -03:00
Roberto Dip
4dd127d577
base logic to show/hide the new Migrate to Fleet FD menu (#11679)
Related to #11670
2023-05-15 17:00:52 -03:00
Lucas Manuel Rodriguez
7dadec3ecf
Add mTLS support to fleetd (#11319)
#7970

- [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:
- [x] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [x] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
2023-04-27 08:44:39 -03:00
Roberto Dip
670492c129
Write an enroll secret to osquery when it's read from config profile (#11066)
#11065

Since `secret.txt` is written when the installer is built, but
installers using `--use-system-config` don't have an enroll secret at
build time, this file was empty and causing osquery to have trouble
enrolling.

This PR writes the file when the values are read from a configuration
profile.
2023-04-07 19:34:16 -03:00
Roberto Dip
1516caad46
explicitly enable orbit to read config from the system (#10980)
in #10134 we added a silent mechanism to try to read configuration
values from macOS configuration profiles if --fleet-url and
--enroll-secret weren't present.

while using this logic to test #9459 I have found that there's a race
condition where sometimes `fleetd` is installed before the configuration
profile with the values delivered by Fleet, causing orbit to get stuck
forever.

I added logic to loop every 30 seconds and try to fetch the values again
if none are found, but I didn't felt comfortable adding this logic
without also adding an extra flag to explicitly enable this behavior.
2023-04-05 15:02:18 -03:00
Benjamin Edwards
879d02c219
add simple go osquery extension & readme to register orbit tables (#10795)
closes https://github.com/fleetdm/fleet/issues/10708

New osquery extension & readme that describes how to build and get
osqueryd to autoload.
2023-03-31 10:39:13 -04:00
Roberto Dip
61a8a80514
allow to rotate disk encryption key from My Device (#10592)
Related to https://github.com/fleetdm/fleet/issues/8961

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2023-03-20 16:14:07 -03:00
Lucas Manuel Rodriguez
5ec4fab440
Orbit to set --database_path when invoking osquery to retrieve system info (#10308)
#9132

The actual fix for the empty hosts is adding the `--database_path`
argument in the initial `osqueryd -S` invocation when retrieving the
UUID. Osquery attempts to retrieve the UUID from OS files/APIs, when not
possible (which is what happens on some linux distributions), then it
resorts to generating a new random UUID and storing it in the
`osquery.db`. The issue was Orbit's first invocation of `osqueryd -S`
was not using the same `osquery.db` as the main daemon invocation of
`osqueryd`.

I'm also adding a `hostname` + `platform` to the orbit enroll phase so
that if there are any issues in the future we can avoid the "empty" host
and have some information to help us troubleshoot.

## How to reproduce

On Linux, osquery reads `/sys/class/dmi/id/product_uuid` to load the
hardware UUID.
Some Linux distributions running on specific hardware or container
environments do not have such file available.
The way to reproduce on a Linux VM is to do the following:
```sh
$ sudo su
# chmod -r /sys/class/dmi/id/product_uuid
```
which will turn the file inaccessible to root.

## Checklist

- [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~
- [X] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [X] 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.
- [x] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
2023-03-13 18:54:18 -03:00
Marcos Oviedo
b15f2b877b
Issue 10300 self healing (#10335)
This relates to #10300 

# 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
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows,
and Linux.
- [X] Auto-update manual QA from the released version of the component
to the new version (see [tools/tuf/test](../tools/tuf/test/README.md))
---------

Co-authored-by: Lucas Rodriguez <lucas@fleetdm.com>
2023-03-08 14:49:03 -03:00
Roberto Dip
af6d4059b9
Read enroll-secret and fleet-url from config profile on macOS (#10134)
This allows orbit to read enroll-secret and fleet-url from a
configuration profile if both values are not set when the package is
built.

Part of https://github.com/fleetdm/fleet/issues/9459
2023-02-28 15:54:06 -03:00
Martin Angers
e3ddb5f3ce
Support matching a host in orbit enrollment using the serial number (#9612) 2023-02-28 12:55:04 -05:00
Roberto Dip
fb2400c966
launch Nudge using /usr/bin/open (#10051)
this accomplishes two things:

1. We're not waiting on Nudge to exit anymore, preventing issues like
https://github.com/fleetdm/fleet/issues/10044
2. Nudge is launched as a local user instead of root, which is the
recommended way to do it.
2023-02-23 14:48:40 -03:00
Lucas Manuel Rodriguez
4784217b57
Add documentation for missing fleetd tables and regenerate JSON (#9960)
Updating documentation of Fleetd tables as part of the oncall duty.

Updating the json used by Fleet using the following command:
```sh
cd website
 ./node_modules/sails/bin/sails.js run generate-merged-schema
```

Samples:
![Screenshot 2023-02-20 at 17 20
55](https://user-images.githubusercontent.com/2073526/220192112-69a116e4-badb-4328-92d3-9a2a6f8657fe.png)
![Screenshot 2023-02-20 at 17 21
09](https://user-images.githubusercontent.com/2073526/220192117-dfa06c69-2166-47d4-99c3-e108911e2084.png)


@mikermcneil @eashaw: `generate-merged-schema` generates a different
output every time it's executed. Guess: It seems it should sort the
output lexicograhically?
2023-02-22 16:05:36 -03:00
Lucas Manuel Rodriguez
2e199dcdab
Fix golangci-lint issue and run Github action on all OSs (#9944)
We have code that builds conditionally depending on the platform (mostly
Orbit code) so we should run `golangci-lint` checks on all OSs.

This adds it to run on macOS, for Windows see:
https://github.com/fleetdm/fleet/issues/9943
2023-02-21 14:30:45 -03:00
gillespi314
bcdc4691bb
Enable installation and auto-updates of Nudge via Orbit (#9605)
Issue #9093 

Co-authored-by: Roberto Dip <me@roperzh.com>
Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
2023-02-10 17:03:43 -03:00
Lucas Manuel Rodriguez
d4a1b4d218
Add CIS checks for 2.9.X and add pmset table to fleetd (#9470)
#9253

- ~[ ] 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:
- [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)).~

---------

Co-authored-by: Sharon Katz <121527325+sharon-fdm@users.noreply.github.com>
2023-02-08 13:08:17 -03:00
Marcos Oviedo
dd33a7a29a
Fixing osquery shell issue caused by osquery extension namedpipe name reuse (#9527)
There was an issue when the osqueryd instance ran through `orbit shell` attempted to register the same named pipe name used by the osqueryd instance launched by orbit service
2023-01-27 12:34:38 -03:00
Martin Angers
caaec069ff
Kickstart sofwareupdated periodically from fleetd/orbit to work around a macOS bug (#9465) 2023-01-24 10:14:17 -05:00
Martin Angers
357c0484fc
orbit: run the profiles command to renew the enrollment profile when signaled by fleet (#9409) 2023-01-24 09:23:58 -05:00
Lucas Manuel Rodriguez
cadcdbb992
Add table implementation to query SNTP servers (#9312)
This may be needed for CIS 2.3.2.2 check:

```
Correct date and time settings are required for authentication protocols, file creation,
modification dates and log entries. Ensure that time on the computer is within
acceptable limits. Truly accurate time is measured within milliseconds. For this audit, a
drift under four and a half minutes passes the control check. Since Kerberos is one of
the important features of macOS integration into Directory systems, the guidance here
is to warn you before there could be an impact to operations. From the perspective of
accurate time, this check is not strict, so it may be too great for your organization. Your
organization can adjust to a smaller offset value as needed.
```

#9239

- [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:
- [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-01-16 12:31:02 -03:00
Sharvil Shah
f1577de0ac
Orbit extensions autoupdate (#8906) 2022-12-21 01:00:55 +05:30
Marcos Oviedo
53b74e576c
Adding fallback mechanism to retrive UUID on Windows (#8993)
* Adding fallback mechanism to retrive UUID on Windows

* Fixing erroneous code comments

* Addressing code review findings
2022-12-13 18:04:49 -03:00
gillespi314
6fb3a87ae9
Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
Artemis Tosini
3022b966c4
Embed augeas lenses in orbit binary (#8901) 2022-12-02 10:19:54 -05:00
Artemis Tosini
a0b11a29d2
Dump pprof when orbit is given a SIGUSR1. Fixes #8456 (#8485)
Co-authored-by: Roberto Dip <me@roperzh.com>
2022-10-28 16:39:47 -04:00
Lucas Manuel Rodriguez
7d855c3879
Add update channels to orbit_info (#8310) 2022-10-27 09:52:18 -05:00
Roberto Dip
bd17b38bc3
fix issue in fleet desktop causing it to spam free installations (#8396)
the `switch` statement that checks for errors (including license errors) issues a `continue` before we even have the chance to wait for the ticker.

this has the drawback that premium users will have to wait 5 minutes before they see policy info, but the alternative would be to use labels and go-to, at least with the current code structure.

related to https://github.com/fleetdm/fleet/issues/8373
2022-10-21 09:56:18 -07:00
Marcos Oviedo
ec3f49881f
8009 fleet desktop icon duplication (#8017)
* Adding a new synchronization mechanism between fleet-desktop app and Orbit service. Improved windows service teardown to ensure that fleet-desktop does not get force killed without getting signaled. Improved windows process enumeration to avoid unnecessary delays during windows service start and windows service teardown. Updating windows service to reflect service teardown extra time due to synchronization.
2022-10-13 10:58:37 -03:00
Juan Fernandez
6939af045d
Fleet desktop should use lightweight endpoint for getting failing policies count (#8159)
Fleet desktop should use lightweight endpoint for getting failing policies count
2022-10-12 17:13:43 -03:00
Roberto Dip
e630fabf89
token rotation for fleet desktop (#7779)
This implements what's described in detail here https://github.com/fleetdm/fleet/blob/main/proposals/fleet-desktop-token-rotation.md
2022-10-10 17:15:35 -03:00
Lucas Manuel Rodriguez
a4d7e81475
Orbit to support environments with revoked enroll secrets (#8056)
* Support environments with revoked enroll secrets

* Add instructions on how to fix Orbit enroll

* Rename to last_recorded_error

* Add alternative instructions
2022-10-03 17:28:19 -03:00
Roberto Dip
b165c5217e
ping the capabilities API when the loop starts (#8005) 2022-09-28 15:49:08 -03:00
Zach Wasserman
f7b341cb6e
Use dark theme icon in Fleet Desktop by default (#7973)
This seems to be a better fit as a default due to what renders best in Ubuntu.

Keeps themes the same as prior Desktop releases.
2022-09-27 08:56:16 -07:00
Lucas Manuel Rodriguez
edb8fce195
Fix post-merge issue (#7971) 2022-09-27 12:30:00 -03:00
Lucas Manuel Rodriguez
3ee29c38ad
Orbit: Handle SIGTERM on unix and kill pre-existing fleet-desktop processes at startup (#7966)
* Handle SIGTERM on unix and kill pre-existing fleet-desktop processes at startup

* Add unix build tag

* Remove unused import
2022-09-27 11:57:56 -03:00
Marcos Oviedo
381f628be7
Bug 7874: Adding SCM calls to register Orbit as a windows service (#7934)
* Bug 7874: Adding SCM calls to register Orbit as a windows service
2022-09-27 11:52:41 -03:00
Roberto Dip
a509bdd0ac
add backwards compatiblity to orbit enrollment via the API (#7921) 2022-09-26 11:44:09 -03:00
Roberto Dip
2fcb27ed3f
add headers denoting capabilities between fleet server / desktop / orbit (#7833)
This adds a new mechanism to allow us to handle compatibility issues between Orbit, Fleet Server and Fleet Desktop.

The general idea is to _always_ send a custom header of the form:

```
fleet-capabilities-header = "X-Fleet-Capabilities:" capabilities
capabilities              = capability * (,)
capability                = string
```

Both from the server to the clients (Orbit, Fleet Desktop) and vice-versa. For an example, see: 8c0bbdd291

Also, the following applies:

- Backwards compat: if the header is not present, assume that orbit/fleet doesn't have the capability
- The current capabilities endpoint will be removed

### Motivation

This solution is trying to solve the following problems:

- We have three independent processes communicating with each other (Fleet Desktop, Orbit and Fleet Server). Each process can be updated independently, and therefore we need a way for each process to know what features are supported by its peers.
- We originally implemented a dedicated API endpoint in the server that returned a list of the capabilities (or "features") enabled, we found this, and any other server-only solution (like API versioning) to be insufficient because:
  - There are cases in which the server also needs to know which features are supported by its clients
  - Clients needed to poll for changes to detect if the capabilities supported by the server change, by sending the capabilities on each request we have a much cleaner way to handling different responses.
- We are also introducing an unauthenticated endpoint to get the server features, this gives us flexibility if we need to implement different authentication mechanisms, and was one of the pitfalls of the first implementation.

Related to https://github.com/fleetdm/fleet/issues/7929
2022-09-26 07:53:53 -03:00
Sharvil Shah
1b59b05862
Orbit enroll retry on unauth (#7928) 2022-09-24 03:16:33 +05:30
Juan Fernandez
d7ca8fcd66
Reverted changes made to Fleet Desktop - should not use the lightweight 'desktop' endpoint (#7919)
Reverted changes made to Fleet Desktop. Desktop should not use the lightweight 'desktop' endpoint
2022-09-23 15:18:19 -04:00
Sharvil Shah
7d4e2e2b4b
Orbit remote management for flags (#7246)
Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
2022-09-24 00:30:23 +05:30
Zach Wasserman
c01bf03435
Windows desktop theme detection (#7363)
Windows portion of #6675. Detect dark vs. light theme and change the icon to match (as best as we can).
2022-09-23 10:07:38 -07:00