Commit Graph

293 Commits

Author SHA1 Message Date
Marcos Oviedo
d5a37dfd1a
Bug 6479: Storing proxy certificate in a secure location to avoid unexpected deletion. (#7811)
This prevents proxy certificate used by --insecure mode from being deleted when stored in a user-writable location.
2022-09-19 09:42:53 -03:00
Juan Fernandez
4ef883b311
Feature 6946: Fleet Desktop should use minimal api end-point for data (#7536)
Updated desktop client to use new EE desktop endpoint.
2022-09-15 12:12:50 -04:00
Katheryn Satterlee
3eb79ed74f
Add information on update channels (#7760)
* Add information on update channels

Added additional context around when the `stable` and `edge` channels are updated with new versions of osquery.

* Update orbit/README.md

Co-authored-by: Zach Wasserman <zach@fleetdm.com>

* Update README.md

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2022-09-14 14:48:24 -05:00
Tomas Touceda
8457e55b53
Bump go to 1.19.1 (#7690)
* Bump go to 1.19.1

* Bump remaining go-version to the 1.19.1

* Add extra paths for test-go

* Oops, putting the right path in the right place

* gofmt file

* gofmt ALL THE THINGS

* Moar changes

* Actually, go.mod doesn't like minor versions
2022-09-12 20:32:43 -03:00
Zach Wasserman
5d35b467d8
Remove errors tooltips from Fleet Desktop menu (#7678)
Now that these errors are available in log files, we think this adds
more confusion for end users.
2022-09-12 08:35:26 -07:00
Roberto Dip
740aafd817
Revert token rotation (#7628)
This reverts all changes related to token rotation.
2022-09-08 15:04:02 -03:00
Roberto Dip
1c26e2555d
ensure Orbit identifier file can be read by the outside world (#7608)
As stated by the title, this fixes a bug in token rotation caused by a file having existing read-only permissions. This affects Fleet Desktop after is upgraded if an existing Orbit created a file that's not accessible by non-root users.

I have also included 77a59ac to fix an URL format
2022-09-07 14:37:54 -03:00
Roberto Dip
9174c7c711
token rotation for Fleet Desktop (#7517)
See https://github.com/fleetdm/fleet/issues/6348 for a very detailed rundown

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2022-09-06 20:25:29 -03:00
Lucas Manuel Rodriguez
7d8c38751d
Add TUF update guide (#7368)
* Add TUF guide

* Move docs to orbit/docs

* Add fixes
2022-08-25 10:17:20 -05:00
Zach Wasserman
ecb428a904
Prepare for Orbit 1.1.0 (#7315) 2022-08-19 08:27:50 -07:00
Sharvil Shah
1e62613450
orbit: rename unified_log table from extension to macadmins_unified_log (#7295) 2022-08-19 07:29:14 +05:30
Roberto Dip
6fead4c08d
better handling of path differences for MSI installers (#7035)
Related to #7036, Tested in:

- [x] macOS via `fleetctl package --type=msi` (non-native)
- [x] Linux native via `docker run -v "$(pwd)" fleetdm/fleetctl package --type=msi` (native)
- [x] Windows via `fleetctl pacakge --type=msi` (thanks to @edwardsb) (non-native)
2022-08-05 17:12:05 -03:00
Artemis Tosini
b56d2e452e
Stop the previous desktop agent when updating on macOS. Fixes #6441 (#7015) 2022-08-02 17:03:14 -04:00
Scott Blake
52583e240a
Update cleanup_macos.sh (#6977)
* Update cleanup_macos.sh

Remove the installer package receipt.

* Update cleanup_macos.sh

Continue on error
2022-08-02 12:46:45 -03:00
Roberto Dip
5a44d01566
update documentation of orbit/pkg/packaging (#6819)
This updates the documentation of orbit/pkg/packaging mainly to note that the exported functions are not safe for concurrent usage (subject to change.)
2022-07-25 20:14:20 -03:00
Roberto Dip
d63f56f8c0
add support for notarization in fleetdm/fleetctl images (#6818)
#6674
2022-07-25 20:06:10 -03:00
github-actions[bot]
f4cdf921d0
Update Orbit CA certs [automated] (#6735)
Generated automatically with curl mk-ca-bundle.pl script.

Co-authored-by: zwass <zwass@users.noreply.github.com>
2022-07-19 08:00:40 -03:00
Lucas Manuel Rodriguez
ae27d42a37
Add blueprint for Fleet Packager service (#6229)
* Add blueprint for fleet packager service

* Fix formatting

* Add rate-limit comments and remove API versioning

* Add review comments and notarization alternative

* Other optimizations

* Add storing of state and fix typo

* Add error case for /create

* Add installers for Sandbox document

* Remove already done optimization

* Add S3 alternative to package storage

* Move to proposals directory

* Last amends to specs

* Add fleetctl proposal

* Add comment from Guillaume
2022-07-18 14:30:17 -03:00
Zach Wasserman
3838ae3a7e
Update Orbit changelog for 1.0.0 release (#6678) 2022-07-14 16:03:08 -07:00
Roberto Dip
f7dd8c86cd
implement a docker image to package orbit natively in Linux (#6504)
Related to #6364 and #6363, this:

- Adds a new Docker image, `fleetdm/fleetctl` equipped with all necessary dependencies to build Fleet-osquery binaries for all platforms
- Modifies the package generation logic to special case this scenario via an environment variable `FLEETCTL_NATIVE_TOOLING`
- Adds a new GitHub workflow to test this

There are more details in the README, but part of the special-casing logic is in place to output the binaries to a folder named `build` when they are run with `FLEETCTL_NATIVE_TOOLING`, this is so we can persist the binary generated by the docker container via a bind mount:

```bash
docker run -v "$(pwd):/build" fleetdm/fleetctl package --type=msi
```

To test this changeset, I have generated packages for all platforms, both via the new Docker image and via the classic `fleetctl package`.
2022-07-11 09:49:13 -03:00
Lucas Manuel Rodriguez
e92ea532b6
Orbit to cleanup extension socket at startup (#6474)
* Orbit to cleanup extension socket at startup

* Remove extra quote
2022-07-01 16:56:37 -03:00
Roberto Dip
d6313c2c15
disable transparency menu item until the device is fully connected (#6439) 2022-06-30 10:30:38 -03:00
Sharvil Shah
7091aa364b
Update log location for fleet desktop on macOS (#6420) 2022-06-29 07:54:32 -07:00
Sharvil Shah
c59d3249ef
Show failed policies count in Fleet Desktop (#6379) 2022-06-24 17:10:05 -07:00
github-actions[bot]
356d691695
Update Orbit CA certs [automated] (#5366)
Generated automatically with curl mk-ca-bundle.pl script.

Co-authored-by: zwass <zwass@users.noreply.github.com>
2022-06-22 08:37:54 -03:00
Lucas Manuel Rodriguez
c90e3012d2
Fix Fleet Desktop opening of URL on Ubuntu 21/22 (#6314)
* Fix Fleet Desktop opening URL on Ubuntu 21/22

* Fine tunning: fix for Ubuntu 18
2022-06-21 16:26:14 -03:00
Lucas Manuel Rodriguez
9b210fc6bd
Add support for CA root certificate to Fleet Desktop (fleetctl package's --fleet-certificate flag) (#6312)
* Orbit to pass the value of `--fleet-certificate` to Fleet Desktop

* Add changes for testing
2022-06-21 16:25:36 -03:00
Zach Wasserman
3cf8c06424
Prepare changelog for Orbit v0.0.13 (#6247) 2022-06-16 08:58:34 -07:00
Zach Wasserman
12d915531e
Build universal macOS binaries for Orbit (#6208) 2022-06-13 19:43:47 -03:00
Roberto Dip
ae21f0b227
use the API specified URL for the transparency link (#6205) 2022-06-13 17:11:19 -03:00
Roberto Dip
ef6ae42d86
decouple orbit and Fleet Desktop's logging (#6180) 2022-06-13 15:41:12 -03:00
Eng Zer Jun
abe33f1d8d
test: use T.TempDir to create temporary test directory (#6080)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-06-13 10:20:38 -03:00
Roberto Dip
3ff18e2ae0
add fleet desktop version in menu (#6187) 2022-06-10 21:22:07 -03:00
Lucas Manuel Rodriguez
4cfeaa1580
Do not use golangci action for better reproducibility (use make lint-go) (#6175)
* Do not use golangci action for better reproducibility

* Add fix to trigger build

* Fix all reported issues

* fix more lint errors

* Add missing import

* Remove unused method

* Remove change not necessary
2022-06-10 18:52:24 -03:00
Juan Fernandez
ef73039559
Improve vulnerability detection for Ubuntu (#6102)
Feature: Improve our capability to detect vulnerable software on Ubuntu hosts

To improve the capability of detecting vulnerable software on Ubuntu, we are now using OVAL definitions to detect vulnerable software on Ubuntu hosts. If data sync is enabled (disable_data_sync=false) OVAL definitions are automatically kept up to date (they are 'refreshed' once per day) - there's also the option to manually download the OVAL definitions using the 'fleetctl vulnerability-data-stream' command. Downloaded definitions are then parsed into an intermediary format and then used to identify vulnerable software on Ubuntu hosts. Finally, any 'recent' detected vulnerabilities are sent to any third-party integrations.
2022-06-07 21:09:47 -04:00
Kelvin Oghenerhoro Omereshone
aa5e417faa
fix: incorrect path to osquery logs in orbit (#6095) 2022-06-06 13:19:06 +01:00
Roberto Dip
f507cdc078
use the new device client in Fleet Desktop (#5988)
This uses the new device client introduced in #5987 to perform requests from Fleet Desktop.

Related to #5697
2022-06-02 12:37:26 -03:00
Lucas Manuel Rodriguez
1406e186be
Orbit: Add early update checks before starting sub-systems (#5885)
* Make orbit do a early check of updates

* Support orbit dev-mode

* Add test for NewRunner and Runner.UpdateAction

* Remove unnecessary parallel test
2022-06-01 14:47:04 -03:00
Lucas Manuel Rodriguez
33bb7886b6
Add automation for orbit shell (with TUF) (#5856)
* fix old root dir in orbit

* add changes

* Add automation for orbit shell (with TUF)

* Fix workflow syntax

* Add logging to latest fleetctl preview action

* Add changes to fix workflow

* Use macOS host for TUF server and package generation

* Remove copy/paste if clause

* Fix orbit logs on macOS, Ubuntu

* Simplify TUF and generation of packages

* Set enroll secret instead of getting it

* Increase timeouts

* Add step id

* Fixes to the upload/download of artifacts

* Rearrange steps to not lose the downloads

* Fix copy/paste

* Add fleetctl login step

* Add missing config set

* Fix quotes on Windows

* Increase timeout

* Fix job termination

* Disable FLEET_DESKTOP for now

* Checkout repository on macOS

* Fix logs path

* Enable fleet desktop

* Use cancel, nitpick

Co-authored-by: Michal Nicpon <michal@fleetdm.com>
2022-06-01 13:54:16 -03:00
jarnpher_rice
348c67d932
Add WithStdout option for osquery's Runner (#5637)
* Add WithStdout option for osquery's Runner 

fetch the osquery output to do something in other flow

* Create osquery-runner-withstdout

* Update osquery.go
2022-05-31 14:36:19 -03:00
Lucas Manuel Rodriguez
40bbc7ec5f
Orbit: Remove functionality superseeded by local TUF test scripts (#5970)
* Remove functionality superseeded by local TUF test scripts

* Amend docs as per review
2022-05-31 10:19:01 -03:00
Lucas Manuel Rodriguez
9080563b7d
Fix some go lint warnings (#5888)
* Fix go lint warnings

* Add test for SMTPConfigured update
2022-05-31 07:19:57 -03:00
Lucas Manuel Rodriguez
6fdfb1d0d6
Remove orbit unused package (#5887) 2022-05-31 07:19:33 -03:00
Zach Wasserman
efba05f062
Update Orbit changelog for v0.0.12 (#5930) 2022-05-26 16:45:49 -07:00
dependabot[bot]
092940b862
Bump github.com/theupdateframework/go-tuf from 0.2.0 to 0.3.0 (#5894)
* Bump github.com/theupdateframework/go-tuf from 0.2.0 to 0.3.0

Bumps [github.com/theupdateframework/go-tuf](https://github.com/theupdateframework/go-tuf) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/theupdateframework/go-tuf/releases)
- [Commits](https://github.com/theupdateframework/go-tuf/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/theupdateframework/go-tuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove err check for client.IsLatestSnapshot

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2022-05-26 16:13:19 -07:00
Michael Nunes
bc9f2b1b16
Shebang should be on the first line of script (#5747)
* Shebang should be on the first line of script

* Set 644 file mode for SystemD unit file
2022-05-23 19:18:19 -03:00
Michal Nicpon
4398644185
Fix root dir detection when using orbit shell (#5844)
* fix old root dir in orbit

* add changes
2022-05-23 16:47:46 -03:00
Sharvil Shah
1365bb6cf8
Fleet Desktop: notify users if policies are failing (#5852) 2022-05-24 01:10:33 +05:30
Lucas Manuel Rodriguez
74dfdcb882
Kickoff documentation for Orbit Release Process (#5544)
* Kickoff documentation for Orbit releasing

* Fixes to the github action

* Missing follow redirect on curl

* Run osqueryd --version to verify before uploading artifacts

* Use cmd as shell for windows-latest runner

* Final set of changes to the guide
2022-05-13 07:15:29 -03:00
Lucas Manuel Rodriguez
961f0ffc10
Use LocalSystem user instead of nt authority/system on MSI (#5729) 2022-05-13 06:42:40 -03:00
Zach Wasserman
716e06a7d3
Update changelog for Orbit 0.0.11 (#5672) 2022-05-10 13:09:11 -07:00
Lucas Manuel Rodriguez
b6bbbbe186
Add (beta) support for Fleet Desktop to linux (#5221)
* Add (beta) support for Fleet Desktop to linux

* Add dependency for linux desktop

* Amend makefile uname check

* Clarify env vars used for linux in execuser

* Add final set of fixes

* Remove -it from docker run

* Add desktop to the update runner for Linux

* Re-arrange tag.gz and fix upgrade check for linux desktop
2022-05-04 11:14:12 -03:00
Lucas Manuel Rodriguez
a5349672eb
Amend fleetctl package to support /var/lib legacy orbit (legacy would mean <= 0.0.11) (#5532)
* Add logs to troubleshoot orbit

* Run journalctl on a different step

* Add legacy orbit support to opt version of fleetctl

* Fix macos logs permission error

* Checkout repository

* Compile fleetctl from branch
2022-05-03 16:46:02 -03:00
Michal Nicpon
15c69058bb
fix SELinux issue (#5335)
Install orbit to /opt instead of /var/lib. When installing to /var/lib,
the default selinux context of var_lib_t gets applied, which results in
an AVC error when running via systemd.

Co-authored-by: Lucas Rodriguez <lucas@fleetdm.com>
2022-05-02 12:18:59 -06:00
Zach Wasserman
e5a80fa3f5
Add user agent to Orbit HTTP client (#5429)
Allows identification of which Orbit versions are in use from the update
server.

Refactored the build information into a separate `package build` to
support importing it from multiple places.
2022-05-02 11:03:49 -07:00
Lucas Manuel Rodriguez
f2e8329e57
Changes to support fleetctl preview with custom TUF server (#5418) 2022-04-27 18:17:20 -03:00
Lucas Manuel Rodriguez
a2d3b91de2
Prepare for Orbit 0.0.10 (#5387) 2022-04-26 15:09:25 -07:00
Lucas Manuel Rodriguez
6fb4f5b21c
Revert orbit's remote osquery paths to use legacy v1 (#5368) 2022-04-26 13:12:44 -03:00
Zach Wasserman
eba0047b47
Prepare for Orbit 0.0.9 (#5282) 2022-04-20 16:51:37 -07:00
Lucas Manuel Rodriguez
29a902960e
Fix typos and amend PR template (#5227) 2022-04-19 18:09:55 -03:00
Lucas Manuel Rodriguez
2e7bbf960a
Add pre and post remove scripts for rpm and deb packages (#5150) 2022-04-19 09:32:47 -03:00
Lucas Manuel Rodriguez
5cb64edae5
Fix deprecation warning message on fleetctl package for deb/rpm (#5147) 2022-04-19 09:32:01 -03:00
Zach Wasserman
d15957b431
Make Orbit update interval configurable (#5032)
* Make Orbit update interval configurable

- Also increase default interval from 10s to 15m

* Add update-interval configuration to fleetctl package (#5050)

Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
2022-04-11 17:42:36 -03:00
github-actions[bot]
536e828f43
Update Orbit CA certs [automated] (#4856)
Generated automatically with curl mk-ca-bundle.pl script.

Co-authored-by: zwass <zwass@users.noreply.github.com>
2022-04-05 13:34:58 -03:00
Martin Angers
90b15071a4
Introduce API version 2022-04, deprecate use of /global in paths (#4731) 2022-04-05 11:35:53 -04:00
Lucas Manuel Rodriguez
c82c580716
Orbit: Add Fleet Desktop support to Windows (#4873)
* Orbit: Add Fleet Desktop support to Windows

* Rename workflow, fix linux build

* Do not compile systray on linux

* nolint on unused

* Fix lint properly

* nolint both checkers

* Fix monitor logic in desktopRunner

* Fix interrupt and execute order
2022-04-01 17:28:51 -03:00
Lucas Manuel Rodriguez
72629635a5
Update Orbit changelog for 0.0.8 (#4810) 2022-03-31 16:43:37 -03:00
Zach Wasserman
653c46b777
Use template icon for Fleet Desktop (#4784)
This enables support for light vs. dark mode.
2022-03-24 15:00:01 -07:00
Zach Wasserman
d0630b00e1
Allow Orbit shell to run while daemon is running (#4772)
Use a different data path so that the new osquery instance doesn't try
to use the same pidfile, db file, extension socket, etc.

#4769
2022-03-23 15:27:52 -07:00
Lucas Manuel Rodriguez
378b1dd34f
Upgrade osquery-go (#4728)
* Upgrade and replace kolide/osquery-go with osquery/osquery-go

* Upgrade macadmins/osquery-extension to v0.0.7

* Upgrade kolide/launcher to latest

* go mod tidy
2022-03-23 12:15:37 -03:00
Lucas Manuel Rodriguez
4d7c9d19d2
Add missing desktop channel to orbit's Info.plist (#4724) 2022-03-21 19:56:12 -03:00
Zach Wasserman
cc687d9d1e
Add Notarization for Fleet Desktop (#4720) 2022-03-21 15:01:50 -07:00
Lucas Manuel Rodriguez
ecdfd627b6
Fleet Desktop MVP (#4530)
* WIP

* WIP2

* Fix orbit and fleetctl tests

* Amend macos-app default

* Add some fixes

* Use fleetctl updates roots command

* Add more fixes to Updater

* Fixes to app publishing and downloading

* Add more changes to support fleetctl cross generation

* Amend comment

* Add pkg generation to ease testing

* Make more fixes

* Add changes entry

* Add legacy targets (until our TUF system exposes the new app)

* Fix fleetctl preview

* Fix bool flag

* Fix orbit logic for disabled-updates and dev-mode

* Fix TestPreview

* Remove constant and fix zip-slip attack (codeql)

* Return unknown error

* Fix updater's checkExec

* Add support for executable signing in init_tuf.sh

* Try only signing orbit

* Fix init_tuf.sh targets, macos-app only for osqueryd

* Specify GOARCH to support M1s

* Add workflow to generate osqueryd.app.tar.gz

* Use 5.2.2 on init_tuf.sh

* Add unit test for tar.gz target

* Use artifacts instead of releases

* Remove copy paste residue

* Fleet Desktop Packaging WIP

* Ignore gosec warning

* Trigger on PR too

* Install Go in workflow

* Pass url parameter to desktop app

* Fix fleetctl package

* Final set of changes for v1 of Fleet Desktop

* Add changes

* PR fixes

* Fix CI build

* add larger menu bar icon

* Add transparency item

* Delete host_device_auth entry on host deletion

* Add SetTargetChannel

* Update white logo and add desktop to update runner

* Add fleet-desktop monitoring to orbit

* Define fleet-desktop app exec name

* Fix update runner creation

* Add API test before enabling the My device menu item

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2022-03-21 14:53:53 -03:00
Zach Wasserman
efbc2b92bb
Fix race condition in updates test (#4661)
Copy the DefaultOptions in order to prevent a data race on the Targets
map. This race should only have effected testing.

Race detector output:

```
WARNING: DATA RACE
Read at 0x00c0000908d0 by goroutine 15:
  runtime.mapaccess1_faststr()
      /opt/hostedtoolcache/go/1.18.0/x64/src/runtime/map_faststr.go:13 +0x0
  github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath.func1()
      /home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:58 +0xb6
  testing.tRunner()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x47

Previous write at 0x00c0000908d0 by goroutine 12:
  runtime.mapassign_faststr()
      /opt/hostedtoolcache/go/1.18.0/x64/src/runtime/map_faststr.go:203 +0x0
  github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath.func1()
      /home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:62 +0x1cb
  testing.tRunner()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x47

Goroutine 15 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x724
  github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath()
      /home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:53 +0x1a4
  testing.tRunner()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x47

Goroutine 12 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486 +0x724
  github.com/fleetdm/fleet/v4/orbit/pkg/update.TestMakeRepoPath()
      /home/runner/work/fleet/fleet/orbit/pkg/update/update_test.go:53 +0x1a4
  testing.tRunner()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1439 +0x213
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.18.0/x64/src/testing/testing.go:1486
      +0x47
 ```
2022-03-18 09:30:45 -07:00
Lucas Manuel Rodriguez
d2ba34c8fc
Add distributed discovery query support for detail queries, add orbit… (#4597)
* Add distributed discovery query support for detail queries, add orbit_info ingestion

* Amend changes file
2022-03-15 16:51:00 -03:00
Lucas Manuel Rodriguez
f4d3159cc9
Fleetctl to package .app bundles for osquery (and changes for orbit to support them) (#4393)
* WIP

* WIP2

* Fix orbit and fleetctl tests

* Amend macos-app default

* Add some fixes

* Use fleetctl updates roots command

* Add more fixes to Updater

* Fixes to app publishing and downloading

* Add more changes to support fleetctl cross generation

* Amend comment

* Add pkg generation to ease testing

* Make more fixes

* Add changes entry

* Add legacy targets (until our TUF system exposes the new app)

* Fix fleetctl preview

* Fix bool flag

* Fix orbit logic for disabled-updates and dev-mode

* Fix TestPreview

* Remove constant and fix zip-slip attack (codeql)

* Return unknown error

* Fix updater's checkExec

* Add support for executable signing in init_tuf.sh

* Try only signing orbit

* Fix init_tuf.sh targets, macos-app only for osqueryd

* Specify GOARCH to support M1s

* Add workflow to generate osqueryd.app.tar.gz

* Use 5.2.2 on init_tuf.sh

* Add unit test for tar.gz target

* Use artifacts instead of releases

* Remove copy paste residue

* Trigger workflow on PR

* Fixes to ease handling of artifact

* Fix, do not use target name as dir

* Remove workaround
2022-03-15 16:04:12 -03:00
Lucas Manuel Rodriguez
ab9c2307fc
Add orbit_info table extension (#4587) 2022-03-14 19:09:55 -03:00
Zach Wasserman
b9beb6c2de
Update Orbit changelog for 0.0.7 (#4520) 2022-03-08 12:58:45 -08:00
Lucas Manuel Rodriguez
9edda9f3e8
Document result and status logs for Orbit (#4450) 2022-03-04 13:36:53 -03:00
Lucas Manuel Rodriguez
aaf62a9e14
Use filepath for proper multi-platform support (#4449) 2022-03-04 13:30:20 -03:00
Lucas Manuel Rodriguez
b5be858071
Fix update checks for orbit at startup (#3835)
* Fix update checks for orbit at startup

* Add tests

* Add scripts for testing local TUF server

* Remove -x used for debugging
2022-02-23 14:58:07 -03:00
Lucas Manuel Rodriguez
e39ba93a90
Orbit to wait for osqueryd extension manager socket to be ready (#3836)
* Wait for osquery extension manager socket to be ready

* PR review feedback

* Add WIP Github Action to test orbit

* Set fleet address on fleetctl

* Add logging for troubleshooting

* Add prepare db statement

* Use tls-skip-verify on fleetctl

* Move steps around

* Fix addresses

* Fix fleetctl path

* Add certs.pem to orbit root dir

* Add orbit logs

* Increase timeout

* Add proper orbit log paths

* Fix tmp path orbit

* Add get hosts command to troubleshoot

* Fix orbit job termination

* Add comments to workflows

* Wait for server to go down

* Add orbit Windows job

* Use bash on windws-latest

* Fix missing quote

* Run orbit on Ubuntu

* Bump host count

* Increase timeout for extensions and not terminate on err

* Add comment to clarify high timeout value

* Revert change, we do want to exit in case of err
2022-02-22 15:05:32 -03:00
Lucas Manuel Rodriguez
c641e39ef4
Allow disabling auto updates in fleetctl package and orbit (#4296)
* Add disable-updates flag to fleetctl and orbit

* Fix ruleguard execution error on make lint-go

* Introduce dev-mode for ease of development of orbit

* Add changes file
2022-02-18 15:42:39 -03:00
Tomas Touceda
fee7fae579
Set log path to root-dir when calling osquery (#4237)
* Set log path to root-dir when calling osquery

* Update based on review and set filesystem,tls as logging plugin
2022-02-17 09:03:54 -03:00
Nate Felton
68b0a33aee
Linting LaunchDaemon to fix formatting (#4180)
This is the equivalent of running the command
`plutil -convert xml1 com.fleetdm.orbit.plist`
2022-02-16 08:31:27 -03:00
Nate Felton
bb0b56acb7
Update postinstall to use more modern launchctl commands (#4179)
* Update postinstall to use more modern launchctl comamnds

Fixes #3995

* Switching to service-target specifier

* Removing unnecessary kill flag
2022-02-16 08:31:16 -03:00
eashaw
9af92b23aa
Update links to documentation (#4163)
* update links to documentation

* revert .sailsrc change

* fix broken link
2022-02-10 19:26:18 -06:00
Zach Wasserman
1b1d3f8a61
Update go-tuf dependency (#3837)
Resolves the warning described in #3699 by updating to the latest
version of the dependency with the warning fixed.

The warning should go away on all clients after new metadata is 
generated with these changes.
2022-02-10 08:16:36 -08:00
github-actions[bot]
87ef4e464f
Update Orbit CA certs [automated] (#4055)
Generated automatically with curl mk-ca-bundle.pl script.

Co-authored-by: zwass <zwass@users.noreply.github.com>
2022-02-07 10:27:45 -08:00
Zach Wasserman
96d81596f3
Add GitHub action for updating CA certs bundle (#4041)
See #4029
2022-02-07 09:44:31 -08:00
Lucas Manuel Rodriguez
a8135aa928
Fix typo and lint checks (#4013) 2022-02-03 17:06:49 -03:00
Zach Wasserman
80960e47f8
Allow reinstallation of MSI packages (#3958)
Make the necessary changes to the WiX XML to allow the generated MSI
installers to be reinstalled.
2022-01-31 16:09:59 -08:00
Frederico F. de Oliveira
80ef806b2f
linux_shared.go: update postinstall script (#3959)
1. In sh, `which` is actually a binary usually located at `/usr/bin`, but not every GNU/Linux distribution comes with it installed by default. Whereas, `command` is a built-in shell tool, hence, it's safer to use it instead of which to verify if a binary is present in the machine
2. I believe there was a typo in the redirections in the `systemctl daemon-reload 2>/dev/null 2>&1` line
3. The `systemctl enable` command is necessary because the service is created, but not activated, meaning when the user reboots his machine orbit won't automatically relaunch
2022-01-31 15:56:05 -08:00
Lucas Manuel Rodriguez
9f70ffd5c6
Amend fleetctl package tests to not hardcode orbit version (#3898)
* Amend fleetctl package tests to not hardcode orbit version

* Readd Version, it is indeed used

* Fix bool logic

* Readd opt.Version usage
2022-01-31 10:41:11 -03:00
Lucas Manuel Rodriguez
d7e2e33e01
Disable orbit osquery extensions on Windows (#3705)
* Disable orbit osquery extensions on Windows

* Add the same to shell.go
2022-01-14 17:42:38 -03:00
Zach Wasserman
ef42199c57
Improve Orbit debug logging (#3687)
Log reasons for runners terminating.
2022-01-13 16:54:28 -08:00
Zach Wasserman
1dc6ef6226
Orbit 0.0.6 changelog (#3682) 2022-01-13 14:31:58 -08:00
Lucas Manuel Rodriguez
7823bbbaba
Fix orbit and osqueryd logging on Windows (#3521)
* Fix orbit and osqueryd logging on Windows

* Add functionality to test the change and use systemprofile app data

* Add centos syslog to README.md

* Add wait on orbit for osquery extension socket to exist (#3571)

* Wait for osquery extension socket to exist

* Amend changes

* Fix lint

* Restore timeout
2022-01-07 19:32:31 -03:00
Zach Wasserman
08ff4e941c
Make Linux postinstall more permissive (#3550)
In some installations (observed on GitHub Actions), the postinstall
script would fail to start the service because the `systemctl` binary
was at a different path than expected, or the `systemd` binary was not
found running.

This change allows the service to start on these environments.
2022-01-01 15:18:30 -08:00
Zach Wasserman
51b19b445f
Prepare for Orbit 0.0.5 release (#3478) 2021-12-22 16:02:26 -08:00
Zach Wasserman
fa568575d0
Don't strip debugging symbols from Orbit binary (#3477) 2021-12-22 15:58:06 -08:00
Zach Wasserman
d377923750
Fix handling of enroll secret env vars in Orbit (#3458) 2021-12-22 15:57:09 -08:00
Zach Wasserman
3ff3d35f45
Update Orbit changelog for 0.0.4 release (#3415) 2021-12-19 17:38:10 -08:00
Zach Wasserman
698ef79495
Update GitHub goreleaser configuration for Orbit (#3414) 2021-12-19 17:37:54 -08:00
Zach Wasserman
4e72ebb68f
Build Orbit releases in GitHub Actions (#3413)
Complete build including macOS signing+notarization.
2021-12-19 17:06:17 -08:00
Zach Wasserman
050cffa886
Remove Badger DB in Orbit (#3404)
The database is currently unused and sometimes causing problems in Orbit
deployments due to file corruption on Windows. We may need to look at
something less prone to corruption.
2021-12-16 17:20:15 -08:00
Zach Wasserman
a7aa14fa76
Enable function-style file carving in Orbit (#3268) 2021-12-09 09:59:58 -08:00
Zach Wasserman
3a973af164
Fix Windows Orbit packaging with non-stable channel (#3210) 2021-12-07 19:49:57 -08:00
Martin Angers
c997f853e5
Make creation of http.Client uniform across the codebase (#3097) 2021-11-24 15:56:54 -05:00
Martin Angers
69a4985cac
Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
Zach Wasserman
b65c61cb12
Change Orbit osquery to Fleet osquery in generated packages (#3034)
Use "Fleet osquery" rather than "Orbit osquery" in packages generated
 by `fleetctl package`.
2021-11-18 17:43:52 -08:00
Zach Wasserman
83036672d7
Package osquery certificate bundle with orbit (#3033)
- Include the osquery certs.pem with Orbit installers.
- Use the certs.pem if available and no other certificate specified.
2021-11-18 17:17:05 -08:00
Zach Wasserman
73ee2c6b16 Add changes files 2021-11-18 16:52:53 -08:00
Zach Wasserman
01f136313d
Use UUID as default host identifier for Orbit (#3008)
This matches the default identifier used in Fleet's prior recommended
osquery installation, easing migration for users. It can still be
overridden via a flagfile.
2021-11-18 15:15:28 -08:00
Zach Wasserman
3811a63daf
Add osquery flagfile support in Orbit (#3006)
- Orbit automatically loads the flagfile when it exists in the orbit
  root.
- Add packaging support to include flagfile with package.
- Fix a panic when osquery fails to start up.
2021-11-18 15:06:33 -08:00
Zach Wasserman
f97c3949fe
Add additional tables and Windows support in Orbit extension (#2947)
More tables from https://github.com/macadmins/osquery-extension
2021-11-17 16:34:31 -08:00
Victor Vrantchan
a760cdc26d
Add MacAdmins tables in Orbit extension (#2140)
Uses the extension tables from https://github.com/macadmins/osquery-extension.

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2021-11-15 18:40:53 -08:00
Zach Wasserman
e279dc1682
Implement fleetctl updates rotate (#2831)
Add support for updating keys used in the TUF update system.
2021-11-15 10:01:48 -08:00
Martin Angers
3ae57a0242
Create errors with ctxerr, add the call to store them in redis (#2786) 2021-11-15 09:11:38 -05:00
Martin Angers
348841c90b
Add explanation output to fleetctl package (#2864) 2021-11-15 08:40:58 -05:00
Lucas Manuel Rodriguez
43d1a8c9a0
Fix races in go tests and run with -race on CI (#2712)
* Fix races in go tests and run with -race on CI

* Fix race in pubsub

* Increase timeout to 15m for go tests

* CI takes forever, try disabling race

* Remove timeout from go tests
2021-11-01 15:31:01 -03:00
Tomas Touceda
fcb5d5b392
Make vulnerability processing less RAM hungry (#2739)
* Make preview work when run from scratch (no orbit running)

* Make vulnerability processing less RAM hungry

* Add changes file

* Only get the cpe list once

* Remove cache

* Try killing osquery as well as orbit and clear their db dir

Co-authored-by: Lucas Rodriguez <lucas@fleetdm.com>
2021-10-29 11:27:12 -03:00
Zach Wasserman
53eb467452
Document Orbit uninstall on Linux (#2728) 2021-10-27 17:41:50 -07:00
Zach Wasserman
8dc34be3a3
Updates and fixes for packaging (#2682)
- Fix Windows MSI generation by changing permissions (#2655).
- Refactor temp directory initialization.
- Use root user for Wine in WiX Docker container.
- Support .pkg packaging on Linux without dependencies (besides Docker)
2021-10-27 16:17:41 -07:00
m4wh6k
bb5e5d08f5
Update Orbit README to reflect packaging now done with fleetctl (#2626) 2021-10-24 17:57:08 -07:00
Zach Wasserman
42c7933b22
Add WiX Dockerfile and update image name (#2548)
Use a different base image and newer version of Wine to try to mitigate
crashes experienced by users in #2527.
2021-10-20 15:30:46 -07:00
Tomas Touceda
b11c6ffe31
Download and launch orbit for the current device when starting preview (#2437)
* Download and launch orbit for the current device when starting preview

* Add windows kill

* Fix imports

* Fix import

* Disable secure directory checks on windows for now

* Add missing import
2021-10-15 18:23:06 -03:00
Renee Jackson
ca27bd9d5c
fix broken links by adding missing 0 (#2187)
* fix broken links by adding missing 0

* fix broken links take 2

gather links missed in first pass
2021-09-22 13:28:25 -03:00
Benjamin Edwards
823775844e
added package command from orbit as fleetctl command (#1802)
* added package command from orbit as fleetctl command

* update deployment docs

* add changes file

* added tests for package command, run go mod tidy & go mod verify

* validate that package files exist

* comment out msi packaging test until we can investigate github runner permission issues
2021-09-09 01:34:12 -04:00
Mike McNeil
ed1d43ae8b
adjust instructions for Orbit now that it's moved into the main fleet repo (#1971) 2021-09-08 16:02:27 -05:00
Frederico F. de Oliveira
0e50322800
Update temp dir permissions when creating install packages (#1946) 2021-09-08 08:35:35 -07:00
Tomas Touceda
a6acb1cd1a
Allow users to be readded if they were ever removed (#1945)
* Allow users to be readded if they were ever removed

* Address review comment

* lint
2021-09-07 13:33:40 -03:00
Tomas Touceda
6d2ae02efd
Rename core->free and basic->premium (#1870)
* Rename core->free and basic->premium

* Fix lint js

* Comment out portion of test that seems to timeout

* Rename tier  to premium if basic is still loaded
2021-09-03 13:05:23 -03:00
chrichts
87fa0301b3
Add functionality to provide cert for windows agent (#1818)
* Adding certificate functionality to windows agent

* Update windows template

To allow for --fleet-certificate parameter when building windows agent

* Gofmt -ed Windows.go

* Gofmted windows.go again 

Replace space indentation with tab
2021-09-01 11:48:55 -03:00
chrichts
a9592117a5
Fix bug in running orbit on Linux (#1815)
Mkbom was referencing a non-existant folder, updated to point at the correct folder.
2021-08-26 08:37:57 -07:00
Martin Angers
a3714d2ed9
Add fleetctl debug connection command (#1706)
Adds the `fleetctl debug connection` command to investigate
connection issues to the fleet server.

Closes #1579 .
2021-08-24 08:50:03 -04:00
Martin Angers
3c9d7fd4bb
Add explicit sync to disk for critical file writes (#1686)
For Orbit operations, make an explicit *os.File.Sync() call and check the 
error, to make sure the writes are fully flushed to disk.

Closes #1679 .
2021-08-17 08:41:56 -04:00
Tomas Touceda
989e638cc0
Make creating dirs and files more secure by checking permissions (#1566)
* Add safe mkdirall and open

* Use secure as much as possible and merge gomodules for orbit to fleet

* Improve openfile and mkdirall to check for permissiveness instead of equality

* Don't shift

* Fix links

* Address review comments
2021-08-11 11:02:22 -03:00
Zach Wasserman
d0bb320278
Cleanup unused FetchPEM function (#1586) 2021-08-09 09:32:32 -07:00
Tomas Touceda
b927f7064d Fix workflows 2021-08-05 13:16:49 -03:00
Tomas Touceda
659066819a Fix dead link 2021-08-04 17:03:36 -03:00
Tomas Touceda
08d9670683 Update .goreleaser.yml 2021-08-04 17:00:13 -03:00
Tomas Touceda
3ac8494d23 Add 'orbit/' from commit 'ab3047bb39f1e2be331d1ff18b4eb768619033c4'
git-subtree-dir: orbit
git-subtree-mainline: d5974aad97
git-subtree-split: ab3047bb39
2021-08-04 16:58:25 -03:00