Skip to content

Execution Tips and Tricks.md

NocteDefensor edited this page Jul 31, 2025 · 4 revisions

Execution Tips and Tricks

Range Creation

Use the Prompt for Best Results

For creating new ranges, use the create-ludus-range prompt rather than individual tools:

Why the prompt works better:

  • Handles the complete workflow from requirements to deployment
  • More details in your requirements = higher accuracy
  • Automatically researches available roles and validates configurations
  • Built-in safety checks and schema validation

How to use it:

Create a range with: Windows domain controller, 3 workstations, SCCM server with SQL backend, and Splunk monitoring for a red team exercise

Be specific about:

  • Number and types of VMs needed
  • Operating systems (Windows Server 2019, Windows 10, etc.)
  • Specific software requirements (SCCM, Splunk, Elastic, etc.)
  • Network setup needs (domain, workgroup, VLANs)
  • Purpose of the lab (training, testing, red team exercise)

Save your configurations: Set save_config: true to keep the generated configuration for future use.

When the Prompt Misses Something

If the generated range doesn't include everything you need:

  • Ask the AI to review the prompt requirements again
  • Add the missing components specifically: "Also add Tailscale VPN to this range"
  • Use individual tools to modify the saved configuration file

Individual Tool Usage

Quick Status Checks

Use individual tools for fast information gathering:

Check range status:

What's the status of my current range?

List available templates:

Show me what base configurations are available

See what roles are available:

List all available role schemas

File Management

All configuration files use relative paths from ~/.ludus-mcp/range-config-templates/:

Good path examples:

  • base-configs/elastic-security.yml
  • my-configs/sccm-lab.yaml
  • user1/domain-setup.yml

Don't use:

  • ~/.ludus-mcp/range-config-templates/file.yml (absolute paths)
  • ../other-folder/config.yml (path traversal)
  • /home/user/configs/file.yml (outside sandbox)

Configuration Workflow

When building configurations manually:

  1. Start with a template:

    Show me the contents of base-configs/basic-ad-network.yml
    
  2. Modify and save:

    Save this modified configuration as my-configs/custom-sccm-lab.yml
    
  3. Validate before deploying:

    Validate the configuration in my-configs/custom-sccm-lab.yml
    

Command Execution

Use the Execute Prompt for Complex Commands

For Ludus CLI operations not covered by tools, use the execute-ludus-cmd prompt:

Safe execution:

Deploy my range configuration for user TestUser

The prompt will:

  • Check if a dedicated tool exists first
  • Analyze if the command is destructive
  • Ask for confirmation before dangerous operations
  • Handle admin vs user operations properly

When to Use Individual Tools vs CLI

Use dedicated tools for:

  • deploy_range instead of ludus range deploy
  • get_range_status instead of ludus range status
  • destroy_range instead of ludus range rm
  • list_user_ranges instead of ludus user ranges

Use CLI execution for:

  • Advanced troubleshooting commands
  • Operations not covered by dedicated tools
  • Checking detailed logs or system information

Working with Schemas

Understanding Available Roles

Before building configurations:

  1. List what's available:

    List all role schemas so I can see what's available
    
  2. Research specific roles:

    Show me the schema for synzack.ludus_sccm
    
  3. Check role dependencies: Look for usage_notes or dependency_example in schema files for deployment order requirements.

Custom Schemas

You can add your own role schemas:

  • Place YAML files in ~/.ludus-mcp/schemas/
  • Follow the format in Sample-schema.yaml
  • Use distinctive names to avoid conflicts: company.custom_role.yaml
  • Custom schemas persist through server updates

Deployment Best Practices

  1. Verify credentials: Ensure any required external credentials are properly configured

Deployment Process

  1. Set the configuration:

    Set my range configuration using my-configs/sccm-lab.yml
    
  2. Deploy and check status:

    Deploy my range and show me the status
    

Automation

  • Use natural language to cause LLM to perform automated tool chaining. Example "List all my users, get range status for each user and note any VM's that are powered down" should cause LLM to use multiple MCP tools to retrieve the desired information.

Be careful with destructive commands such as range destroy

Troubleshooting

Configuration Issues

Invalid YAML syntax:

  • Use the validation tool to identify syntax errors
  • Check indentation (use spaces, not tabs)
  • Verify all required fields are present

Schema validation failures:

  • Check that all role variables are correctly specified
  • Verify variable types match the schema (string, boolean, integer)
  • Ensure required variables have values

Role not found errors:

  • Use ludus_cli_exec to list ansible roles and collections
  • If the role is installable by ansible galaxy use ludus_cli_exec to install it.
  • Check spelling and exact role names

Deployment Issues

Range won't deploy:

  • Check range status and range deployment logs for specific error messages. LLM can check for you at the cost of tokens.
  • Verify Ludus server has sufficient resources
  • Ensure network connectivity (WireGuard/SSH)
  • Check for conflicting range deployments

Partial deployments:

  • Use get_range_status to see which VMs failed
  • Check Ludus server logs for specific errors
  • Consider deploying in smaller batches

Credential problems:

  • Verify external service credentials are properly set
  • Check placeholder formats in configurations
  • Re-run credential setup if needed

Recovery Procedures

Stuck deployments:

  • Tell the LLM to abort you target user's range deployment
  • Check status after aborting
  • Clean up any partial resources

Configuration mistakes:

  • Keep backups of working configurations
  • Use version numbers in filenames: config-v1.yml, config-v2.yml
  • Test major changes in isolated environments

Advanced Usage

Multi-User Environments

For admins managing multiple users:

  • Use user-specific subdirectories: user1/, user2/
  • Specify target users in deployment commands
  • Check user permissions before operations

Organization strategies:

  • Group configurations by project or purpose
  • Use descriptive names: sccm-with-adcs-single-domain.yaml
  • Document custom configurations with comments

Development workflow:

  • Start with base templates
  • Save working templates in range-config-templates\base-configs with a descriptive name and the LLM can use it for future reference.