Commit Graph
673 Commits
Author SHA1 Message Date
Martin Angers e6b90ca8b9 Support per-task configuration for async host processing configuration (#5700) 2022-05-16 09:44:50 -04:00
Martin Angers f05d2be767 Produce hosts' CSV report based on requested columns (#5656) 2022-05-10 14:25:53 -04:00
gillespi314 d172128183 Add label information to host summary response (#5573) 2022-05-10 10:32:55 -05:00
Martin Angers 1fa7bb7a19 Support async saving of hosts' last seen time (#5640) 2022-05-10 11:29:17 -04:00
Roberto Dip cba78bdcd1 don't clear errors automatically when reading them from Redis (#5623)
this change prevents errors from being automatically cleared once they are read. A new flag `-flush` is introduced to flush errors on read if necessary.
2022-05-10 11:44:43 -03:00
gillespi314 991c7ccadc Add device_mapping to GET /hosts response (#5383) 2022-05-02 16:34:14 -05:00
gillespi314 1dabf52834 Add Zendesk external service integration for vulnerability automations (#5372) 2022-05-02 15:58:34 -05:00
Roberto Dip a4725518ac filter out Google Chrome profiles without an associated email before ingesting (#5440)
To add support for #400, we're using the macadmins/osquery-extension to gather Google Chrome profiles from hosts.

Under the hood, the extension looks and parses a json file in which Chrome stores a bunch of data. Given that emails are not required to create Chrome profiles, some of the profiles stored in this file and returned by the query we're using contain empty emails.

The idea after this change is to prevent empty emails from being ingested in the first place instead of filtering them after the fact. I have also included a migration to clean the rows with empty email columns.

Fixes #4780
2022-05-02 09:55:40 -03:00
Lucas Manuel Rodriguez 407d8b527e Remove unused Datastore.SaveHost and unused Modified fields (#5245) 2022-04-26 18:33:29 -03:00
Martin Angers 253baee657 Collect last_opened_at for macOS software, and return it in host details payload (#5376) 2022-04-26 14:16:59 -04:00
Lucas Manuel Rodriguez 45b9a382a6 fleetctl preview to use v1 setup path, to support previous versions of fleet (#5331) 2022-04-25 10:02:21 -03:00
Martin Angers 26cfa9e358 Migrate client setup api call used by fleetctl to use versionless path (#5266) 2022-04-20 16:30:43 -04:00
Martin Angers b3fc0cd844 Unversion the /setup endpoint, version the websocket endpoint (#5104) 2022-04-20 15:57:26 -04:00
Michal Nicpon 9f981f9e49 fleetctl query improve error message (#5141) 2022-04-20 11:35:46 -06:00
Martin Angers fd0cd153ce Fix SSO paths to always use /v1/ instead of /latest/ (#5246) 2022-04-20 12:46:45 -04:00
Lucas Manuel Rodriguez f7048b711c Fix race condition in tests when using global var loginRateLimit (#5197) 2022-04-19 10:35:53 -03:00
gillespi314 70a61b86f1 Update os version aggregated stats for all teams (#5083) 2022-04-18 16:19:58 -05:00
Tomas Touceda 7e02bdfa29 hide jira api token from the config API (#5196)
* hide jira api token from the config API

* Update based on reviews and fix tests
2022-04-18 17:55:51 -03:00
da171d3b8d Merge pull request from GHSA-pr2g-j78h-84cr
* Fix access control issues with users

* Fix access control issues with packs

* Fix access control issues with software

* Changes suggested by Martin

* All users can access the global schedule

* Restrict access to activities

* Add explicit test for team admin escalation vuln

* All global users should be able to read all software

* Handbook editor pass - Security - GitHub Security (#5108)

* Update security.md

All edits are recorded by line:

395 replaced “open-source” with “open source”
411 replaced “open-source” with “open source”
439 added “the” before “comment”; replaced “repositories,” with “repositories”
445 deleted “being” before “located”
458 added “and” after “PR”
489 replaced “on” with “in”
493 replaced “open-source” with “open source”; Replaced “privileges,” with “privileges”

* Update security.md

line 479

* Update security.md

added (static analysis tools used to identify problems in code) to line 479

* Fix UI

* Fix UI

* revert api v1 to latest in documentation (#5149)

* revert api v1 to latest in documentation

* Update fleetctl doc page

Co-authored-by: Noah Talerman <noahtal@umich.edu>

* Add team admin team policy automation; fix e2e

* Update to company page of the handbook (#5164)

Updated "Why do we use a wireframe-first approach?" section of company.md

* removed extra data on smaller screens (#5154)

* Update for team automations; e2e

* Jira Integration: Cypress e2e tests only (#5055)

* Update company.md (#5170)

This is to update the formatting under "empathy" and to fix the spelling of "help text."
This was done as per @mikermcneil .
This is related to #https://github.com/fleetdm/fleet/pull/4941 and https://github.com/fleetdm/fleet/issues/4902

* fix update updated_at for aggregated_stats (#5112)

Update the updated_at column when using ON DUPLICATE UPDATE so that
the counts_updated_at is up to date

* basic sql formatting in code ie whitespace around operators

* Fix e2e test

* Fix tests in server/authz

Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
Co-authored-by: Desmi-Dizney <99777687+Desmi-Dizney@users.noreply.github.com>
Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>
Co-authored-by: Noah Talerman <noahtal@umich.edu>
Co-authored-by: Mike Thomas <78363703+mike-j-thomas@users.noreply.github.com>
Co-authored-by: Martavis Parker <47053705+martavis@users.noreply.github.com>
Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
2022-04-18 10:27:30 -07:00
Zach Wasserman f28d5ab5be Skip Docker interfaces for host primary IP (#5119)
See #4754
2022-04-13 11:04:38 -07:00
Martin Angers a4be69d9d1 Return the new recent_vulnerability_max_age config in the REST API config payload (#5107) 2022-04-13 12:05:57 -04:00
Martin Angers ae85d9d069 Rename jira integration password to api_token, as that is what it is (#5068) 2022-04-12 10:56:05 -04:00
Martin Angers 7187f1adac Queue jobs for Jira integration when enabled and new vulnerabilities are found. (#4975) 2022-04-11 16:42:16 -04:00
Lucas Manuel Rodriguez 60b7425bef Add http basic auth to /metrics (#4974)
* Add http basic auth to /metrics

* Fixes after testing applying of a --config sample.yml

* Add unit test
2022-04-07 09:40:53 -03:00
Martin Angers 193843a97d Make a test request to Jira when saving AppConfig with an enabled jira integration (#4954) 2022-04-06 07:55:25 -04:00
Zach Wasserman bc2137e132 Add optimization to Windows software query (#4952)
This optimizes the query in particular for Domain Controllers, where
there are a number of users with no local accounts and don't need to be
searched for software.

See #4261
2022-04-05 10:56:47 -07:00
Martin Angers d890970844 Implement the Jira API call (#4938) 2022-04-05 12:58:34 -04: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 57816592ba Add read replica testing helpers and fix non-sso login bug (#4908)
not set on the INSERT.
- OUT: Only sets the ID on the passed session and returns it. (`CreatedAt`, `AccessedAt`, are not set.)

New version:

```go
func (ds *Datastore) NewSession(ctx context.Context, userID uint, sessionKey string) (*fleet.Session, error) {
	sqlStatement := `
		INSERT INTO sessions (
			user_id,
			` + "`key`" + `
		)
		VALUES(?,?)
	`
	result, err := ds.writer.ExecContext(ctx, sqlStatement, userID, sessionKey)
	if err != nil {
		return nil, ctxerr.Wrap(ctx, err, "inserting session")
	}

	id, _ := result.LastInsertId() // cannot fail with the mysql driver
	return ds.sessionByID(ctx, ds.writer, uint(id))
}
```

- IN: Define arguments that are truly used when creating a session.
- OUT: Load and return the fleet.Session struct with all values set (using the `ds.writer` to support read replicas correctly).

PS: The new `NewSession` version mimics what we already do with other entities, like policies (`Datastore.NewGlobalPolicy`).
2022-04-04 16:52:05 -07:00
Martin Angers 71f2690ada Add Jira integrations config support (#4863) 2022-03-30 09:10:02 -04:00
Michal Nicpon 779623934c Fix update invite email conflict (#4751) 2022-03-28 09:38:57 -06:00
Michal Nicpon a6902cc083 Add os versions endpoint (#4749) 2022-03-28 09:15:45 -06:00
Michal Nicpon 7b671ac2a3 Add team failing policies webhook (#4633)
* add config to teams
* update api docs
* update tests
2022-03-21 13:16:47 -06:00
Benjamin Edwards 74bb559645 Add public ip to hosts & derive geolocation when rendering host (#4652)
* geoip wip
* return nil if ip is empty string or if ParseIP returns nil
* add ui component to render geolocation if available, address PR feedback
* render public ip if available
* add changes file, document geoip in deployment guide
* update rest-api docs
2022-03-21 12:29:52 -04:00
Martin Angers b2845cd65f Refactor authz skip for device auth, add org_logo_url for frontend (#4619) 2022-03-16 10:15:25 -04:00
Martin Angers c0591dac5d Ignore pagination params for the download csv endpoint (#4608) 2022-03-16 09:01:52 -04: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
Martin Angers bb678b6b2e Add support for downloading a list of hosts in CSV format (#4596) 2022-03-15 15:14:42 -04:00
Martin Angers fc01947ae7 Allow global admin to change anyone's password. (#4582) 2022-03-15 08:11:53 -04:00
Roberto Dip 9dba07395b Add missing error checking to test config setup (#4401)
* check for errors when setting test logs on new services

* fix tests that fail because a log file wasn't specified

* remove unnecessary nil check
2022-03-11 12:51:12 -03:00
Martin Angers a1c67547b3 Add new endpoints to retrieve device information by orbit identifier (#4531) 2022-03-09 16:13:56 -05:00
Martin Angers c8bc026d6f Migrate special-case endpoints to new pattern (#4511) 2022-03-08 11:27:38 -05:00
Martin Angers c40fdd783e Migrate host-authenticated endpoints to new pattern (#4403) 2022-03-07 13:10:55 -05:00
Tomas Touceda 6cffd5438f Only send test email when changing smtp values (#4394)
* Only send test email when changing smtp values

* Update comment
2022-02-28 18:28:51 -03:00
Martin Angers 4930ca2d0e Support listing software hosts count filtered by team (#4388) 2022-02-28 13:55:14 -05:00
Tomas Touceda c522c2eaa2 Add missing case for email change errors (#4390)
* Add missing case for email change errors

* Update tests
2022-02-28 13:17:10 -03:00
Tomas ToucedaandMichal Nicpon 1fdcb1bfc2 Error early if email already exists (#4363)
* Error early if email already exists

* Update changes/issue-4361-mail-change-should-error

Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>

* Fix test

* Lint fixes

* Fix another test

* Also check for invites

* Improve error checks

* Update comment

* Update tests

* Fix test

Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>
2022-02-28 09:34:44 -03:00
Frederico F. de Oliveira 9b02722e08 endpoint_sessions.go: add the redirect URL in the html body text (#4328)
This makes debug easier in case the browser get stuck on the redirect page.
2022-02-23 14:43:23 -08:00
Martin Angers 84ac0f05a9 Grant write to policies to global maintainer (#4321) 2022-02-22 16:57:36 -05:00
Martin Angers ad5146c491 Allow updating the policy platform (part 1 of the ticket) (#4311) 2022-02-22 13:42:03 -05:00