Commit Graph

116 Commits

Author SHA1 Message Date
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