cisregistrysettings

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cisregistrysettings provides a set of functions to check various registry settings to ensure they adhere to the CIS Benchmark standards. Each function takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The functions return a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Index

Constants

View Source
const DNSClientRegistryPath = `SOFTWARE\Policies\Microsoft\Windows NT\DNSClient`

Variables

View Source
var RegistrySettingsMap = map[string]bool{}

RegistrySettingsMap is a map that stores the results of the registry settings checks. The key is the registry path and the value is a boolean indicating whether the registry setting adheres to the CIS Benchmark standards.

Functions

func CISRegistrySettings

func CISRegistrySettings(localMachineKey mocking.RegistryKey, usersKey mocking.RegistryKey) checks.Check

CISRegistrySettings is a function that checks various registry settings to ensure they adhere to the CIS Benchmark standards. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked.

Returns:

  • checks.Check: A check object containing the settings that do not adhere to the CIS Benchmark standards.

func CheckAutoConnectHotspot

func CheckAutoConnectHotspot(registryKey mocking.RegistryKey)

CheckAutoConnectHotspot is a helper function that checks the registry to determine if the system is configured to automatically connect to hotspots.

CIS Benchmark Audit list index: 18.5.23.2.1

func CheckControlLsa

func CheckControlLsa(registryKey mocking.RegistryKey)

CheckControlLsa is a helper function that checks the registry to determine if the system is configured with the correct settings for Control Lsa.

CIS Benchmark Audit list indices: 2.3.1.4, 2.3.2.1-2, 2.3.10.2-5, 2.3.10.10, 2.3.10.12, 2.3.11.1-3, 2.3.11.5, 2.3.11.7, 2.3.11.9-10

func CheckControlSAM

func CheckControlSAM(registryKey mocking.RegistryKey)

CheckControlSAM is a helper function that checks the registry to determine if the system is configured with the correct settings for Control SAM.

CIS Benchmark Audit list index: 1.1.6

func CheckCurrentVersionRegistry

func CheckCurrentVersionRegistry(registryKey mocking.RegistryKey)

CheckCurrentVersionRegistry is a helper function that checks the registry to determine if the system is configured with the correct settings for the current version.

CIS Benchmark Audit list indices: 2.3.4.1, 2.3.7.8, 2.3.7.9, 18.2.1, 18.4.1, 18.4.10

func CheckIntegerRegistrySettings

func CheckIntegerRegistrySettings(registryKey mocking.RegistryKey, registryPath string, settings []string, expectedValues []interface{})

CheckIntegerRegistrySettings is a helper function that checks the registry to determine if the system is configured with the correct integer settings.

Parameters:

  • registryKey (mocking.RegistryKey): The registry key used to access the system's registry.
  • registryPath (string): The path to the registry key to check.
  • settings ([]string): A slice of strings representing the names of the values to check.
  • expectedValues ([]interface{}): A slice of interface values representing the expected values of the registry keys.

Returns: None

func CheckIntegerStringRegistrySettings

func CheckIntegerStringRegistrySettings(registryKey mocking.RegistryKey, registryPath string,
	integerSettings []string, expectedIntegers []interface{}, stringSettings []string,
	expectedStrings []string)

CheckIntegerStringRegistrySettings is a helper function that checks the registry to determine if the system is configured with the correct integer and string settings.

Parameters:

  • registryKey (mocking.RegistryKey): The registry key used to access the system's registry.
  • registryPath (string): The path to the registry key to check.
  • integerSettings ([]string): A slice of strings representing the names of the integer values to check.
  • expectedIntegers ([]interface{}): A slice of interface values representing the expected integer values of the registry keys.
  • stringSettings ([]string): A slice of strings representing the names of the string values to check.
  • expectedStrings ([]string): A slice of strings representing the expected string values of the registry keys.

Returns: None

func CheckIntegerValue

func CheckIntegerValue(openKey mocking.RegistryKey, value string, expected interface{}) bool

CheckIntegerValue is a helper function that checks if the integer value of a registry key matches the expected value.

Parameters:

  • openKey (mocking.RegistryKey): The registry key to check.
  • value (string): The name of the value to check.
  • expected (interface{}): The expected value of the registry key.

Returns:

  • bool: A boolean value indicating whether the integer value of the registry key matches the expected value.

func CheckOtherRegistrySettings

func CheckOtherRegistrySettings(registryKey mocking.RegistryKey)

