Customizing compliance results

You can customize compliance results if you have the Comply Report Content Administrator role.

You must have the Comply Report Content Administrator role to customize compliance results. For more information, see User role requirements.

Custom profiles

Custom profiles define a tailored set of compliance checks and parameters, allowing you to create or upload profiles that implement only the rules you need.

A profile defines a set of rules to be evaluated and the parameters for those rules. Custom profiles allow you to specify just a subset of the checks available in a standard to be deployed.

From the Main menu, go to Modules > Comply > Setup > Compliance.

You can either create a custom profile or upload one from a tailoring file.

Create a new custom profile

Create a custom profile by selecting rules from a standard, configuring selectors and values, and saving the profile for use in assessments.

  1. In the Custom Profiles tab, click the Create button.
  2. On the New Custom Profile page, enter a Name and Description.
  3. In the Rules section, select a standard from the Standard list.
  4. Select each rule you would like to include in your custom profile.
    Tip: Click Advanced Filter to filter the rules by category.
    Create custom profile
  5. Click Add Selection To Profile to move the selected rules to the Selected Rules section.

    To remove a rule that you added, select the rule and click Remove Selection From Profile.

  6. Some standards (for example, CIS Microsoft Windows Server 2008 and 2012) require you to choose a selector for certain rules.

    In the Selected Rules section, these rules have a selection list in the Selector column. In the CIS Windows example, set the MS (Member Server) or DC (Domain Controller) selector for each rule.

    Select rules for custom profile

    To set or change the selector for multiple rules, select the rules and click Change Selector.

    Change selector for multiple rules
  7. Click Create to create the new custom profile.

You can also modify some rule values within your custom profile. If a rule value is customizable, a value of true displays in the Can Customize column along with the default value for the rule in the Default Values column.

Note: You cannot delete a custom profile that is used in an assessment. You must delete the assessment first, and then you can delete the custom profile.
Customize a rule value
  1. Select the rule and click Modify Rule Value.

    Modify rule value
  2. In the Modify Custom Profile Value window, enter a Custom Rule Title and change the Custom value field.

    Edit custom rule
    Note: Rule titles occasionally include the value used in the rule. Customize the title of rules for which values have been changed. The customized rule titles will then show up in report results, question answers, and report exports. For example, If you provide a new value for the rule (L1) Ensure 'Enforce password history' is set to '24 or more password(s)', you can change 24 to match the custom value.
  3. Click Save. The new value will appear in the User-defined Values column. You can return to the Default Value of a rule by clicking Use Default.

On the Custom Profiles page, click a custom profile to view its details.

You will see the rules included in the custom profile as well as those for which the values have been modified.

Import a new custom profile

Import a new custom profile by selecting a standard, adding a description, and uploading the tailoring file.

  1. Click Import > Custom Profile.
  2. In the Import Custom Profile window, enter a Description.
  3. Select a standard from the Standard list.
  4. Click Select File and locate the tailoring file for the new profile.
    Note: A custom profile can also be specified with a tailoring file, which is supported in SCAP 1.2 and later.

Cloning custom profiles

Clone an existing custom profile, update its title, description, and rules, and then create the new profile.

  1. Select a custom profile and click Clone.
  2. Provide a new Title and Description for the duplicate custom profile.
  3. Make any necessary changes to the rules included in the custom profile.
  4. Click Create.

Editing custom profiles

Edit an existing custom profile, update its details and rules, and confirm any changes to associated assessments.

  1. Select a custom profile and click Edit edit.
  2. In the Details section, you can edit the Title and Description.
  3. In the Rules section, choose additional rules or select a new standard from the Standard list to select other rules.
    Note: If you choose to select a new standard, previously selected rules might no longer be valid. If a rule is invalid, No will be displayed as the value in the Valid column of the Selected Rules list. A warning also appears, indicating that invalid rules are selected.
  4. Click Update.
  5. If any of the selected rules are invalid, a confirmation window appears that invalid rules will automatically be removed from the custom profile.

    Click OK.

    confirm_invalid_rules
  6. If one or more assessments currently use this custom profile, a confirmation window appears. If you want to redeploy these assessments immediately, click Redeploy and Continue; otherwise, click Continue. Assessments with changes that are not redeployed will show a Warning warning next to them.

Custom checks

Create and manage custom checks in Comply by uploading or writing scripts for supported platforms, configuring check criteria, and interpreting case-sensitive results.

You can create custom checks in Comply to check a condition on endpoints that might not be included in any standard. For custom checks, rather than running the scan engine on downloaded content, Comply CX directly executes a user-provided script.

The following scripts are supported for each platform:

Windows:

  • VBScript (.vbs)

    executed with cmd.exe /d /c cscript custom_script.vbs

  • PowerShell (.ps1) executed with powershell -NonInteractive -ExecutionPolicy bypass -File custom_script.ps1

Linux/Unix/MacOS:

  • Bourne / Posix shell (.sh) executed with /bin/sh custom_script.sh

For more information, see Reference: Troubleshoot custom script issues.

