### Start local MkDocs server with pipenv Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Run these commands from the docs directory to start the local MkDocs server. Requires python3.8 and pipenv. After starting, access the site at http://localhost:8000. ```bash pipenv sync pipenv run mkdocs serve ``` -------------------------------- ### Training Event Common Fields Example Source: https://docs.platform.cyberrange.cz/extras/logging/logs Example JSON object showing the common fields present in all training events. Note the missing comma after the timestamp field in the source. ```json { "sandbox_id": 10, "pool_id": 3, "training_definition_id": 1, "training_instance_id": 1, "training_run_id": 1, "training_time": 0, "total_training_level_score": 0, "total_assessment_level_score": 0, "actual_score_in_level": 0, "level": 1, "level_order": 0, "user_ref_id": 1, "timestamp": 1636706806953 "type": "crczp.events.trainings.TrainingRunStarted" } ``` -------------------------------- ### containers.yml example with two containers and mappings Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox_dockers Defines two Docker containers (home-docker from an image, home-docker2 from a Dockerfile) and maps them to host 'deb' on ports 2222 and 2223. Container names must be unique and either an image or dockerfile must be specified. ```yaml containers: - name: home-docker image: debian - name: home-docker2 dockerfile: home-docker2/ container_mappings: - container: home-docker host: deb port: 2222 - container: home-docker2 host: deb port: 2223 ``` -------------------------------- ### Command log JSON example for cloud and local sandbox Source: https://docs.platform.cyberrange.cz/extras/logging/logs Shows the JSON structure for command log entries in both cloud and local sandbox environments. The cloud sandbox includes sandbox_id and pool_id fields, while the local sandbox includes user_id and access_token fields. Use this as a reference for the expected format when logging commands. ```json # CLOUD_SANDBOX { "cmd": "msfconsole", "cmd_type": "bash-command", "wd": "/home/debian", "username": "debian", "timestamp_str": "2021-11-12T10:29:37.988Z", "hostname": "home", "ip": "10.10.30.5", "sandbox_id": "11", "pool_id": "3" } # LOCAL_SANDBOX { "cmd": "msfconsole", "cmd_type": "bash-command", "wd": "/home/debian", "username": "debian", "timestamp_str": "2021-11-12T10:29:37.988Z", "hostname": "home", "ip": "10.10.30.5", "user_id": "21", "access_token": "secret-2541" } ``` -------------------------------- ### Example variables.yml Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/apg-variables Example variables.yml file that defines four variables: telnet_port (port type with min, max, and prohibited), secret (text type), username (username type), and encrypted_file (password type with length). Use variable names in the training level definition as Correct Answer - Variable Name instead of static answers. ```yaml telnet_port: type: port min: 1500 max: 65000 prohibited: [2323] secret: type: text username: type: username encrypted_file: type: password length: 5 ``` -------------------------------- ### Ansible inventory.yml example for small-sandbox Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-provisioning Example of the inventory.yml file generated by sandbox-service for a small-sandbox. It includes networking data such as ansible_host, user_network_ip, and interface routes, plus group definitions and global variables. Use this as a reference when writing Sandbox Provisioning playbooks. ```yaml all: hosts: home: ansible_host: 192.168.128.3 ansible_user: windows user_network_ip: 10.10.30.5 home-router: ansible_host: 192.168.128.7 ansible_user: debian interfaces: - def_gw_ip: 100.100.100.1 mac: 00:00:00:00:00:16 routes: [] ip_forward: true user_network_ip: 10.10.30.1 proxy-jump: ansible_host: jump-host-ip ansible_user: debian user_access_mgmt_name: pool-prefix user_access_present: true user_access_user_name: stack-name man: ansible_host: 10.10.10.10 ansible_user: man interfaces: - def_gw_ip: '' mac: 00:00:00:00:00:02 routes: - gw: 100.100.100.2 mask: 255.255.255.0 net: 10.10.20.0 - gw: 100.100.100.3 mask: 255.255.255.0 net: 10.10.30.0 ip_forward: true server: ansible_host: 192.168.128.2 ansible_user: debian user_network_ip: 10.10.20.5 server-router: ansible_host: 192.168.128.6 ansible_user: debian interfaces: - def_gw_ip: 100.100.100.1 mac: 00:00:00:00:00:13 routes: [] ip_forward: true user_network_ip: 10.10.20.1 children: custom-group: hosts: home: null server-router: null hidden_hosts: hosts: server: null hosts: hosts: home: null server: null management: hosts: man: null routers: hosts: home-router: null server-router: null ssh_nodes: hosts: home-router: null server: null server-router: null user_accessible_nodes: hosts: home: null home-router: null winrm_nodes: hosts: home: null vars: ansible_connection: psrp ansible_psrp_auth: certificate ansible_psrp_cert_validation: ignore ansible_psrp_certificate_key_pem: /root/.ssh/pool_mng_key ansible_psrp_certificate_pem: /root/.ssh/pool_mng_cert ansible_psrp_proxy: socks5://localhost:12345 vars: global_head_ip: 0.0.0.0 global_openstack_stack_id: heatstack-stack-id global_pool_id: 1 global_sandbox_allocation_unit_id: 1 global_sandbox_ip: 10.10.10.10 global_sandbox_name: stack-name global_ssh_public_mgmt_key: /root/.ssh/pool_mng_key.pub global_ssh_public_user_key: /root/.ssh/user_key.pub ``` -------------------------------- ### Training Event Additional Fields Example Source: https://docs.platform.cyberrange.cz/extras/logging/logs Example JSON object showing the additional fields for each event type, with comments indicating the event type. The source uses '###' for comments, which is not valid JSON. ```json { ### AssessmentAnswers "answers": "[{ \"questionId\": 4, \"answers\": [\"Graphical user interface of CyberRangeCZ Platform\"] }, { \"questionId\": 5, \"answers\": [{ \"statementOrder\": 1, \"optionOrder\": 1 }, { \"statementOrder\": 2, \"optionOrder\": 1 }, { \"statementOrder\": 0, \"optionOrder\": 0 }] }, { \"questionId\": 6, \"answers\": [\"null\"] }]" ### CorrectAnswerSubmitted "answer_content": "Top_Secret_Flag" ### HintTaken "hint_id": 15, "hint_penalty_points": 5, "hint_title": "Tool for password attacks" ### LevelCompleted "level_type": "ASSESSMENT" ### LevelStarted "level_type": "TRAINING", "max_score": 50, "level_title": "Finding open ports" ### SolutionDisplayed "penalty_points": 10 ### TrainingRunEnded "start_time": 1636706806877, "end_time": 1636706947806 ### WrongAnswerSubmitted "answer_content": "Very_Bad_Flag", "count": 3 } ``` -------------------------------- ### Adaptive training event additional fields example Source: https://docs.platform.cyberrange.cz/extras/logging/logs Example of additional fields for different event types. The block shows the extra fields for CorrectAnswerSubmitted, PhaseCompleted, PhaseStarted, and QuestionnaireAnswers events, with the QuestionnaireAnswers field containing a JSON string of question-answer objects. ```json { ### CorrectAnswerSubmitted "answer_content": "Top_Secret_Flag" ### PhaseCompleted "phase_type": "QUESTIONNAIRE", "phase_title": "Finding open ports" ### PhaseStarted "phase_type": "TRAINING", "phase_title": "Finding open ports" ### QuestionnaireAnswers "answers":"[QuestionAnswer{questionAnswerId=1, answers='[None]'}, QuestionAnswer{questionAnswerId=2, answers='[None]'}, QuestionAnswer{questionAnswerId=3, answers='[None]'}, QuestionAnswer{questionAnswerId=4, answers='[None]'}, QuestionAnswer{questionAnswerId=5, answers='[None]'}, QuestionAnswer{questionAnswerId=6, answers='[None]'}, QuestionAnswer{questionAnswerId=7, answers='[Low]'}, QuestionAnswer{questionAnswerId=8, answers='[Medium]'}]" } ``` -------------------------------- ### Adaptive training event common fields example Source: https://docs.platform.cyberrange.cz/extras/logging/logs Example of common fields for an adaptive training event. The type field uses the full event class name, and fields like task_id and task_order are null when the event is not tied to a specific task. ```json { "sandbox_id": 11, "pool_id": 3, "training_definition_id": 52, "training_instance_id": 152, "training_run_id": 5, "training_time": 2516, "phase_id": 6, "phase_order": 1, "task_id": null, "task_order": null, "user_ref_id": 1, "timestamp": 1636712942803, "type": "crczp.events.adaptive.trainings.PhaseStarted" } ``` -------------------------------- ### TrainingRunEnded event additional fields Source: https://docs.platform.cyberrange.cz/extras/logging/logs Additional fields for the TrainingRunEnded event, showing the start and end timestamps of the training run. ```json "start_time": 1636706806877, "end_time": 1636706947806 ``` -------------------------------- ### Footnote definitions Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Defines footnotes using the Footnotes extension. Labels start with a caret and may contain any inline text; content must start with the label followed by a colon and at least one space. The content can include multiple lines, paragraphs, code blocks, and other markdown syntax, with additional lines indented one level. ```markdown Footnotes[^1] have a label[^@#$%] and the footnote's content. [^1]: This is footnote content. [^@#$%]: A footnote on the label: "@#$%". ``` -------------------------------- ### Create SOCKS5 Proxy for User Access Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Set up a local SOCKS5 proxy on port 12345 for user access. Used to reach user-accessible VMs via a proxy. ```bash $ ssh -F ~/.ssh/pool-id-ID-sandbox-id-ID-user-config -N -D 12345 man ``` -------------------------------- ### Create SOCKS5 Proxy for Management Access Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Set up a local SOCKS5 proxy on port 12345 via the management config. Useful for tools that support SOCKS5 proxy. ```bash $ ssh -F ~/.ssh/pool-id-ID-sandbox-id-ID-management-config -N -D 12345 man ``` -------------------------------- ### Add a page to mkdocs.yml nav Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Base mkdocs.yml configuration showing the site_name and a nav section with a single Home page. Add new pages by adding lines to the nav object. ```yaml site_name: MkLorum nav: - Home: index.md ``` -------------------------------- ### User import JSON file structure Source: https://docs.platform.cyberrange.cz/user-guide-basic/administration-agenda/users JSON structure for the file selected after clicking 'Choose file' on the Users page. The 'users' list is mandatory; each user requires 'sub' and 'iss' matching the login and OIDC provider URL. Optional fields 'full_name', 'given_name', 'family_name' are filled on first login. Optional 'group_name' creates a group (must not already exist) and assigns users to it; if omitted, users are created without group assignment. ```json { "users": [ { "sub": "test-user", (MANDATORY) "iss": "https://test.oidc.com/oidc/", (MANDATORY) "full_name": "Test User", (OPTIONAL) "given_name": "Test", (OPTIONAL) "family_name": "User" (OPTIONAL) }, { ... } ], "group_name": "TEST GROUP" (OPTIONAL) } ``` -------------------------------- ### Sandbox Definition directory structure Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-definition Shows the minimal directory layout for a Sandbox Definition, including topology.yml, variables.yml, provisioning/playbook.yml, and preconfig/. ```text sandbox-definition/ ├── topology.yml ├── variables.yml └── provisioning/ └── playbook.yml └── preconfig/ ``` -------------------------------- ### Define sandbox topology with hosts, routers, networks, and groups Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/topology-definition Defines the topology for a sandbox named `small-sandbox`. It includes two hosts (one hidden), two routers, a WAN network with a custom name, two networks (only one user-accessible and connected to the UAN), and one group containing two nodes. The `hidden: True` flag on the server host makes it invisible in the topology. ```yaml name: small-sandbox hosts: - name: server base_box: image: debian-12-x86_64 mgmt_user: debian flavor: standard.small hidden: True volumes: - size: 16 - size: 2 - size: 9 - name: home base_box: image: windows-10-0.2.0 mgmt_user: windows mgmt_protocol: wirm flavor: standard.small routers: - name: server-router base_box: image: debian-12-x86_64 mgmt_user: debian flavor: standard.small - name: home-router base_box: image: debian-12-x86_64 mgmt_user: debian flavor: standard.small wan: name: internet-connection cidr: 100.100.100.0/24 networks: - name: server-switch cidr: 10.10.20.0/24 accessible_by_user: False - name: home-switch cidr: 10.10.30.0/24 net_mappings: - host: server network: server-switch ip: 10.10.20.5 - host: home network: home-switch ip: 10.10.30.5 router_mappings: - router: server-router network: server-switch ip: 10.10.20.1 - router: home-router network: home-switch ip: 10.10.30.1 groups: - name: custom-group nodes: - home - home-router ``` -------------------------------- ### SSH Direct Connection to User Access VM Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Connect directly to a user-accessible VM using the user SSH config file. The hostname must be specified. ```bash $ ssh -F ~/.ssh/pool-id-ID-sandbox-id-ID-user-config ``` -------------------------------- ### SSH Direct Connection to Management VM Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Connect directly to a management VM using the SSH config file. Use the sandbox-specific config file and the 'man' host. ```bash $ ssh -F ~/.ssh/pool-id-ID-sandbox-id-ID-management-config man ``` -------------------------------- ### Create a simple Markdown table Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Basic Markdown table syntax. The tables extension adds this syntax; it is useful for simple tabular data. ```markdown First Header | Second Header | Third Header ------------ | ------------- | ------------ Content Cell | Content Cell | Content Cell Content Cell | Content Cell | Content Cell ``` -------------------------------- ### Add About page to mkdocs.yml nav Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs mkdocs.yml nav configuration with an added About page. Add a line in the nav object to include a new page. ```yaml site_name: MkLorum nav: - Home: index.md - About: about.md ``` -------------------------------- ### Link to page in same directory Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Markdown link to a page in the same directory. Use regular Markdown linking syntax with the relative path to the target Markdown document. ```markdown Please see the [project license](license.md) for further details. ``` -------------------------------- ### Minimal Ansible playbook.yml Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-provisioning Use this minimal playbook when no provisioning is required. It defines a play targeting all hosts in the sandbox, satisfying the platform's requirement for a playbook.yml file. ```yaml - hosts: all ``` -------------------------------- ### Link to page in another directory Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Markdown link to a page in another directory. Include the relative directory path in the link, e.g., ../about/license.md. ```markdown Please see the [project license](../about/license.md) for further details. ``` -------------------------------- ### Dockerfile line to add /root/.local/bin to PATH Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox_dockers Add this line to a custom Dockerfile to update system variables for the root user. It prepends an export line to ~/.profile, adding /root/.local/bin to PATH. ```dockerfile RUN sed -i '1iexport PATH="${PATH}:/root/.local/bin"' ~/.profile ``` -------------------------------- ### vpn YAML definition for NetBird entrypoints and DNS Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/topology-definition Configuration for NetBird VPN access. The entrypoints section lists host or router names with routes in IPv4 CIDR for routing peers. The dns section specifies nameservers and optional search domains distributed to VPN clients. The vpn section is introduced in CyberRangeCZ Platform v2026.07. ```yaml vpn: entrypoints: - name: server routes: - 10.10.0.0/16 - name: server-router routes: - 192.168.0.0/16 dns: servers: - 10.10.20.5 search_domains: - sandbox.local ``` -------------------------------- ### monitoring_targets YAML definition for TCP, ICMP, and HTTP monitoring Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/topology-definition Configuration block for sandbox monitoring. The tcp section defines nodes with TCP ports to monitor, requiring an interface or address for each target. The icmp section lists nodes to ping, also requiring interface or address. The http section defines endpoints with URLs and optional check_string for health checks. Nodes can appear once per section. ```yaml monitoring_targets: tcp: - node: server-router targets: - port: 22 interface: ens3 - port: 22 address: 10.10.20.0/24 icmp: - node: server targets: - interface: ens3 - node: home targets: - address: 10.10.30.5 http: targets: - url: https://10.10.20.5 check_string: "Hello" ``` -------------------------------- ### Include image in documentation Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Markdown image syntax for including images in documentation. Use the regular Markdown image syntax with the relative path to the image file. ```markdown Cupcake indexer is a snazzy new project for indexing small cakes. ![Screenshot](img/screenshot.png) ``` -------------------------------- ### Extract SSH Access Zip (Management and User Access) Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Unzip the ssh-access.zip file into the ~/.ssh/ directory. Used for both management and user access stages. ```bash $ unzip ssh-access.zip -d ~/.ssh/ ``` -------------------------------- ### Local Port Forwarding for Management RDP Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Bind a VM port (e.g., RDP 3389) to a local port using SSH local port forwarding. Needed for clients without SOCKS5 support. ```bash $ ssh -F ~/.ssh/pool-id-ID-sandbox-id-ID-management-config -N -L 12345::3389 man ``` -------------------------------- ### Local Port Forwarding for User Access RDP Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Bind a VM port (e.g., RDP 3389) to a local port via SSH forwarding for user access. For clients without SOCKS5 support. ```bash $ ssh -F ~/.ssh/pool-id-ID-sandbox-id-ID-user-config -N -L 12345::3389 man ``` -------------------------------- ### Ansible play to restart docker containers after reboot Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox_dockers Add this play to the end of playbook.yml to restart Docker containers after tasks that require a reboot (e.g., disable-qxl). It runs on docker_hosts and uses community.docker.docker_compose with project_src '/home/user/containers/'. ```yaml - name: Prepare docker enabled machines hosts: - docker_hosts become: yes tasks: - name: Build docker containers community.docker.docker_compose: project_src: "/home/user/containers/" ``` -------------------------------- ### Enable SSH password authentication in /etc/ssh/sshd_config Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-access Set the parameter 'PasswordAuthentication yes' in the SSH daemon configuration file to allow password authentication for SSH access via Apache Guacamole. This is required for Linux-based systems. ```plaintext PasswordAuthentication yes ``` -------------------------------- ### Admonition note panel Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Creates a note panel using the Admonition extension. The title is automatically capitalized. Custom note panels can be created by adding an SVG icon and CSS rules. ```markdown !!! note You should note that the title will be automatically capitalized. ``` -------------------------------- ### Add nested pages to mkdocs.yml nav Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs mkdocs.yml nav configuration with nested pages under a Pages section. Use this YAML syntax to create sub-pages in the navigation. ```yaml site_name: MkLorum nav: - Home: index.md - Pages: - Page1: path-to-page1 - Page2: path-to-page2 ``` -------------------------------- ### variables.yml structure Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/apg-variables Defines the structure of the variables.yml configuration file. Each variable is a key with attributes type (mandatory) and optional min, max, length, and prohibited. The attributes are set to random values based on the configuration. ```yaml : - type: min: max: length: prohibited: [,,...] ``` -------------------------------- ### Retrieve Grafana admin password Source: https://docs.platform.cyberrange.cz/user-guide-advanced/sandboxes/sandbox-monitoring Retrieves the autogenerated Grafana admin password from the deployment directory. Run this command in the deployment directory after deployment. ```bash terraform output -raw monitoring_admin_password ``` -------------------------------- ### OIDC Client Redirect URIs and Post-Logout Redirect Source: https://docs.platform.cyberrange.cz/installation-guide/setting-up-oidc-provider Required redirect URIs and post-logout redirect URI for the OIDC client registration. The first block lists the redirect URIs for the application, and the second block specifies the post-logout redirect URI. Replace with the actual server address. ```text https:// https:///index.html https:///silent-refresh.html ``` ```text https:///logout-confirmed ``` -------------------------------- ### Abbreviation definitions Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Defines abbreviations using PHP Markdown Extra syntax. The abbreviation definitions are placed after the text and use the format *[ABBR]: expansion. The rendered output shows the abbreviations with tooltips. ```markdown The HTML specification is maintained by the W3C. *[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium ``` -------------------------------- ### Link to section with anchor Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Markdown link to a section within a target page using an anchor. The toc extension generates an ID for every header; use that ID as the anchor. ```markdown Please see the [project license](about.md#license) for further details. ``` -------------------------------- ### Fenced code block with language Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Shows how to define a fenced code block in Markdown with an optional language identifier. The first line contains three or more backticks, the last line contains the same number, and the language can be specified after the opening backticks. ```markdown ```python def fn(): pass ``` ``` -------------------------------- ### Custom admonition icon CSS variable Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Defines a custom admonition icon by adding a CSS variable to the :root block in /docs/stylesheets/extra.css. The variable uses the name of the note panel and an SVG data URI. ```css --md-admonition-icon--(name of note panel): url('data:image/svg+xml;charset=utf-8,'); ``` -------------------------------- ### Custom admonition icon CSS rules Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Adds CSS rules to style the custom admonition icon. The background-color sets the icon color, and the mask-image uses the CSS variable defined in the previous step. Place these lines under the :root block in /docs/stylesheets/extra.css. ```css .md-typeset .(name of note panel) > summary::before { background-color: (color of the icon, e.g. rgb(119, 119, 119)); -webkit-mask-image: var(--md-admonition-icon--(name of note panel)); mask-image: var(--md-admonition-icon--(name of note panel)); } ``` -------------------------------- ### Align columns in Markdown table Source: https://docs.platform.cyberrange.cz/extras/writing-documentation-mkdocs Markdown table with column alignment. Add colons to the separator lines to specify alignment: left, center, or right. ```markdown First Header | Second Header | Third Header :----------- |:-------------:| -----------: Left | Center | Right Left | Center | Right ``` -------------------------------- ### WrongAnswerSubmitted event additional fields Source: https://docs.platform.cyberrange.cz/extras/logging/logs Additional fields for the WrongAnswerSubmitted event, showing the content of the wrong answer and the number of wrong tries in the current phase. ```json "answer_content": "Very_Bad_Flag", "count": 3 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.