CIS-Script icon indicating copy to clipboard operation
CIS-Script copied to clipboard

New OrgScore 6_3_6

Open phu-ngo opened this issue 2 years ago • 0 comments

https://github.com/usnistgov/macos_security/blob/main/rules/os/os_safari_advertising_privacy_protection_enable.yaml Can we add new OrgScore 6.3.6?


#!/bin/zsh
# shellcheck shell=bash

script_dir=$(dirname ${0:A})
projectfolder=$(dirname $script_dir)

source "${projectfolder}/Header.sh"

CISLevel="1"
audit="6.3.6 Ensure Advertising Privacy Protection in Safari Is Enabled (Automated)"
orgScore="OrgScore6_3_6"
emptyVariables
# Verify organizational score
runAudit
# If organizational score is 1 or true, check status of client
if [[ "${auditResult}" == "1" ]]; then
	method="Profile"
	remediate="Configuration profile - payload > com.apple.Safari > WebKitPreferences.privateClickMeasurementEnabled=true"

	appidentifier="com.apple.Safari"
	value="WebKitPreferences.privateClickMeasurementEnabled"
	prefValue=$(getPrefValuerunAsUser "${appidentifier}" "${value}")
	prefIsManaged=$(getPrefIsManagedrunAsUser "${appidentifier}" "${value}")
	comment="Advertising Privacy Protection in Safari Is Enabled"
	if [[ "${prefIsManaged}" == "true" && "${prefValue}" == "false" ]]; then
		result="Passed"
	else
		if [[ "${prefValue}" == "false" ]]; then
			result="Passed"
		else
			result="Failed"
			comment="Advertising Privacy Protection in Safari Is Disabled"
		fi
	fi
fi
printReport

phu-ngo avatar Dec 22 '22 03:12 phu-ngo