Slang Authoring Toolkit quickstart configuration

You can use this configuration workflow to get started with Slang Authoring Toolkit. During these steps, you will create and edit Slang files using Visual Studio Code (VS Code).

These resources are required:

These actions are required:

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 the application and then open it again.
  3. Run this command to confirm that the Slang Authoring Toolkit is installed:
    SHELL
    slang -h
    Note: If you do not see the Slang version and CLI, create a support ticket in the Customer Support Portal.

Create a Slang project

  1. Run this command:
    SHELL
    slang scaffold
  2. When prompted, enter the path to your Slang license XML file.
  3. When prompted, enter a domain name.
    For example, enter example.com.
  4. Name your project.
  5. To verify that the Slang folder was added to your home folder, run this command:
    SHELL
    ls ~/Slang
    Example of expected output:
    SHELL
    ~/Slang/
    <project_name>/          
    schema/   
    license.xml 
    Slang.dictionary.html
    Where:
    • project_name is the name of your new Slang project.
    • schema/ contains the files used by VS Code Help.
    • license.xml is your Slang license file.
    • Slang.dictionary.html is the Slang file format documentation.

Customize the Slang project

The project.slang file contains general and default settings for your project.

  1. In the VS Code menu, click File > Open Folder, and then navigate to your project folder.
    Note: For Windows users, use this path to find your project folder: \Users\username\Slang.
  2. Open project.slang, and then edit the title and description fields.
  3. In the Explorer pane, enter Platform:.
    The project.slang file turns red.
  4. Click to the right of Platform:, and then press Ctrl+Space to view the platform list.
  5. In the list, select a platform.
  6. Click Save.

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 then rename it rule_id.slang, where rule_id is the ID of your rule.
  3. Edit the title.
  4. Edit the description as needed.
  5. Delete Add checks here, and then enter windows. to see a list of suggested checks.
  6. Select checks as needed.
  7. Click to the right of account :, and then press Ctrl+Space to view the 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:
    1. Copy this content, and then add it to the new slang file:
      YAML
      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
      Tip:
      • Hover over threshold to see a parameter description.
      • Checks in ALL: can be grouped under ANY, NONE, NOT_ALL, ONE, and XOR.
    2. For the windows.account.password_policy option, add a line that is indented to align with maximum_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.

Test the project syntax

After you create the project, review your Slang syntax for problems.

In your project, click View > Problems.

Export Slang to SCAP as XML

Navigate to the Slang directory and run this command:
SHELL
slang export <project_name> <project_name>.xml
Where:
  • project_name is the name of your Slang project.
A new exported_scap folder containing the XML file appears at the base of your project directory. For example, ~/Slang/example_project/exported_scap.