Scripts and Templates Standards

TLP:AMBER - Limited disclosure, recipients can only spread this on a need-to-know basis within their organization and its clients. Recipients may share TLP:AMBER information with members of their own organization and its clients, but only on a need-to-know basis to protect their organization and its clients and prevent further harm 

Overview

Rewst allows the definition of scripts and templates for further reusability of functions within the platform. For example, an email that is sent consistently or a PowerShell script that is run on endpoints through a task that invokes your RMM. These templates and scripts should have the following standards to ensure proper documentation and usage

 

Naming Best Practices

1. Prefix with Organization Name

  • Format[OrganizationName]
  • Application: Each Script/Template must be prefixed with the name of the organization it is developed for, enclosed in square brackets.
  • Example[eTop] Script Name

2. Descriptive Naming

  • Requirement: Script/Template names must concisely yet accurately describe the function and purpose of the workflow.
  • Guidelines:
    • Use clear and simple language.
    • Avoid technical jargon unless it is widely understood within the organization.

3. Length and Readability

  • Maximum Length: Script/Template names should not exceed 30 characters, including the organization prefix and version numbers.
  • Clarity: Ensure the name remains readable and understandable, even with length constraints.

4. Special Characters and Case Sensitivity

  • Allowed Characters: Use only alphanumeric characters and underscores.
  • Case Sensitivity: Script/Template names should be in Camel Case for better readability.
  • Example[eTop] Invoice Processing

5. Categories and Sub-Categorization

  • Categorization: Where applicable, include a category or sub-category prefix.
  • Example[eTop]HR_Onboarding Process

 

Scripts/Templates Best Practices

1. Include a detailed description

  • In addition to a detailed name, ensure there is a detailed description on each Script/Template.
  • This should include its purpose, actions, output, and method of execution.

2. Include tags

  • Each Script/Template should include comprehensive tagging to allow for searching in the list view.

3. Set correct language 

  • For scripts, select from PowerShell, Python, YAML, or Jinja
  • For templates, select from HTML or Markdown

4. Include data to return to Rewst (Scripts Only)

  • When executing a script, it should never be run as a "fire and forget" execution, and should include some sort of response after executing
  • For PowerShell scripts, this can be accomplished by collecting data in a PSCustomObject, serializing the object as JSON, and POSTing the data to a Rewst Webhook