Commit Graph

142 Commits

Author SHA1 Message Date
Sharon Katz
e0a40bbacf
Add the #15962 fix to mac14 (#16080)
- For this bug: #15962
2024-01-15 09:24:43 -05:00
Josh Brower
738c722502
Feature/CIS-Controls-Sonoma (#15980)
This PR adds support for CIS Controls for macOS 14 - Sonoma.

The CIS Control changes from macOS 13 to 14 was minimal:

- Removed 5.9
- Added 2.18.1
- tested by running the test profile (ee/cis/macos-14/test/profiles/on-device-dictiation-enabled.mobileconfig)

---------

Co-authored-by: Sharon Katz <121527325+sharon-fdm@users.noreply.github.com>
2024-01-11 12:51:01 -05:00
Noah Talerman
ae36ae6b94
Update CIS policy (#16022)
- For this bug: #15962
2024-01-10 14:54:49 -05:00
Josh Brower
717eb76715
Initial support for CIS Win11 Enterprise (#15425)
Closes https://github.com/fleetdm/fleet/issues/14907

Changelog details are here:
https://docs.google.com/spreadsheets/d/1HZn7e4zpd5nfxY0MhSdX8MkGpdpxyLdSZjk0Auo1WaQ/edit#gid=312045512
2023-12-06 10:24:09 -05:00
Josh Brower
40fbdb0c06
Windows_CIS_2.0.0_Update-01 (#13289)
Details here:
https://docs.google.com/spreadsheets/d/1HZn7e4zpd5nfxY0MhSdX8MkGpdpxyLdSZjk0Auo1WaQ/edit#gid=610757841
2023-10-30 11:31:52 -04:00
Sharon Katz
80df9e4c51
13461-missing-win10-CIS-9.3.9 (#13514) 2023-08-25 13:37:03 -04:00
Lucas Manuel Rodriguez
77c817aa0b
Fix Windows CIS policies issues found by new fleetctl apply checks (#13460)
Found while working on #12696.

This was caught be a recent check added by @mostlikelee to `fleetctl
apply` (#13294).

Sample error:
```sh
$ fleetctl apply --context loadtest -f ee/cis/win-10/cis-policy-queries.yml
Error: applying policies: policy names must be globally unique. Please correct policy "CIS - Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'\n" and try again.
```
2023-08-23 07:42:41 -03:00
Lucas Manuel Rodriguez
6a91bc54cf
Add tooling for load testing Windows CIS policies and fix typos in policy queries (#13384)
#11939

- This PR fixes typos in three CIS Windows queries (the queries were
failing with `invalid SQL syntax`).
- Also adds tooling to perform similar testing that we ran for macOS
(using `fleetd_tables` as an extension).
2023-08-18 17:32:22 -03:00
Lucas Manuel Rodriguez
810eb58b95
macOS CIS: Use find command (exposed as fleetd table) instead of relying on the osquery core file table (#12560)
#10292, #12554

When scanning tens of thousands of files for permissions, using the
`find` command exposed as a fleetd table is more performant than trying
to use the `file` table. This change caused the watchdog to *stop*
killing osquery because of exceeding memory or CPU limit.

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-06-29 16:22:41 -03:00
Lucas Manuel Rodriguez
feb4e65be6
Optimize macOS CIS query 5.1.5 (#12506)
#10292

The query was processing *every* file under `/Applications/`, which
makes it super expensive both in CPU usage and Memory footprint. This
query was the main culprit of triggering worker process kills by the
watchdog.

On some runs it triggered CPU usage alerts:
```
7716:W0623 15:38:05.402959 221732864 watcher.cpp:415] osqueryd worker (72976) stopping:
Maximum sustainable CPU utilization limit 1200ms exceeded for 12 seconds
```
And on other runs it triggered memory usage alerts:
```
4431 W0626 07:28:50.868021 147312640 watcher.cpp:424] osqueryd worker (21453) stopping:
Memory limits exceeded: 214020096 bytes (limit is 200MB)
```

For the above logs I used a custom osqueryd branch to be able to print
more information: https://github.com/osquery/osquery/pull/8070

The metrics for the old query were CPU usage: ~4521 ms
```
435:level=warn ts=2023-06-26T09:58:29.665712Z query=fleet_policy_query_1233 queryTime=4521 memory=12226560 msg="distributed query performance is excessive" hostID=308 platform=darwin
```
With the new query, CPU usage: ~210 ms.
```
23893:level=debug ts=2023-06-26T18:06:08.242456Z query=fleet_policy_query_1233 queryTime=210 msg=stats memory=0 hostID=308 platform=darwin
```
Basically a ~20x improvement.

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- ~[ ] Added/updated tests~
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-06-27 11:06:26 -03:00
Sharon Katz
b754cb096c
Add "username=''" to managed_policies queries (#10710)
https://github.com/fleetdm/fleet/issues/10602


@xpkoala this PR will require testing of all modified items.
Preferably, we should perform the tests before merging to master. Can we
use the dev branch for that? -- Items were tested locally.
2023-06-21 13:00:25 -05:00
Marcos Oviedo
05c24caa95
Addressing system test findings (#12210)
This relates to #11245
2023-06-08 10:47:04 -03:00
Marcos Oviedo
ebac8705ac
Addressing issues found during system test (#12205)
This relates to #11312 

`18.9.17.6`: Fixing the issue with policy pointing to a different GPO
and Registry value
`18.9.47.4.2`: Adding COLLATE NOCASE to avoid case sensitive issue with
SpynetReporting value
2023-06-08 10:45:43 -03:00
Sharon Katz
dc46116d44
Address not installed issue (#12165) 2023-06-06 13:37:43 -04:00
Marcos Oviedo
c6338af0a3
Adding cast to 18.9.108.4.2 (#12131)
This relates to #11668 

This change fixes a CAST issue on 18.9.108.4.2. More details
[here](https://fleetdm.slack.com/archives/C019WG4GH0A/p1685565728281039).
2023-06-06 10:37:21 -03:00
RachelElysia
9e8698c779
CIS - WIN10 - Fix 3 policies with false positive bugs (#11668) 2023-05-12 10:57:09 -04:00
Marcos Oviedo
e46d748bd2
Adding CIS non completed items that requires cis_audit table (#11380)
This relates to #11245
2023-05-12 11:55:46 -03:00
Marcos Oviedo
424baf431b
Pusing pending CIS items (#11511)
This relates to #11312 

This completes the last 20 pending CIS policies [here
](https://docs.google.com/spreadsheets/d/1HZn7e4zpd5nfxY0MhSdX8MkGpdpxyLdSZjk0Auo1WaQ/edit#gid=1819959040)
2023-05-12 11:38:17 -03:00
RachelElysia
2523ae39aa
CIS - Windows - Fix CIS_bullet_18.9.85.1.1 (#11650) 2023-05-12 09:41:40 -04:00
Sharon Katz
c3d960a036
start (#11503) 2023-05-05 12:19:20 -04:00
RachelElysia
bb3b788ce0
CIS - WIN10 - 18.9.81 to 18.9.83 (#11523) 2023-05-04 11:52:32 -04:00
Sharon Katz
a819a16fc4
17.8.1 (#11347)
Tested for Positive and Negative cases on my Win 10 Pro.
2023-05-04 10:44:26 -04:00
RachelElysia
8389531e3b
CIS - WIN10 - 18.9.72 to 18.9.75 (#11510) 2023-05-03 14:45:20 -04:00
Artemis Tosini
eb8de78a62
Add Windows 10 CIS 18.9.66-67 (#11143)
This is all 6 queries referenced in #10361. I've tested all queries on
Windows 10 Pro.

- [x] Manual QA for all new/changed functionality
2023-04-25 13:04:38 -04:00
RachelElysia
1fb9eeec64
CIS - WIN10 18.9.11.3.x (#11289) 2023-04-25 08:53:22 -04:00
RachelElysia
3d78751875
CIS - WIN10 18.9.11.2.x (#11254) 2023-04-20 15:54:53 -04:00
Sharon Katz
ab572553c6
CIS_WIN_19.1-6 (#10988) 2023-04-17 15:24:00 -04:00
RachelElysia
3bd1a77716
CIS - WIN10 - 18.9.47.13 - 18.9.48.x (#11170) 2023-04-17 15:07:33 -04:00
RachelElysia
627ae5bf23
CIS - WIN10 - 17.5.x (Unable to audit/query) (#11166) 2023-04-17 14:52:46 -04:00
RachelElysia
3c177aa928
CIS - WIN10 - 18.9.10 to 18.9.11 (#11101) 2023-04-12 12:47:35 -04:00
Artemis Tosini
d1cf7e5a44
Add Windows 10 CIS 18.9.65.3.9-11 (#11067)
I've tested all queries on my system. I'm not quite sure if the cast is
necessary but it was common other queries so I used it. This adds the
queries referenced in #10360

- [x] Manual QA for all new/changed functionality
2023-04-11 16:39:29 -04:00
Artemis Tosini
62b4627f29
Add Windows 10 CIS 18.9.65.3.x (#11007)
This adds all queries referenced in #10359. Some are in the
non-completed since I couldn't test. The referenced UI path didn't exist
on the latest version if Wondows 10 and the ADMX is supposed to be built
in on recent version of Windows.

# Checklist for submitter
- [x] Manual QA for all new/changed functionality
2023-04-11 15:26:27 -04:00
Sharon Katz
e76adbecc8
CIS_WIN_18.5.9.2-BUG-FIX (#10955)
1. FIX for **18.5.9.2** - successfully tested for positive/negative
cases.

2. BUG in **18.5.11.3** and **18.5.11.4** - Registry keys do not appear.
Moved to **`NON-COMPLETED`**
2023-04-11 13:35:32 -04:00
Marcos Oviedo
a576668cad
Pushing CIS policies from 18.9.103.1 to 18.9.105.2.1 (#10759)
This relates to #10366
2023-04-06 17:53:16 -03:00
Marcos Oviedo
4419820707
Pushing CIS policies for bullets 18.9.108.x.x (#10742)
This relates to #10367
2023-04-06 17:27:20 -03:00
Marcos Oviedo
242716c905
Adding COLLATE NOCASE to address case insesitive registry behavior (#11011)
It relates to bugs found in #9922
2023-04-05 17:22:07 -03:00
Sharon Katz
cea358f53a
CIS WIN 18.2 (#10876)
18.2.1 - successfully Tested for negative and positive cases
18.2.2 - successfully Tested for negative and positive cases
18.2.3 - successfully Tested for negative and positive cases
18.2.4 - successfully Tested for negative and positive cases
18.2.5 - successfully Tested for negative and positive cases
18.2.6 - successfully Tested for negative and positive cases
2023-04-05 10:52:24 -04:00
Artemis Tosini
0b6313bd6b
CIS win10 18.9.46-47 (#10916)
Many of these queries reference registry keys that do not exist so I
moved them to the NON-COMPLETED file. However, all queries name in
#10355 are included in either the main or non completed file.

- [x] Manual QA for all new/changed functionality
2023-04-04 15:41:19 -04:00
Roberto Dip
77d63f12dd
fix TestGroupFromBytesWithWin10CISQueries (#10953)
Go tests are failing in main with:

```
=== RUN   TestGroupFromBytesWithWin10CISQueries
    spec_test.go:69:
        	Error Trace:	/Users/roperzh/fleet/pkg/spec/spec_test.go:69
        	Error:      	Received unexpected error:
        	            	failed to unmarshal spec item error converting YAML to JSON: yaml: line 20: mapping values are not allowed in this context:
        	            	apiVersion: v1
        	            	kind: policy
        	            	spec:
        	            	  name: CIS - Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'
        	            	  platforms: win10
        	            	  platform: windows
        	            	  description: |
        	            	    This policy setting allows you to audit events generated by the management of task scheduler jobs or COM+ objects.
        	            	    For scheduler jobs, the following are audited:
        	            	      -  Job created.
        	            	      -  Job deleted.
        	            	      -  Job enabled.
        	            	      -  Job disabled.
        	            	      -  Job updated.
        	            	    For COM+ objects, the following are audited:
        	            	      -  Catalog object added.
        	            	      -  Catalog object updated.
        	            	      -  Catalog object deleted.
        	            	The recommended state for this setting is: Success and Failure.
        	            	  resolution: |
        	            	    Automatic method:
        	            	    Ask your system administrator to establish the recommended configuration via GP, set the following UI path to Success and Failure:
        	            	    'Computer Configuration\Policies\Windows Settings\Security Settings\Advanced Audit Policy Configuration\Audit Policies\Object Access\Audit Other Object Access Events'
        	            	  query: |
        	            	    SELECT 1 FROM mdm_bridge where mdm_command_input = "<SyncBody><Get><CmdID>1</CmdID><Item><Target><LocURI>./Device/Vendor/MSFT/Policy/Result/Audit/ObjectAccess_AuditOtherObjectAccessEvents</LocURI></Target></Item></Get></SyncBody>"
        	            	    AND mdm_command_output = 3;
        	            	  purpose: Informational
        	            	  tags: compliance, CIS, CIS_Level1, CIS_win10_enterprise_1.12.0, CIS_bullet_17.6.3
        	            	  contributors: sharon-fdm
        	Test:       	TestGroupFromBytesWithWin10CISQueries
--- FAIL: TestGroupFromBytesWithWin10CISQueries (0.31s)
```

This adds a missing indentation to make them pass.
2023-04-04 08:39:35 -03:00
Sharon Katz
992a68c435
WIN CIS 17.6.1 (#10912) 2023-04-03 15:09:26 -04:00
Sharon Katz
ba290ffbb7
move-18.9.47.9.4-to-not-completed (#10938)
18.9.47.9.4 needs to be tested then moved back to the main .yml
2023-04-03 15:06:59 -04:00
Sharon Katz
f42ea50cff
18.9.57.1 (#10861) 2023-03-30 13:31:55 -04:00
Sharon Katz
5f42f39019
CIS_WIN_18.9.47.9.x (#10791) 2023-03-29 16:10:15 -04:00
RachelElysia
a21c96330b
CIS - WIN10 - 19.7.28 to 19.7.47 (#10781) 2023-03-29 12:53:55 -04:00
Lucas Manuel Rodriguez
22774243e2
Delete cis-policy-query-verify-iCloud-Keychain-disabled.yml (#10851)
We already have 2.1.1.1 with the `enable`/`disable` approach in the main
yaml.
2023-03-29 13:29:10 -03:00
Artemis Tosini
1e976f0d25
Add Windows 10 CIS 17.1-17.3 queries (#10522)
These 6 queries are extremely similar so I just put them in a single
commit. These issues are tracked in #10139.
2023-03-29 11:01:05 -04:00
Sharon Katz
d54e354022
CIS MAC 1.1 fix (#10619) 2023-03-29 09:24:33 -04:00
Artemis Tosini
1d2ae58d5f
Add macOS CIS 5.3.2 (#10726)
Add 2 new tables: corestorage_logical_volumes and corestorage_logical_volume_families.
Add a query that uses these tables
2023-03-28 11:57:38 -04:00
Marcos Oviedo
518cbecfbf
cis18.9.100.x to cis18.9.102.x (#10717)
This relates to #10365
2023-03-23 17:54:16 -03:00
RachelElysia
ee116d14ca
CIS - WIN10 - 19.7.4 to 19.7.8 (#10715)
## Issue 
Cerra #10369

## Description
- Lots of trial and error to get the wild card to work (only works with
single \ in the path)
- 6 of 7 tested and working
- Final policy is intended for Windows 11
2023-03-23 17:08:00 -03:00