Custom Rules Panel

In this topic:

Overview

When you want to have the Attest tool analyze web pages and applications against rules that are specific to your organization's unique needs, it is possible to do so with the Custom Rules functionality on the Rules panel. Clicking the Rules link item in the Attest main menu (drop-down near the Attest logo at top of left pane) causes a Rules panel to appear that offers an Add custom ruleset button for displaying a form on the right pane for submitting a set of custom rules. The simple form consists of two text entry fields and an action button that allow you to set up custom rules that can be selected for running in the automated engine when a loaded page is analyzed on the Analyze panel.

Just like analyzing a page with the Attest rulesets, results will display any violations of your custom rules that are found, along with the information you specified in the custom ruleset (Target, HTML source, remediation Summary, More Info help link, etc.). All of the other action options available with standard rules also apply to your custom rule violations (Inspect, Highlight, Export, Upload, etc.). Note: There is a limit of 5 custom rule sets that are permitted at one time.

The four main components of the Custom Rules functionality in the Rules panel of the Attest extension, with the add button in left pane and form in right pane with two text entry fields and action button numbered 1-4 from top to bottom
  1. Add a ruleset button: In the Custom rulesets section of left pane of Rules panel, an +Add a ruleset command presents you with a form in the right pane for submitting a custom set of rules.
  2. Name for Custom Rules (alphanumeric only): This will be the name of the rule set that will appear in the Standards section of the Settings tab. It is important to both follow the conventions (alphanumeric, no spaces) and ensure the name will be meaningful and easily recognizable as a selection option.
  3. Enter JSON rules.textareaInstructions: JavaScript Object Notation (JSON) is the text-based standard to which the content must conform to work with the FireEyes II browser extension. For more information, see the Example below.
  4. SAVE AND USE RULESET button: Causes the custom rules to become a selectable option in the left sidebar pane menu of the Rules panel. For more information, see Selecting a Rule Set.

Custom Rule Example

The sample code that follows can serve as a working example of a properly-formatted Attest Custom Rule JSON file.

To download the example: customruletest.json


{
  "checks": [
    {
      "id": "test",
      "options": [
        "test"
      ],
      "evaluate": "function() { return false; }",
      "metadata": {
        "impact": "minor",
        "messages": {
          "pass": "how did you pass",
          "fail": "there is no way to pass"
        }
      }
    }
  ],
  "rules": [
    {
      "id": "test",
      "metadata": {
        "description": "Will always fail",
        "help": "There is no way to make this pass! It is for testing",
        "helpUrl": "https://foo.com/bar"
      },
      "selector": "html",
      "any": [],
      "all": ["test"],
      "none": [],
      "tags": [
        "wcag2aa"
      ]
    }
  ]
}

Custom Rulesets from Comply Projects: After signing in to Comply and selecting a project, any custom rulesets associated with that project are automatically loaded into the Rules panel and made available for selection. For related information, see Selecting a WorldSpace Comply Project.

Subtopics: