Commit Graph

192 Commits

Author SHA1 Message Date
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
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
Zach Wasserman
4808e86c40
Add dev DB management rules to Makefile (#2643) 2021-10-22 11:26:54 -07: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
Zach Wasserman
8a15f6d270
Add codecov to CI (#1824)
This should cause codecov to run on all pull requests and all commits to main.

Currently only doing coverage for Go files.
2021-08-26 09:53:10 -07:00
Zach Wasserman
53e4f1077e
Add make changelog command and update documentation (#1795) 2021-08-25 15:14:24 -07:00
Tomas Touceda
a8642493ad
Add global policies (#1750)
* Add global policies

* Update documentation and add extra parameter to config

* Fix failing tests

* Store historic policy records

* Address review comments

And also remove other inmem references I saw by chance

* Add documentation for get by id request

* Add parameter doc

* Move schema generation to a cmd instead of a test

Otherwise it messes up running all tests sometimes depending on how parallel it does

* Remove brain dump for another task

* Make migration tests a separate beast

* Make schema generation idempotent and move dbutils cmd to tools

* Allow all filters and add counts to Policy

* Add test for Policy
2021-08-24 17:24:52 -03:00
Martin Angers
80fb3cb145
Run golangci-lint with the make lint-go target, adjust workflows (#1778) 2021-08-24 15:36:50 -04:00
Tomas Touceda
c6c63ab12a
Refactor app config (POC, for now) (#1685) 2021-08-20 12:27:41 -03:00
Tomas Touceda
8d1a3409dc
Add netgo tag to prevent crashes on linux when making external requests (#1681)
* Add netgo tag to prevent crashes on linux when making external requests

* Remove unused step
2021-08-16 15:48:45 -03:00
Tomas Touceda
c781058617
Fix build, add missing tests for cpe translations (#1631)
* Fix build, add missing tests for cpe translations

Also dont fail alltogether if there's one issue translating CPEs, log it and continue

* Make it once every hour again

* Use MATCH but escape strings
2021-08-11 14:52:09 -03:00
Benjamin Edwards
29611d8377
modify packs api to filter non-empty pack_type from response (#1558)
* modify packs api to filter non-empty pack_type from response
* change list packs store method to allow filtering for "system-level" packs, by default the api filters these packs from being returned
* add changes file
* don't allow modifications to global or team packs via apply spec
* refactor to use PackListOptions
2021-08-10 09:43:27 -04:00
Tomas Touceda
46b0b7765b
Issue 1435 software to cpe (#1488)
* WIP

* WIP

* Make path optional and fix tests

* Add first generate

* Move to nvd package

* remove replace

* Re-add replace

* It's path, not file name

* Change how db path is set and use etag

* Fix typos

* Make db generation faster

* Remove quotes

* Doesn't like comments

* Samitize etag and save to file

* Refactor some things and improve writing of etagenv

* Compress file and truncate amount of items for faster testing

* Remove quotes

* Try to improve performance

* Ignore truncate error if not exists

* Minor cleanup and make sqlite have cpe prefix

* Simplify code and test sync

* Add VCR for sync test

* Check for nvdRelease nil

* Add test for the actual translation

* Address review comments

* Rename generate command because we'll have a cve one too

* Move to its own dir

* Address review comments
2021-07-29 13:10:34 -03:00
Zach Wasserman
b967eabb3d
Fix frontend rendering error when software vulnerabilities missing (#1251)
This error was not caught in E2E testing because the software inventory
feature flag was turned off. This is now also enabled for E2E tests.

Fixes #1245
2021-06-29 10:03:17 -07:00
Zach Wasserman
5e26af701b Merge branch 'main' into teams 2021-06-25 18:48:20 -07:00
João Paulo Lins
336dc33cf4
Add new option on Makefile to generate Binaries for specific GOOS/GOARCH passed via parameter. Support multi-arch build. (#1199) 2021-06-25 14:56:01 -07:00
RachelElysia
aeb852e168
Remove username from UI (#1168)
* Remove username from UI code
* Remove username from tests
* Remove username from database
* Modify server endpoints for removing username
* Implement backend aspects of removing username
* Update API docs
* Add name to fleetctl
2021-06-24 13:42:29 -07:00
Zach Wasserman
663641d521
Add commands for enrolling hosts in E2E tests (#1089)
- Add `addDockerHost` and `stopDockerHost` commands.
- Example usage in test.
2021-06-15 10:14:57 -07:00
Zach Wasserman
8c97b36764
Set up Cypress testing for Teams/Tiers (#1005)
- Update names/roles of users in `make e2e-setup`.
- Update test SSO user info.
- Add Cypress commands for seeding users/Teams.
- Stub Cypress tests for team/tier matrix.
2021-06-09 11:56:59 -07:00
Zach Wasserman
0356115b03
Remove JWT in Fleet session management (#979)
See #978 for motivations for this change.

Closes #978.
2021-06-06 18:10:58 -07:00
Zach Wasserman
fa01df79d5 Merge branch 'master' into teams 2021-06-05 06:27:38 -07:00
Martavis Parker
cb2682c273
Remove detection for OS during contributor build (#922) (#933)
- No longer detecting for OS make commands
- Using the same internal commands for every OS
- go.sum auto-updated during build
- Document build process on Windows
2021-06-04 08:10:25 -07:00
Zach Wasserman
a40c549d95
Add -trimpath to go build flags for release (#909)
Provides cleaner error paths in release binaries.
2021-06-01 16:03:52 -07:00
Zach Wasserman
417ef2c9b6
Refactor teams service methods (#910)
- Move team-related service methods to `ee/server/service`.
- Instantiate different service on startup based on license key.
- Refactor service errors into separate package.
- Add support for running E2E tests in both Core and Basic tiers.
2021-05-31 17:07:51 -07:00
Zach Wasserman
9876dbe6b6
Implement license loading and validation (#908)
- Load license from ES256 signed JWT key.
- Parse license claims into LicenseInfo struct.
- Update contribution documentation with sample license key.

Closes #816.
2021-05-31 11:35:15 -07:00
Zach Wasserman
a5bd03e5d7 Merge branch 'master' into teams 2021-05-31 10:56:50 -07:00
noahtalerman
4cca4e7e7f
Remove @fleetdm.com emails from fleetdm/fleet repo (#882)
- In tests and documentation, replace `@fleetdm.com` with `@example.com`
- In documentation, replace `hello@fleetdm.com` with `fleetdm.com/contact`
- In documentation, replace `security@fleetdm.com` with `fleetdm.com/contact`
- In Dockerfiles, replace `engineering@fleetdm.com` with `hello@fleetdm.com`. These two files are the only remaining files with a `@fleetdm.com` email.
2021-05-27 17:19:14 -04:00
Zach Wasserman
a17556b2db Merge branch 'master' into teams 2021-04-30 09:40:10 -07:00
Zach Wasserman
1e78c0ffe2
Speed up CI build/test (#657)
- Use NODE_ENV=development for Webpack in CI.
- Add caching for Webpack modules in development.
- Remove time of day from dates in version string (helps with build caching).
- Use Go cache in CI.

This makes about a 20% savings on the total time for the CI run.
2021-04-16 16:14:56 -07:00
Gabriel Hernandez
04712c0426 Merge master into teams 2021-04-14 17:52:15 +01:00
Zach Wasserman
9f71fcf440
Speed up MySQL tests (#585)
Improves MySQL test time (on my 2020 MBP) to ~18s from ~125s.

- Use separate databases for each test to allow parallelization.
- Run migrations only once at beginning of tests and then reload
  generated schema.
- Add `--innodb-file-per-table=OFF` for ~20% additional speedup.
2021-04-03 11:42:27 -07:00
Gabe Hernandez
be77b0de59 add tests for new manage users UI and improve checkbox accessibility (#536)
* e2e test for manage user page, and updating styles for ui components

* make checkbox more accessible and create e2e test around creating user

* add react testing library and use it for radio testing

* clean up comments

* update docs and clean up
2021-03-31 11:58:38 -07:00
Zach Wasserman
2203bd81a2
Add support for IdP-initiated SSO login (#556)
This feature is off by default due to minor potential security concerns
with IdP-initiated SSO (see
https://auth0.com/docs/protocols/saml-protocol/saml-configuration-options/identity-provider-initiated-single-sign-on#risks-of-using-an-identity-provider-initiated-sso-flow).

Closes #478
2021-03-30 12:56:20 -07:00
Zach Wasserman
58d1d025a4
Upgrade go-bindata to maintained github.com/kevinburke/go-bindata (#512)
- This seems to be the maintained, trusted (by Homebrew, etc.) version
  of go-bindata.
- Add tools.go file to pin version with go modules.
- Use go run to run the binary, making easier configuration for new developers.
2021-03-22 11:03:03 -07:00
Zach Wasserman
fbc1636994
Improve E2E testing and test documentation (#448)
- Add Makefile commands for E2E testing.
- Document E2E testing.
- Cleanup other test documentation.
2021-03-11 15:55:58 -08:00
Zach Wasserman
1d23c1452d
Add cleanup before make generate step (#386)
Older files building up in the assets directory was causing binary sizes
to become larger over time. This change should keep binary sizes consistent.
2021-03-04 18:16:20 -08:00
Zach Wasserman
20f21fafe4
Migrate tests to GitHub Actions and add E2E testing (#381)
- Migrate unit tests and linting from CircleCI to GitHub Actions
- Add E2E test in CI run
2021-03-04 17:13:28 -08:00
Zach Wasserman
305a285a35
Remove github.com/golang/dep from Makefile (#336)
This has been long unused in favor of Go modules.
2021-02-18 13:05:08 -08:00
Zach Wasserman
e2e7e4707d
Update database migration tooling (#281)
- Use updated github.com/fleetdm/goose that generates templates
  requiring less editing.
- Add `make migration` to Makefile.
- Update documentation.
2021-02-05 09:48:06 -08:00
Zach Wasserman
c78209dd51
Clean up development files (#259)
Remove unused files and update with new developer defaults
2021-02-01 19:21:17 -08:00
Zach Wasserman
7d299ca6f7
Add fleetctl.exe.zip to release process (#80)
Closes #56
2020-12-02 08:24:34 -08:00
Zach Wasserman
0670db66c4
Migrate JS tests to Jest and update libraries (#74)
- Move from Mocha to Jest for JS testing (Jest seems to have better support for
 'watching' tests and a more active community these days).
- Codemod existing tests to Jest syntax (using https://github.com/skovhus/jest-codemods)
- Fix some errors in tests that were previously hidden.
- Update Babel.
2020-12-01 10:15:12 -08:00
Zach Wasserman
6dccabb5b0
Clean up output of JS test errors (#63)
- Output easy to parse stack traces during run of tests
- Fix some spurious warnings and errors in tests
- Add --exit flag to Mocha invocation to fix hang due to timers in ACE editor
2020-11-24 08:25:52 -08:00
Zach Wasserman
89c775dd95
Include fleetctl binary archives in release (#31)
This adds tooling to include fleetctl binaries (in separate .tar.gz
archives for each platform) in the release.
2020-11-12 18:03:01 -08:00
Zachary Wasserman
ecacbbd663
Update Docker image name in Makefile (#23)
One additional spot that was missed previously.
2020-11-04 22:16:51 -08:00
Zachary Wasserman
394e5a2e86
Update Docker image name in Makefile (#19) 2020-11-04 21:36:25 -08:00
James Alseth
4a1d7c7785
Makefile: don't generate JS assets on xp-fleetctl target (#2308) 2020-09-27 09:45:22 -07:00
James Alseth
44c339699a
Remove -i flag from Go builds (#2307)
The -i (install) flag is not necessary and caused issues with building in some scenarios.

Fixes #2287
2020-09-25 10:30:29 -07:00
Zachary Wasserman
3fb76c4154
Remove typescript-require (#2254)
This JS import was unused and causes problems when running tests on Node
14.
2020-07-06 17:02:25 -07:00
Zachary Wasserman
ed79c00341
Explicitly disable CGO in build (#2229)
Fleet does not use CGO. In some build situations, not explicitly
disabling CGO results in binaries that have linking errors when running
on an Alpine Docker container. This change should fix the build for
those containers.
2020-04-17 16:02:05 -07:00
Zachary Wasserman
45f6a74740
Allow import of github.com/kolide/fleet (#2213)
Previously a Go package attempting to import Fleet packages would run
into an error like "server/kolide/emails.go:93:23: undefined: Asset".

This commit refactors bindata asset handling to allow importing Fleet as
a library without changing the typical developer experience.
2020-03-29 19:22:04 -07:00
Zachary Wasserman
5124932dc4
Update Makefile to tag and push version to Docker (#2150)
Previously only the Git SHA and `latest` were pushed by default and
the version had to be tagged and pushed manually.
2019-11-17 14:09:29 -08:00
Zachary Wasserman
75c79efd3b
Yarn run commands in local JS environment (#2118)
Ensures that the JS environment specified in the repo is used when running the tools.
2019-10-19 13:49:48 -07:00
Zachary Wasserman
bc9782e9b0
Fix link flags for version information in binaries (#2099) 2019-08-14 11:49:18 -07:00
Zachary Wasserman
27bbf2ae22
Migrate dependencies to go modules (#2094)
These changes should be transparent to users and developers.

Thanks to @davepgreene who made the first stab at this.
2019-08-13 10:32:23 -07:00
Zachary Wasserman
c321715e1e
Enable MySQL tests in CI config (#2082) 2019-07-29 10:08:54 -07:00
Zachary Wasserman
7b1ecc0c28
Upgrade to Webpack 4 (#2079) 2019-07-29 09:40:16 -07:00
seph
91e365bbd5 Split up Go and JS in CircleCI configuration (#2081)
This removes reliance on the custom kolide/fleet-builder container for CI.
2019-07-29 09:31:42 -07:00
Zachary Wasserman
bf6c6b3a40 Update docs and Makefile to use Github releases for binaries (#2055) 2019-06-04 13:42:41 -04:00
Zachary Wasserman
386bb8a9b9
Add fleetctl to generated Docker images (#1896) 2018-08-08 16:21:49 -07:00
Zachary Wasserman
54f62183ee
Run make generate before make docker-build-release (#1891)
Ensure that assets are compiled before building Docker images. In the past we
have accidentally published images that were lacking assets.
2018-08-06 10:55:32 -07:00
Mike Arpaia
a172540b7b
Include fleetctl in binary bundle (#1801) 2018-05-23 13:19:01 -06:00
Zachary Wasserman
bf36d58c51
Allow make build to build fleet and fleetctl (#1770) 2018-05-08 16:56:44 -07:00
Victor Vrantchan
2ded63ea03 add pre-fleet to binary bundle and fix typo 2018-04-16 17:47:10 -04:00
Mike Arpaia
bcd59e2188
Use Kolide version of go-bindata after it got leftpaded (#1704) 2018-02-07 08:58:17 -07:00
Victor Vrantchan
381c6f1384
separate the docker build step from the docker push step (#1691)
Allows users without write access to docker hub to still build the container.
2018-01-23 16:31:42 -05:00
Clayton Burlison
a5e1007146 Fix typo in Makefile help (#1681) 2017-12-20 15:41:19 -08:00
Mike Arpaia
63d60d5f6a
always generate new assets when building the binary bundle 2017-11-22 13:19:13 -07:00
Mike Arpaia
796e0af8be
Initial CLI and file format for fleetctl
This PR implements a program called `fleetctl` which scaffolds a high level CLI interface which can be used to manage a Fleet server. Configuration is articulated using an intent-based API that resembles the API that is used to configure Kubernetes clusters. The idea here is to use the Kubernetes file format as a pattern to reduce the need for operators to become too intimately familiar with dramatically different file formats. (#1578)
2017-11-12 11:58:19 -07:00
Mike Arpaia
4a90414f2e make binary-bundle (#1575)
Make utility for generating binary bundles
2017-10-18 10:45:01 -06:00
Mike Arpaia
baeb80f3b5
eval pre-fleet for docker build containers 2017-10-17 17:30:02 -06:00
Mike Arpaia
d69e8e245d Make it harder to accidentally release macOS binaries (#1566) 2017-10-16 17:35:14 -06:00
Mike Arpaia
8425fe2214 Use dep instead of glide (#1564) 2017-10-13 09:00:58 -06:00
Mike Arpaia
90c623d27d Remove license linting (#1563) 2017-10-12 11:06:29 -06:00
Mike Arpaia
1e16b12638 Move cli directory to cmd/fleet (#1560) 2017-10-12 10:42:13 -06:00
Mike Arpaia
80b082ea26 Renaming CI/Packaging things to Fleet (#1556) 2017-10-04 15:28:11 -06:00
Mike Arpaia
018b91ab2c Rename project to Kolide Fleet (#1529) 2017-06-22 15:50:45 -04:00
Zachary Wasserman
0d11c8a995 Update go get packages in make deps (#1474) 2017-04-06 12:12:20 -07:00
Kyle Knight
a64d88ff67 Update Webpack to v2 (#1393) 2017-03-13 15:13:33 -04:00
Victor Vrantchan
fdb3c55562 add tools and scripts to generate apt and dpkg repositories (#1183)
the scripts in tools/pkgrepos can be used to update apt and yum repositories as well as create zip archives for a release. 

The dl.kolide.co repository is archived as a static bucket on GCP.
2017-02-16 11:47:10 -05:00
Mike Arpaia
b8805803fd Installation docs (#1214)
* Adding infrastructure install documentation

* publishing the latest tag on releases
2017-02-13 15:57:16 -07:00
Zachary Wasserman
728c2c3475 Add license linting and dependencies.md (#1184)
Adds a `make lint-license` command that will crawl through the Golang and
Javascript dependencies, trying to automatically determine the license of each
dependency. If any dependencies have incompatible licensing (or if the
automatic detection fails), the tool will print an error and exit with a
non-zero status code. After a successful run, the
docs/third-party/dependencies.md file will be updated with attribution
information as determined by the crawl.

The configuration file has been bootstrapped with the manual analysis needed for
all of the existing dependencies.
2017-02-10 12:51:33 -08:00
Zachary Wasserman
f4060402f4 Migrate NPM to Yarn (#1197)
- Modify `make deps` to use yarn
- Add `yarn.lock`
- Add yarn to `kolide-builder` docker image
- Remove `npm-shrinkwrap.json`
- Remove build for `node-sass` (fixes #1151)
2017-02-10 10:22:26 -08:00
Zachary Wasserman
de44b39411 Add npm-shrinkwrap.json and pin Bourbon (#1190)
Temporary workaround for #1189
2017-02-09 12:13:04 -08:00
Mike Arpaia
41c25443bf Use localhost if MySQL environment variable is not set (#1175)
I think that this will make it easier to use the demo dump utilities
with minimal configuration.
2017-02-06 12:34:56 -07:00
Victor Vrantchan
7297a87a74 Move deployment steps into circle.yml config (#1140) 2017-02-02 11:30:23 -05:00
Mike Arpaia
a000751bfe renaming kolide-ose to kolide (#1143) 2017-02-01 10:20:50 -07:00
Victor Vrantchan
589a813293 use version based on git tags (#1130) 2017-01-30 14:37:27 -05:00
Victor Vrantchan
0b017031df make command to build deb and rpm packages (#1128)
Add a make command which uses https://github.com/jordansissel/fpm
to build linux packages.
2017-01-30 11:34:29 -05:00
Mike Arpaia
444aa96c06 Demo database dump (#1058)
This PR includes:

- `make demo-dump` which dumps all tables from your running development Kolide instance into `./tools/app/demo.sql`

```
$> make demo-dump
mysqldump --extended-insert=FALSE --skip-dump-date \
        -u kolide -p \
        -h 192.168.99.100 kolide \
        > ./tools/app/demo.sql
Enter password: ******
$>
```
- `make demo-restore` which restores `./tools/app/demo.sql` into your MySQL database, to be demo'd and extended by your running Kolide instance

```
$> make demo-restore
mysql --binary-mode -u kolide -p \
        -h 192.168.99.100 kolide \
        < ./tools/app/demo.sql
Enter password: ******
```

This included demo dump contains the following content:

## Queries

- 34 queries shared as ~70 scheduled queries

## Packs

- 8 Packs
- 13 Scheduled Queries in the "Intrusion Detection" pack
- 7 Scheduled Queries in the "Osquery Monitoring" pack
- 4 Scheduled Queries in the "Asset Management" pack
- 12 Scheduled Queries in the "Hardware Monitoring" pack
- 8 Scheduled Queries in the "Incident Response" pack
- 8 Scheduled Queries in the "Compliance" pack
- 6 Scheduled Queries in the "Vulnerability Management" pack
- 10 Scheduled Queries in the "Systems Monitoring" pack

## Labels

- 2 Labels

## Hosts

There are intentionally no hosts. Live hosts should be fabricated using Docker and attached to a running demo instance, to better look and behave like a real infrastructure.
2017-01-23 10:32:19 -07:00
Jason Meller
35c7fd6e03 Build assets for production (#1022) 2017-01-19 10:24:10 -05:00
Victor Vrantchan
650bae2ffb remove dev mode from cli options (#1027) 2017-01-19 09:42:45 -05:00
John Murphy
56b8772f13 Modify User (as a regular user) fails #891 (#959) 2017-01-18 00:43:59 +08:00
John Murphy
f4ae2c1446 Added make task with coverage and race analysis (#754)
* Added make task with coverage and race analysis

* removed coverage and race conditons from test task

* changed test-analyze-go to analyze-go
2017-01-04 15:59:17 -06:00
John Murphy
62748bfbb1 App Settings - /admin/settings #363 (#590) 2016-12-20 15:54:30 -06:00
Mike Arpaia
4b2decc060 Fix for setting the NODE_PATH env var on Windows (#647)
* Fix for setting the NODE_PATH env var on Windows

* making the makefile a bit more uniform
2016-12-15 11:39:01 -05:00
Victor Vrantchan
3d47be28c6 change docker tag to use short git sha for version (#594)
master:
   switch "latest" to SHA
PRs:
   switch "dev-prNumber" to "dev-prNubmer-SHA"
2016-12-08 12:54:21 -05:00
Mike Arpaia
f2e030ace9 Fixing the goose dep to install the command (#543) 2016-11-29 12:21:46 -08:00
Mike Arpaia
a036c5da9f Add attributes to packs (#524)
* Adds created_by attribute to packs

This PR also updated the distributed query code to use the pattern
established here (service checks context)

* add enable/disable state to packs

* add query_count to packs API responses

* add host_count to packs API responses (very, very poorly)

* pack description should not be required

* counting hosts in packs via mysql

* removing extraneous newline in test

* Switch case instead of if/if else

* add description to update query for SavePack method

* change AND to WHERE in query as per @zwass

* add ordering and list options as per @murphybytes' suggestion
2016-11-22 13:56:05 -08:00
John Murphy
531535c168 Refactored database migrations to use goose (#515)
* Refactored database migrations to use goose
2016-11-19 01:02:51 +08:00