diff --git a/salt/_runners/setup_hypervisor.py b/salt/_runners/setup_hypervisor.py index 6b3f289e8..35d1bad21 100644 --- a/salt/_runners/setup_hypervisor.py +++ b/salt/_runners/setup_hypervisor.py @@ -121,8 +121,8 @@ def _check_license(): log.error("LICENSE: No license_id found in license file") return False - if 'hvn' not in features: - log.error("LICENSE: 'hvn' feature not found in license") + if 'vrt' not in features: + log.error("LICENSE: 'vrt' feature not found in license") return False log.info("LICENSE: License validation successful") @@ -506,7 +506,7 @@ def setup_environment(vm_name: str = 'sool9', disk_size: str = '220G', minion_id if not _check_license(): return { 'success': False, - 'error': 'Invalid license or missing hvn feature', + 'error': 'Invalid license or missing vrt feature', 'vm_result': None } @@ -670,7 +670,7 @@ def create_vm(vm_name: str, disk_size: str = '220G'): if not _check_license(): return { 'success': False, - 'error': 'Invalid license or missing hvn feature', + 'error': 'Invalid license or missing vrt feature', } try: @@ -958,11 +958,6 @@ def regenerate_ssh_keys(): else: print("Failed to regenerate SSH keys") """ - # Check license before proceeding - if not _check_license(): - log.error("MAIN: Invalid license or missing hvn feature") - return False - log.info("MAIN: Starting SSH key regeneration") try: # Verify current state diff --git a/salt/common/tools/sbin_jinja/so-salt-emit-vm-deployment-status-event b/salt/common/tools/sbin_jinja/so-salt-emit-vm-deployment-status-event index 61f071130..fe51485e6 100644 --- a/salt/common/tools/sbin_jinja/so-salt-emit-vm-deployment-status-event +++ b/salt/common/tools/sbin_jinja/so-salt-emit-vm-deployment-status-event @@ -11,7 +11,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) -%} +{% if 'vrt' in salt['pillar.get']('features', []) -%} """ Script for emitting VM deployment status events to the Salt event bus. diff --git a/salt/hypervisor/init.sls b/salt/hypervisor/init.sls index 677ab8642..4a2edad75 100644 --- a/salt/hypervisor/init.sls +++ b/salt/hypervisor/init.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} hypervisor_log_dir: file.directory: diff --git a/salt/hypervisor/map.jinja b/salt/hypervisor/map.jinja index d19aacf48..da8716415 100644 --- a/salt/hypervisor/map.jinja +++ b/salt/hypervisor/map.jinja @@ -9,7 +9,7 @@ in the software, and you may not remove or obscure any functionality in the software that is protected by the license key." #} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {# Import defaults.yaml for model hardware capabilities #} {% import_yaml 'hypervisor/defaults.yaml' as DEFAULTS %} diff --git a/salt/hypervisor/tools/sbin_jinja/so-kvm-modify-hardware b/salt/hypervisor/tools/sbin_jinja/so-kvm-modify-hardware index 25506a0ae..ebd606b1e 100644 --- a/salt/hypervisor/tools/sbin_jinja/so-kvm-modify-hardware +++ b/salt/hypervisor/tools/sbin_jinja/so-kvm-modify-hardware @@ -11,7 +11,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} """ Script for managing hardware configurations of KVM virtual machines. This script provides diff --git a/salt/hypervisor/tools/sbin_jinja/so-qcow2-modify-network b/salt/hypervisor/tools/sbin_jinja/so-qcow2-modify-network index cd7869fd8..527131f3f 100644 --- a/salt/hypervisor/tools/sbin_jinja/so-qcow2-modify-network +++ b/salt/hypervisor/tools/sbin_jinja/so-qcow2-modify-network @@ -11,7 +11,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) -%} +{% if 'vrt' in salt['pillar.get']('features', []) -%} """ Script for modifying network configurations within QCOW2 virtual machine images. This script provides diff --git a/salt/libvirt/images/init.sls b/salt/libvirt/images/init.sls index 94cf4959d..c7734c69d 100644 --- a/salt/libvirt/images/init.sls +++ b/salt/libvirt/images/init.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls.split('.')[0] in allowed_states or sls in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} include: - libvirt.packages diff --git a/salt/libvirt/init.sls b/salt/libvirt/init.sls index 3e21089b2..f82b3d9c1 100644 --- a/salt/libvirt/init.sls +++ b/salt/libvirt/init.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% from 'libvirt/map.jinja' import LIBVIRTMERGED %} include: diff --git a/salt/libvirt/packages.sls b/salt/libvirt/packages.sls index d2cbd6e2d..d0de3d81f 100644 --- a/salt/libvirt/packages.sls +++ b/salt/libvirt/packages.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls.split('.')[0] in allowed_states or sls in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} # allows for creating vm images # any node manipulating images needs this diff --git a/salt/libvirt/ssh/users.sls b/salt/libvirt/ssh/users.sls index 375a42c38..0e9c045a0 100644 --- a/salt/libvirt/ssh/users.sls +++ b/salt/libvirt/ssh/users.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls.split('.')[0] in allowed_states or sls in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% from 'vars/globals.map.jinja' import GLOBALS %} {% if GLOBALS.is_manager %} diff --git a/salt/manager/hypervisor.sls b/salt/manager/hypervisor.sls index d4f07946c..84cd478c8 100644 --- a/salt/manager/hypervisor.sls +++ b/salt/manager/hypervisor.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls.split('.')[0] in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% set manager_hostname = grains.id.split('_')[0] %} # Check if hypervisor environment has been set up diff --git a/salt/manager/tools/sbin/so-minion b/salt/manager/tools/sbin/so-minion index 222119bde..211b036cf 100755 --- a/salt/manager/tools/sbin/so-minion +++ b/salt/manager/tools/sbin/so-minion @@ -235,7 +235,7 @@ function acceptminion() { if [[ "$MINION_ID" == *"_hypervisor" ]]; then FEATURES=$(/usr/sbin/so-yaml.py get /opt/so/saltstack/local/pillar/soc/license.sls features) - if [[ $? -ne 0 || ! "$FEATURES" =~ "hvn" ]]; then + if [[ $? -ne 0 || ! "$FEATURES" =~ "vrt" ]]; then error_msg="Hypervisor nodes are a feature supported only for customers with a valid license.\n Contact Security Onion Solutions, LLC via our website at https://securityonionsolutions.com\n for more information about purchasing a license to enable this feature." log "ERROR" "$error_msg" echo -e "Error: $error_msg" @@ -869,7 +869,7 @@ function createRECEIVER() { function createHYPERVISOR() { log "INFO" "Creating HYPERVISOR configuration for minion $MINION_ID" FEATURES=$(/usr/sbin/so-yaml.py get /opt/so/saltstack/local/pillar/soc/license.sls features) - if [[ $? -ne 0 || ! "$FEATURES" =~ "hvn" ]]; then + if [[ $? -ne 0 || ! "$FEATURES" =~ "vrt" ]]; then error_msg="Hypervisor nodes are a feature supported only for customers with a valid license.\n Contact Security Onion Solutions, LLC via our website at https://securityonionsolutions.com\n for more information about purchasing a license to enable this feature." log "ERROR" "$error_msg" echo -e "Error: $error_msg" @@ -964,7 +964,7 @@ function updateMineAndApplyStates() { # We don't want a hypervisor node to highstate until the image is downloaded and built. This will be triggered from the setup_hypervisor runner if [[ "$NODETYPE" == "HYPERVISOR" ]]; then FEATURES=$(/usr/sbin/so-yaml.py get /opt/so/saltstack/local/pillar/soc/license.sls features) - if [[ $? -ne 0 || ! "$FEATURES" =~ "hvn" ]]; then + if [[ $? -ne 0 || ! "$FEATURES" =~ "vrt" ]]; then error_msg="Hypervisor nodes are a feature supported only for customers with a valid license.\n Contact Security Onion Solutions, LLC via our website at https://securityonionsolutions.com\n for more information about purchasing a license to enable this feature." log "ERROR" "$error_msg" echo -e "Error: $error_msg" @@ -1058,7 +1058,7 @@ case "$OPERATION" in "addVM") log "INFO" "Adding VM minion $MINION_ID" FEATURES=$(/usr/sbin/so-yaml.py get /opt/so/saltstack/local/pillar/soc/license.sls features) - if [[ $? -ne 0 || ! "$FEATURES" =~ "hvn" ]]; then + if [[ $? -ne 0 || ! "$FEATURES" =~ "vrt" ]]; then error_msg="Hypervisor nodes are a feature supported only for customers with a valid license.\n Contact Security Onion Solutions, LLC via our website at https://securityonionsolutions.com\n for more information about purchasing a license to enable this feature." log "ERROR" "$error_msg" echo -e "Error: $error_msg" diff --git a/salt/manager/tools/sbin_jinja/so-salt-cloud b/salt/manager/tools/sbin_jinja/so-salt-cloud index cddcbb474..f1346130f 100644 --- a/salt/manager/tools/sbin_jinja/so-salt-cloud +++ b/salt/manager/tools/sbin_jinja/so-salt-cloud @@ -11,7 +11,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) -%} +{% if 'vrt' in salt['pillar.get']('features', []) -%} """ Script for automated virtual machine provisioning and configuration in Security Onion's virtualization infrastructure. diff --git a/salt/orch/dyanno_hypervisor.sls b/salt/orch/dyanno_hypervisor.sls index 624bb12f3..859e87df6 100644 --- a/salt/orch/dyanno_hypervisor.sls +++ b/salt/orch/dyanno_hypervisor.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% do salt.log.info('dyanno_hypervisor_orch: Running') %} {% set vm_name = None %} diff --git a/salt/orch/vm_pillar_clean.sls b/salt/orch/vm_pillar_clean.sls index 5c0011f6f..ca5c16054 100644 --- a/salt/orch/vm_pillar_clean.sls +++ b/salt/orch/vm_pillar_clean.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% do salt.log.debug('vm_pillar_clean_orch: Running') %} {% set vm_name = pillar.get('vm_name') %} diff --git a/salt/salt/cloud/init.sls b/salt/salt/cloud/init.sls index 5ba8b96da..114133204 100644 --- a/salt/salt/cloud/init.sls +++ b/salt/salt/cloud/init.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% from 'salt/map.jinja' import SALTVERSION %} {% set HYPERVISORS = salt['pillar.get']('hypervisor:nodes', {} ) %} diff --git a/salt/salt/cloud/reactor_config_hypervisor.sls b/salt/salt/cloud/reactor_config_hypervisor.sls index fcf1a5dfe..d0851d75c 100644 --- a/salt/salt/cloud/reactor_config_hypervisor.sls +++ b/salt/salt/cloud/reactor_config_hypervisor.sls @@ -11,7 +11,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls.split('.')[:2]|join('.') in allowed_states %} -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} reactor_config_hypervisor: file.managed: - name: /etc/salt/master.d/reactor_hypervisor.conf diff --git a/salt/salt/engines/master/virtual_node_manager.py b/salt/salt/engines/master/virtual_node_manager.py index 42d8f6725..78f8f0294 100644 --- a/salt/salt/engines/master/virtual_node_manager.py +++ b/salt/salt/engines/master/virtual_node_manager.py @@ -63,7 +63,7 @@ State Files: - .error: Error state with detailed message Notes: - - Requires 'hvn' feature license + - Requires 'vrt' feature license - Uses hypervisor's sosmodel grain for hardware capabilities - Hardware allocation based on model-specific configurations - All created files maintain socore ownership @@ -80,7 +80,7 @@ Description: - Lock remains until clean shutdown or error 2. License Validation - - Verifies 'hvn' feature is licensed + - Verifies 'vrt' feature is licensed - Prevents operation if license is invalid 3. Configuration Processing @@ -567,7 +567,7 @@ def mark_invalid_hardware(hypervisor_path: str, vm_name: str, config: dict, erro log.error("Failed to create invalid hardware file: %s", str(e)) raise -def validate_hvn_license() -> bool: +def validate_vrt_license() -> bool: """Check if the license file exists and contains required values.""" if not os.path.exists(LICENSE_PATH): log.error("License file not found at %s", LICENSE_PATH) @@ -588,7 +588,7 @@ def validate_hvn_license() -> bool: log.error("No license_id found in license file") return False - if 'hvn' not in features: + if 'vrt' not in features: log.error("Hypervisor nodes are a feature supported only for customers with a valid license.\n" "Contact Security Onion Solutions, LLC via our website at https://securityonionsolutions.com\n" "for more information about purchasing a license to enable this feature.") @@ -889,7 +889,7 @@ def start(interval: int = DEFAULT_INTERVAL, """ log.info("Starting virtual node manager engine") - if not validate_hvn_license(): + if not validate_vrt_license(): return # Attempt to acquire lock diff --git a/salt/salt/files/hvn_engine.conf b/salt/salt/files/vrt_engine.conf similarity index 100% rename from salt/salt/files/hvn_engine.conf rename to salt/salt/files/vrt_engine.conf diff --git a/salt/salt/master.sls b/salt/salt/master.sls index d6bd84496..413c90cd5 100644 --- a/salt/salt/master.sls +++ b/salt/salt/master.sls @@ -14,7 +14,7 @@ include: - salt.minion -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} - salt.cloud - salt.cloud.reactor_config_hypervisor @@ -48,11 +48,11 @@ pillarWatch_engine: - name: /etc/salt/engines/pillarWatch.py - source: salt://salt/engines/master/pillarWatch.py -{% if 'hvn' in salt['pillar.get']('features', []) %} -hvn_engine_config: +{% if 'vrt' in salt['pillar.get']('features', []) %} +vrt_engine_config: file.managed: - - name: /etc/salt/master.d/hvn_engine.conf - - source: salt://salt/files/hvn_engine.conf + - name: /etc/salt/master.d/vrt_engine.conf + - source: salt://salt/files/vrt_engine.conf - watch_in: - service: salt_master_service diff --git a/salt/sensor/init.sls b/salt/sensor/init.sls index 4008879e9..9c7e52d62 100644 --- a/salt/sensor/init.sls +++ b/salt/sensor/init.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features') and salt['grains.get']('salt-cloud', {}) %} +{% if 'vrt' in salt['pillar.get']('features') and salt['grains.get']('salt-cloud', {}) %} include: - sensor.vm.network diff --git a/salt/sensor/vm/network.sls b/salt/sensor/vm/network.sls index f056e307a..9e25bca65 100644 --- a/salt/sensor/vm/network.sls +++ b/salt/sensor/vm/network.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% set mainint = salt['pillar.get']('host:mainint', 'enp1s0') %} {% set interfaces = salt['network.interfaces']() %} diff --git a/salt/soc/dyanno/hypervisor/init.sls b/salt/soc/dyanno/hypervisor/init.sls index e4ce3b47c..1f17552e7 100644 --- a/salt/soc/dyanno/hypervisor/init.sls +++ b/salt/soc/dyanno/hypervisor/init.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {% from 'hypervisor/map.jinja' import HYPERVISORS %} diff --git a/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja b/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja index 17603ab9d..8976e7cc7 100644 --- a/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja +++ b/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja @@ -9,7 +9,7 @@ in the software, and you may not remove or obscure any functionality in the software that is protected by the license key." #} -{%- if 'hvn' in salt['pillar.get']('features', []) -%} +{%- if 'vrt' in salt['pillar.get']('features', []) -%} {%- import_yaml 'soc/dyanno/hypervisor/hypervisor.yaml' as ANNOTATION -%} {%- from 'hypervisor/map.jinja' import HYPERVISORS -%} diff --git a/salt/soc/dyanno/hypervisor/write_status.sls b/salt/soc/dyanno/hypervisor/write_status.sls index d2aa590e6..60a94b3e9 100644 --- a/salt/soc/dyanno/hypervisor/write_status.sls +++ b/salt/soc/dyanno/hypervisor/write_status.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} {# Import the process steps from map.jinja #} {% from 'soc/dyanno/hypervisor/map.jinja' import PROCESS_STEPS %} diff --git a/salt/top.sls b/salt/top.sls index 5a0c7416b..4f8029706 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -155,7 +155,7 @@ base: - stig - kafka - '*_managerhype and I@features:hvn and G@saltversion:{{saltversion}}': + '*_managerhype and I@features:vrt and G@saltversion:{{saltversion}}': - match: compound - manager.hypervisor @@ -299,7 +299,7 @@ base: - elasticfleet.install_agent_grid - schedule - '*_hypervisor and I@features:hvn and G@saltversion:{{saltversion}}': + '*_hypervisor and I@features:vrt and G@saltversion:{{saltversion}}': - match: compound - ssl - sensoroni diff --git a/salt/vm_status/init.sls b/salt/vm_status/init.sls index c6b39c12e..570b36d19 100644 --- a/salt/vm_status/init.sls +++ b/salt/vm_status/init.sls @@ -9,7 +9,7 @@ # in the software, and you may not remove or obscure any functionality in the # software that is protected by the license key." -{% if 'hvn' in salt['pillar.get']('features', []) %} +{% if 'vrt' in salt['pillar.get']('features', []) %} # Send highstate trigger event for VM deployment status tracking # so-salt-emit-vm-deployment-status sets event_tag = f'soc/dyanno/hypervisor/{status.lower()}'