Slang Authoring Toolkit Quickstart Configuration

Updated Aug 30, 2023

Slang Authoring Toolkit quickstart configuration

This procedure demonstrates the quickstart workflow to configure Slang Authoring Toolkit using Visual Studio Code. For more information about VS Code, see VS Code basics. Slang is a shorthand language for Security Content Automation Protocol (SCAP) in Yet Another Markup Language (YAML). For an overview of YAML, see YAML tutorial.

Requirements

Steps

  1. Install Slang Authoring Toolkit.
  2. Create a Slang project.
  3. Customize the Slang project.
  4. Add rules to the project.
  5. Test the project syntax.
  6. Export Slang to SCAP as XML.

Step 1: Install Slang Authoring Toolkit

  1. Run the Slang Authoring Toolkit installer.

  2. Open VS Code.

    If VS Code was open before beginning the installation, close and reopen the application.

  3. To confirm successful installation, run this command:

    slang -h

    Note: If you don’t see the Slang version and CLI, create a support ticket in the Customer Support Portal.

Step 2: Create a Slang project

  1. Run this command:

    slang scaffold
  2. When prompted, enter the path to your Slang license XML file.

  3. When prompted, enter a domain name.

    For example, your organization name.

  4. Name the project.

  5. To verify the Slang folder that was added to your home folder, run this command:

    ls ~/Slang

    The output should look similar to:

       ~/Slang/
       QuickStart/           : your new project
       schema/               : files used by VS Code Help
       license.xml           : your Slang license file
       Slang.dictionary.html : Slang file format documentation

Step 3: Customize the Slang project

The project.slang file contains general and default settings for your project. You can customize these settings in the project.slang file.

  1. In VS Code, select File > Open Folder and navigate to the project folder:

    Note: For Windows users, the project folder can be found under \Users\<username>\Slang

  2. Open project.slang and modify the title and description fields.

    In the Explorer pane, Platform: and the project.slang file turn red.

  3. Click to the right of Platform: and press Ctrl+Space to view the platform list.

  4. Select a platform from the list.

  5. Click Save.

Step 4: Add rules to the project

  1. In VS Code, in the Explorer window, open group_1/rule_1.slang.

  2. Right-click the file name and rename it <rule_id>.slang.

  3. Modify the title.

  4. Modify the description as needed.

  5. Delete Add checks here and type windows. to see a list of suggested checks.

  6. Select checks as needed.

  7. Click to the right of account : and select Ctrl+Space to view suggested accounts.

  8. Select rules as needed.

  9. Save the file.

  10. Click the group_1 folder.

  11. Click New File.

  12. Name the file.

    For example: password_policies.slang.

  13. Add rule content to the file. To complete the password_policies.slang sample:

    1. Add this content:
      Rule:
         title: Password Policies 
         description: Password policies for QuickStart.
         checks:
            - ALL:
            - windows.account.lockout_policy:
               threshold: 5
               duration: 5 minutes
               observation_window: 1 hour
            - windows.account.password_policy:
               maximum_password_age: 30 days
               minimum_passwords_remembered: 100
               require_password_complexity: true

      Tips:

      • Hover over threshold to see a parameter description.
      • Checks in ALL: can be grouped under ANY, NONE, NOT_ALL, ONE, and XOR.
    2. Under windows.account.password_policy, add a line that is indented to left-align with maximimum_password_age.

      Tip: Press Ctrl+Space to view additional password policy options.

    3. Click allow_reversible_encryption.
    4. Press Ctrl+Space to select true or false.
  14. Save the file.

  15. Rename the group_1 folder.

    For example: Account_Policies.

    Tip: Add and nest multiple folders to organize your rules.

Step 5: Test the project syntax

After creating the project, check your Slang syntax for problems.

Step 6: Export Slang to SCAP as XML

Next steps

See also