Commit Graph
1338 Commits
Author SHA1 Message Date
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 ToucedaandJan Christian Grünhage 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
Juan Fernandez 53e112d264 Feature 7494: Use the MSRC security bulletin artifacts for detecting Win OS vulnerabilities (#7889)
Use the MSRC security bulletin artifacts for detecting Win OS vulnerabilities
2022-10-28 11:12:21 -04:00
Michal Nicpon 3801f1c6d1 improve primary ip host detail query (#8407)
Previously, the primary ip was determined using the interface with the most traffic. This had a few issues and required explicitly filtering out certain interfaces that we don't want eg loopback, docker.

Instead, use the default route to determine the primary (private) ip. If there are multiple, use the one with the lowest metric and prefer ipv4 addresses.
2022-10-27 16:34:49 -06:00
Lucas Manuel Rodriguez 1fa5475e6e Log denylisted queries as errors (#8294) 2022-10-27 11:17:14 -05:00
Roberto Dip fdcbbaac7e Add method to fleetDesktopResponse to satisfy the errorer interface (#8457) 2022-10-26 16:17:11 -03:00
Martin Angers 49e910270b Add vulnerability scores to Jira/Zendesk tickets for premium users (#8346) 2022-10-26 10:42:09 -04:00
gillespi314 51e6369653 Fix password reset request expiration (#8246) 2022-10-25 09:46:41 -05:00
Martin Angers 229b349118 Fix more hosts filters-related API docs (#8335) 2022-10-25 08:17:51 -04:00
Michal Nicpon d11db25ba9 add subject to scep payload (#8267) 2022-10-24 14:01:20 -06:00
gillespi314 881194b3b4 Add orbit version and osquery version usage statistics (#8229) 2022-10-24 11:12:56 -05:00
Martin Angers e19191161e Validate team spec unknown keys (#8265) 2022-10-24 08:49:44 -04:00
Juan Fernandez 9444016571 Fixed bug with CPE matching, UTM.app was matching to the incorrect CPE (#8149)
Fixed bug with CPE matching, UTM.app was matching to the incorrect CPE.
2022-10-24 12:46:18 +00:00
Michal Nicpon 3f3c0b34c4 fix missing host when ordering by display name (#8376) 2022-10-20 14:56:58 -06:00
Martin Angers a63c3ac475 Fix error returned when ordering by display_name (#8350) 2022-10-19 17:05:10 -04:00
Roberto Dip d0cde1aaaa Use the same HTTP server config as the production server in tests (#8254)
* Use the same HTTP server config as the production server in tests

This abstracts the default config we use to run the server into a
function so it can be used in tests to run an HTTP server using the same
configuration.

Additionally, this fixes a data race in tests, as an HTTP server
configuration can't be changed once you call `server.Start()`[1]

[1]:
https://cs.opensource.google/go/go/+/refs/tags/go1.19.2:src/net/http/httptest/server.go;l=40;drc=19309779ac5e2f5a2fd3cbb34421dafb2855ac21
2022-10-19 07:42:21 -03:00
Frank Sievertsen 7c3d9f007a return http status 400 for bad json request body (#8287) 2022-10-18 14:43:16 +02:00
Martin Angers 323620bf39 Deep-clone the appconfig when getting from cache (#8194) 2022-10-17 15:03:49 -04:00
Frank Sievertsen a2c47cf4f4 add host_display_name to live query rows (#8251) 2022-10-17 15:52:25 +02:00
Roberto Dip e4cd25f4aa fix a bug causing features to be false (#8240)
Related to https://github.com/fleetdm/fleet/issues/8010 and https://github.com/fleetdm/fleet/issues/8013 this prevents a bug that happens when:

1. A team doesn't have a `config.features` key in the JSON stored in the table or `config` is `NULL`
2. The team is edited from the UI

All `config.features` will default to `false`, which can be a problem if your global settings are `true` for both (which is the default)
2022-10-14 19:27:37 -03:00
gillespi314 59876d37ea Add usage statistics to measure policy violations (#8199) 2022-10-14 13:55:37 -05:00
Lucas Manuel Rodriguez c16ab5f823 Fix undetected missing migrations (#8228) 2022-10-14 13:26:04 -03:00
Lucas Manuel Rodriguez 03096ee546 Fix race in tests (modifying already started server config) (#8227) 2022-10-14 12:00:16 -03:00
Frank Sievertsen e54f066266 Add display_name to more results (#8204)
* Make HostResponses with one dedicated function only
* more display_name for Hosts
2022-10-14 11:14:18 -03:00