CAUTION: You must have the Comply Custom Check Writer role to write custom checks. Apply this role cautiously. Users with the Comply Custom Check Writer permission can obtain high-privileged code execution rights on all Comply endpoints.
  1. From the Main menu, go to Modules > Comply > Setup > Compliance.

  2. On the Custom Checks tab, click the Create button.

    Create a custom check
  3. In the New Custom Check window, enter a Name and Description.

  4. In the Check Criteria section, enter and identifier, ID, for this check.

  5. Select the appropriate Severity and Platform.

  6. Add the custom check script using one of the following methods:

    • Upload a file: Click Select File and locate the script file on your computer. The maximum file size of a custom check is 1 MB.

    • Write inline: Enter or paste the script directly in the script editor field. This method does not require a separate file.

    Both methods support the same script types for each platform.

  7. Enter a Rationale for the check in the edit field.

  8. In the Fix Text field, enter information for remediating the check.

  9. Click Create. Your custom check will now show under Custom Checks and be available in the Custom Checks section of the page when you create a new compliance report.

Note: You cannot delete a custom check that is used in an assessment. You must delete the assessment first, and then you can delete the custom check.

The result of a custom check is indicated by the last line of output from the custom check. This value should appear on a line by itself after all other output and should return one of the following results:

Important: Results are case-sensitive.
Table 1. Custom check results

Result

Description

pass

All conditions are satisfied.

fail

All conditions are not satisfied.

error

Compliance evaluation could not be completed; therefore, the status of the endpoint(s) compliance has not been confirmed.

unknown

The result is unknown.

Reference: Troubleshoot custom script issues

Troubleshoot common issues with custom shell scripts in Comply CX, including environment differences, invalid /bin/sh syntax, and how to locate runtime error output.

Issue: There are errors when the script is run by CX, but it runs without errors when tested elsewhere.

This could be due to the shell script being written with enhanced bash script syntax that is not valid for /bin/sh. This occurs because the shebang line in any custom check script will be ignored. The shebang line is only evaluated when a script is run directly from the command line (./custom_script.sh). Comply CX invokes the script with /bin/sh and will ignore the shebang.

Issue: The shell script works fine on some machines, but does not work on others.

This issue may occur if the shell script is written for bash and some endpoints have /bin/sh redirected to /usr/bin/bash, while others do not. Comply CX will always run /bin/sh.

Issue: How to check for runtime execution errors

You cannot use Debug mode to check for custom shell script errors. Debug mode only applies to scan engine output, not custom checks.

To check for custom script errors, do the following:

  1. Go to the Comply results directory, <Tanium Client>/extensions/comply/data/results.

  2. Locate the sub folder for the assessment in the results folder

    . Result files are located there and sequentially numbered ( 0-results.xml, 1-results.xml). The custom check shell script output and STDERR output are in the relevant result file.

Custom ID mappings

Use custom ID mappings to associate compliance checks and rules with your own identifiers and display them in assessment results.

Use custom ID mappings to create a custom column on results that associates a specific tag with a custom check or rule identifier.

  1. From the Main menu, go to Modules > Comply > Setup > Compliance.

  2. On the Custom ID Mappings tab, click the Import button.

  3. In the New Custom ID window, enter a Name and Description.

  4. Click Browse and locate the custom ID mapping file.

  5. Click Import. Your custom ID will now show under Custom ID Mappings and be available in the Advanced Settings section when you create a new Compliance assessment.

Note: You cannot delete a custom ID that is used in an assessment. You must delete the assessment first, and then you can delete the custom ID.

Use the following file format for a custom ID mapping: Rule id|custom id

Example: xccdf_org.cisecurity.standards_rule_1.1.1_Create_Separate_Partition_for_tmp|company_policy_rule_42

Note: An assessment can only have a single custom ID mapping associated with it; however, it can have multiple standards and custom checks. When selecting the standards and custom checks, be aware that an assessment is targeted to a single action group.

View ID Mappings and Score Mappings in Interact

Use the custom ID hash from a Comply assessment in Interact to view the corresponding ID and score mappings in the results grid.

  1. Obtain the hash for the custom ID for a report by clicking on the assessment name on the Compliance Assessments page and expanding Get Details. You can click Copy to copy the hash.
  2. In Interact, ask a question such as Get Comply - Compliance Results from all machines and paste the hash in the Bundle hash field.
    Use hash in Interact

    Use the appropriate Comply sensor:

    • Comply - Compliance Results
    • Comply - Compliance Status
  3. Click Ask Question.
  4. The ID Mappings and Score Mappings columns in the results grid show these mappings.

Export custom check or ID mapping

Export a custom check or ID mapping from one Tanium Console and import it into another to reuse the same configuration.

To view, edit, or reuse a custom check or ID mapping, you can export it by doing the following:

  1. From the Main menu, go to Modules > Comply > Setup > Compliance. Click the Custom Checks tab.
  2. Select a custom check and click Export export_grid_button. You will select this exported file from the other Tanium console.
  3. Sign in to Tanium Console where you want to import the custom check and navigate to the Custom Checks tab.
  4. Click the Create button and select Custom Check.
  5. In the New Custom Check window, fill out the fields using the same information you entered for the exported file in the first Tanium console.
  6. Click Browse and choose the file you exported in the second step.
  7. Click Create.

If you have custom IDs to go along with the custom check, export and import them using the previous steps, but from the Custom ID Mappings tab.