CheckOtherRegistrySettings is a function that checks various registry settings related to different (unrelated) registry keys to ensure they adhere to the CIS Benchmark standards. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked. Should be HKEY_LOCAL_MACHINE for this function.

Returns: None

func CheckPoliciesHKLM

func CheckPoliciesHKLM(registryKey mocking.RegistryKey)

CheckPoliciesHKLM is a function that checks various registry settings related to different policies to ensure they adhere to the CIS Benchmark standards. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked. Should be HKEY_LOCAL_MACHINE for this function.

Returns: None

func CheckPoliciesHKU

func CheckPoliciesHKU(registryKey mocking.RegistryKey)

CheckPoliciesHKU is a function that checks various registry settings related to different policies to ensure they adhere to the CIS Benchmark standards. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked. Should be HKEY_USERS for this function.

Returns: None

func CheckSecurePipeServers

func CheckSecurePipeServers(registryKey mocking.RegistryKey)

CheckSecurePipeServers is a helper function that checks the registry to determine if the system is configured with the correct settings for secure pipe servers.

CIS Benchmark Audit list indices: 2.3.10.7-8

func CheckServices

func CheckServices(registryKey mocking.RegistryKey)

CheckServices is a function that checks various registry settings related to different services to ensure they adhere to the CIS Benchmark standards. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked. Should be HKEY_LOCAL_MACHINE for this function.

Returns: None

func CheckSessionManager

func CheckSessionManager(registryKey mocking.RegistryKey)

CheckSessionManager is a helper function that checks the registry to determine if the system is configured with the correct settings for the session manager.

CIS Benchmark Audit list indices: 2.3.15.1-2, 18.3.4, 18.4.9

func CheckStringRegistrySettings

func CheckStringRegistrySettings(registryKey mocking.RegistryKey, registryPath string, settings []string, expectedValues []string)

CheckStringRegistrySettings is a helper function that checks the registry to determine if the system is configured with the correct string settings.

Parameters:

  • registryKey (mocking.RegistryKey): The registry key used to access the system's registry.
  • registryPath (string): The path to the registry key to check.
  • settings ([]string): A slice of strings representing the names of the values to check.
  • expectedValues ([]string): A slice of strings representing the expected values of the registry keys.

Returns: None

func CheckStringValue

func CheckStringValue(openKey mocking.RegistryKey, value string, expected string) bool

CheckStringValue is a helper function that checks if the string value of a registry key matches the expected value.

Parameters:

  • openKey (mocking.RegistryKey): The registry key to check.
  • value (string): The name of the value to check.
  • expected (string): The expected value of the registry key.

Returns:

  • bool: A boolean value indicating whether the string value of the registry key matches the expected value.

func CheckWDigest

func CheckWDigest(registryKey mocking.RegistryKey)

CheckWDigest is a helper function that checks the registry to determine if the system is configured with the correct settings for WDigest.

CIS Benchmark Audit list index: 18.3.7

func CheckWin10

func CheckWin10(registryKey mocking.RegistryKey)

CheckWin10 is a function that checks various registry settings specific to the Windows 10 CIS Benchmark Audit list. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked. Should be HKEY_LOCAL_MACHINE for this function.

Returns: None

func CheckWin11

func CheckWin11(registryKey mocking.RegistryKey)

CheckWin11 is a function that checks various registry settings specific to the Windows 11 CIS Benchmark Audit list. It takes a RegistryKey object as an argument, which represents the root key from which the registry settings will be checked. The function returns a slice of boolean values, where each boolean represents whether a particular registry setting adheres to the CIS Benchmark standards.

Parameters:

  • registryKey (mocking.RegistryKey): The root key from which the registry settings will be checked. Should be HKEY_LOCAL_MACHINE for this function.

Returns: None

func OpenRegistryKeyWithErrHandling

func OpenRegistryKeyWithErrHandling(registryKey mocking.RegistryKey, path string) (mocking.RegistryKey, error)

OpenRegistryKeyWithErrHandling is a helper function that opens a registry key and handles any errors that occur.

Parameters:

  • registryKey (mocking.RegistryKey): The registry key to open.
  • path (string): The path of the registry key to open.

Returns:

  • mocking.RegistryKey: The opened registry key.
  • error: An error object that describes the error (if any) that occurred while opening the registry key. If no error occurred, this value is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL