Commit Graph

1360 Commits

Author SHA1 Message Date
Frank Sievertsen
8e65ec67b5
Add new activity that records create/edit/delete user roles (#9086) 2022-12-21 18:30:19 +01:00
Frank Sievertsen
e7d6ed0f3f
Log all successful logins as activity and all attempts with ip in stderr. (#9095) 2022-12-21 18:29:51 +01:00
Sharvil Shah
f1577de0ac
Orbit extensions autoupdate (#8906) 2022-12-21 01:00:55 +05:30
Lucas Manuel Rodriguez
e3a626a00d
Fix authorization check test (#9058) 2022-12-19 10:37:08 -03:00
Tomas Touceda
68bd8661e9
Simplify disk encryption query in linux and filter at ingestion (#9037)
* Simplify disk encryption query in linux and filter at ingestion

* Join with mounts to detect whatever is encrypting /
2022-12-19 10:01:59 -03:00
Gabriel Hernandez
3c136e3f47
Add MDM Card to Windows and All Dashboards and change mdm data source on host details page (#8960) 2022-12-16 15:12:11 -06:00
Frank Sievertsen
7ebb97cd70
Fire automations for hosts that failed before automation enabled (#9028) 2022-12-16 22:00:54 +01:00
Michal Nicpon
37f454c0be
Add dep key pair endpoint (#9007) 2022-12-16 19:39:36 +01:00
gillespi314
836553ba60
Fix cron trigger bug (#8950) 2022-12-16 12:00:42 -06:00
Stephan Miehe
b6a409fa3b
Support redis username (#9018) 2022-12-14 08:53:38 -05:00
Martin Angers
f18a320bd5
Add command get mdm-apple-bm to fleetctl (#8949) 2022-12-12 15:45:53 -05:00
Zach Wasserman
083b781c2c
Send custom headers for live queries (#8991)
This needed to be set specifically for the live query websocket dialer,
since that doesn't use the HTTP client that the rest of the API client
methods use.

Co-authored-by: Tomas Touceda <chiiph@gmail.com>
2022-12-12 07:56:35 -08:00
Frank Sievertsen
a228dcb170
Add critical policies as a premium feature (#8959)
* add premium feature critical policies

* update documentation

* add test for premium-only field

* update old change-file

* test policies more comprehensively

* also test team policies

* PATCH returns wrong timestamp, updating test
2022-12-09 19:23:08 +01:00
Roberto Dip
e68535d468
report errors that can occur during file carving (#8972)
related to https://github.com/fleetdm/fleet/issues/8117
2022-12-09 13:21:30 -03:00
Michal Nicpon
10b3179b63
Add fleetctl generate mdm-apple (#8812) 2022-12-07 18:24:42 +01:00
Martin Angers
d4a3730610
Add new configuration options for Apple Business Manager (#8886) 2022-12-06 15:50:56 -05:00
gillespi314
43b1241a0c
Add fleetctl trigger command (#8877) 2022-12-06 09:56:54 -06:00
Frank Sievertsen
e0766d21a3
Add ability to mark policy as critical. (#8896) 2022-12-06 15:59:20 +01:00
gillespi314
6fb3a87ae9
Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
Martin Angers
866829dbfa
Implement fleetctl get mdm-apple (#8786) 2022-12-05 11:35:45 -05:00
Martin Angers
f5fc316ad3
Add options for configuring APNS and SCEP keys/certs in Fleet server (#8730) 2022-12-05 10:22:56 -05:00
Roberto Dip
f52e294718
try using DATE_ADD in test to ensure the timestamp is handled correctly (#8915)
rel:  https://github.com/fleetdm/fleet/issues/8768 thanks to @gillespi314 for the idea, the test consistently fails with:

```
 === RUN   TestHosts/TestHostOrder
    hosts_test.go:5392: 
        	Error Trace:	/home/runner/work/fleet/fleet/server/datastore/mysql/hosts_test.go:5392
        	            				/home/runner/work/fleet/fleet/server/datastore/mysql/hosts_test.go:5416
        	            				/home/runner/work/fleet/fleet/server/datastore/mysql/hosts_test.go:139
        	Error:      	"[]" should have 3 item(s), but has 0
        	Test:       	TestHosts/TestHostOrder
```

and the relevant code around line `5416`:

```go
	_, err = ds.writer.Exec(`UPDATE hosts SET created_at = created_at + id`)
	require.NoError(t, err)

	hosts, err = ds.ListHosts(ctx, fleet.TeamFilter{User: test.UserAdmin}, fleet.HostListOptions{
		ListOptions: fleet.ListOptions{
			OrderKey:       "created_at",
			After:          "2010-10-22T20:22:03Z",
			OrderDirection: fleet.OrderAscending,
		},
	})
	require.NoError(t, err)
	chk(hosts, "0001", "0004", "0003")
```

This PR changes it to be `UPDATE hosts SET created_at = DATE_ADD(created_at, INTERVAL id DAY)` instead, which seems to fix the issue (so far 3 runs without issues)
2022-12-02 17:25:12 -03:00
Roberto Dip
837fef4bc4
ensure we provide a future date in MSRC test (#8897)
This test was failing in Dec 2022, because in this line:

```go
_, err := sut.GetFeed((now.AddDate(0, 1, 0)).Month(), now.Year())
```

`(now.AddDate(0, 1, 0)).Month()` returns `"January"` , and `now.Year()` returns `2022` , so we were sending a date in the past.
2022-12-01 11:29:07 -03:00
gillespi314
49f7180a14
Use POST instead of GET for trigger endpoint (#8888) 2022-11-30 11:57:42 -06:00
Artemis Tosini
486590186a
orbit: Correctly handle errors in authenticatedRequest. Fixes #8472 (#8860) 2022-11-29 11:54:36 -05:00
gillespi314
d5c096fa02
Implement schedule triggers (#8747) 2022-11-28 13:28:06 -06:00
Frank Sievertsen
8fc32acf00
Store details (query_name and query_sql) about live query in activity feed (#8842) 2022-11-28 16:42:32 +01:00
gillespi314
4a73d4a887
Adjust flaky tests (#8811) 2022-11-25 12:09:55 -06:00
Tomas Touceda
fe1fa4d78c
Clone AppConfig and ScheduledQuery list by hand to improve CPU usage (#8794)
* Close AppConfig and ScheduledQuery list by hand to improve CPU usage

* Address review comments

* Update remaining mocks
2022-11-23 12:04:06 -03:00
Roberto Dip
d9bf269c60
add dev flag to aid UI development (#8789) 2022-11-22 14:26:36 -03:00
Martin Angers
dc6bfdec57
Add support for missing OS-specific osquery flags in agent options (#8743) 2022-11-21 10:32:17 -05:00
gillespi314
b99ce3865b
Adjust cron schedule tests (#8754) 2022-11-18 11:26:51 -06:00
Roberto Dip
b6f7efe164
add <PayloadOrganization> to MDM enrollment payload (#8752)
The value of this attribute is used by macOS in "System Preferences >
Profiles" to display a note saying "This Mac is supervised and managed
by <xyz>".

When <PayloadOrganization> is not set, it uses the URL of the MDM server
for the message, which looks unpolished.
2022-11-18 11:25:44 -03:00
gillespi314
267aaf0dbe
Add holdLock and releaseLock methods to schedule package (#8464) 2022-11-16 15:14:38 -06:00
Jan Christian Grünhage
8fee954dba
fix: check device mounted at filesystem root for encryption (#8719) 2022-11-15 10:50:58 -05:00
Tomas Touceda
9a801dec8d
detect void as a linux platform as well (#8717)
Co-authored-by: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
2022-11-15 12:26:18 -03:00
Martin Angers
472c8bafb3
Refactor license so it is stored in the context (#8544) 2022-11-15 09:08:05 -05:00
Martin Angers
7f519e44d2
Add migration to drop gigs/percent disk space from hosts (#8646) 2022-11-15 08:27:40 -05:00
Martin Angers
54bb5448a0
Fix missing valid properties in validation of FIM and YARA agent options (#8707) 2022-11-14 15:50:41 -05:00
Michal Nicpon
9ad1721efd
fix issue with duplicate vulns detected using nvd (#8613)
The OVAL analyzer falsely assumes that any vulnerabilities detected on a
host only come from OVAL. However, it is possible that NVD detects
vulnerabilities on these hosts even though it excludes software from
deb_packages and rpm_packages. For example, a python package twisted
v22.20 has a vulnerability CVE-2022-39348 detected by NVD. The OVAL
analyzer would delete this vulnerability, and it would be re-inserted by
the NVD scanner on the next run. This creates a loop.

The fix is to only delete vulnerabilities that are actually detected
using OVAL. We already store this in the source column in the
software_cve table.
2022-11-10 10:28:00 -07:00
Frank Sievertsen
0dbbad8e10
Exclude windows servers from mdm aggregation and lists (#8585) 2022-11-08 10:29:40 +01:00
Frank Sievertsen
4743d31870
Support low_disk_space filter for endpoint /labels/{id}/hosts (#8598) 2022-11-08 09:19:34 +01:00
Tomas Touceda
5d3e27d169
Use tx instead of writer within withTx style code to prevent deadlocks (#8554) 2022-11-03 10:57:50 -03:00
Martin Angers
7fbe394b94
Ingest disk encryption flag for hosts, return in GET /hosts/{id} endpoint (#8526) 2022-11-02 15:44:02 -04:00
Frank Sievertsen
f9728b8435
allow created_at and updated_at as hosts filter (with "after") (#8535) 2022-11-02 15:51:31 +01:00
Mo Zhu
74b8e29cfe
add arch and linuxmint to list of linux distros (#8532)
* add arch and linuxmint to allowlist of linux distros

* fix comma in array

* refer to list of linux distros, not allowlist
2022-11-01 16:24:59 -07:00
Michal Nicpon
1571837d75
initialize empty slice for host counts usage statistics (#8510) 2022-11-01 15:49:02 -06:00
Martin Angers
8f21e026e3
Fix bug with fleetctl apply for teams, clear agent options only if key is present (#8508) 2022-11-01 15:22:45 -04:00
Frank Sievertsen
baa1ddc0f2
Add MDM detection for windows and mdm endpoints (#8479) 2022-11-01 18:22:07 +01:00
Roberto Dip
c51927e873
enhance support for orbit and fleet desktop in osquery-perf (#8217)
This improves osquery-perf with support for a more realistic orbit + fleet desktop simulation as described in #8212

This was based on the work done by @sharvilshah in his branch.
2022-10-28 14:27:21 -03:00