Slang Authoring Toolkit Quickstart Configuration
Updated Aug 30, 2023Slang 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
- The Slang Authoring Toolkit installer from the Customer Support Portal
- Slang license XML file
- The YAML Language Support Extension for VS Code
Steps
- Install Slang Authoring Toolkit.
- Create a Slang project.
- Customize the Slang project.
- Add rules to the project.
- Test the project syntax.
- Export Slang to SCAP as XML.
Step 1: Install Slang Authoring Toolkit
-
Run the Slang Authoring Toolkit installer.
-
Open VS Code.
If VS Code was open before beginning the installation, close and reopen the application.
-
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
-
Run this command:
slang scaffold
-
When prompted, enter the path to your Slang license XML file.
-
When prompted, enter a domain name.
For example, your organization name.
-
Name the project.
-
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.
-
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
-
Open
project.slang
and modify the title and description fields.In the Explorer pane,
Platform:
and theproject.slang
file turn red. -
Click to the right of
Platform:
and press Ctrl+Space to view the platform list. -
Select a platform from the list.
-
Click Save.
Step 4: Add rules to the project
-
In VS Code, in the Explorer window, open
group_1/rule_1.slang
. -
Right-click the file name and rename it
<rule_id>.slang
. -
Modify the
title
. -
Modify the
description
as needed. -
Delete
Add checks here
and typewindows.
to see a list of suggested checks. -
Select checks as needed.
-
Click to the right of
account :
and select Ctrl+Space to view suggested accounts. -
Select rules as needed.
-
Save the file.
-
Click the
group_1
folder. -
Click New File.
-
Name the file.
For example:
password_policies.slang
. -
Add rule content to the file. To complete the
password_policies.slang
sample:- 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 underANY
,NONE
,NOT_ALL
,ONE
, andXOR
.
- Hover over
- Under
windows.account.password_policy
, add a line that is indented to left-align withmaximimum_password_age
.Tip: Press Ctrl+Space to view additional password policy options.
- Click
allow_reversible_encryption
. - Press Ctrl+Space to select
true
orfalse
.
- Add this content:
-
Save the file.
-
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.
- In your project, select View > Problems.
Step 6: Export Slang to SCAP as XML
- Run this command:
slang export <project_name> <project_name>.xml
exported_scap
folder containing the XML file appears.