Single VM Setup Upgrade Instructions

Introduction

This section provides instructions for upgrading AppScan 360° in Single VM Setup method. This guide is applicable for upgrading from version 2.0.0/2.0.1 to 2.1.0.
Note: Single VM Setup supports upgrade only for Custom/Production mode deployments. If used in Express/POC mode, the new version needs to be installed as a fresh installation.

Upgrade Steps

  1. Ensure Pre-Upgrade Checklist is completed, including backing up databases and ensuring no scans are running.
  2. Download the latest AppScan 360° installer packages from MyHCLSoftware.
    • AppScan360_SingleVMsetup_v2.1.0.run
    • AppScan360_v2.1.0.run
    • AppScan360_ASRA_v2.1.0.run
    • AppScan360_DTCS_v2.1.0.run (Required for DAST Scan features)
    • AppScan360_SCA_v2.1.0.run (Optional)
  3. Export PV backups before upgrade (must be taken to restore post upgrade). Take a backup of the PV storage data from the scanners pod and copy it to the host:
    # Backup pv data from scanners pod and copy to host
    POD=$(kubectl get pods -n hcl-appscan-ascp --no-headers | grep scanners | awk 'NR==1{print $1}')
    
    kubectl exec -n hcl-appscan-ascp "$POD" -- sh -c "cd / && tar -czf /tmp/ascp-pv.tar.gz --exclude='storagemount/Versions' storagemount"
    
    kubectl cp "hcl-appscan-ascp/${POD}:/tmp/ascp-pv.tar.gz" ./ascp-pv-backup.tar.gz
    
    kubectl exec -n hcl-appscan-ascp "$POD" -- rm -f /tmp/ascp-pv.tar.gz
  4. Prepare environment for the upgrade. Run prepareUpgrade to prepare the current environment for v2.1.0 setup
    cd ~/aio-setup 
    sudo ./AppScan360_SingleVMsetup_v2.1.0.run -- $PWD prepareUpgrade
  5. Place the as360-aio-answers.env file from the previous installation (found in aioWorkspace/audit) into the current kits location to preserve configurations.
    • Otherwise, all the survey questions as mentioned below in the Run installation section need to be carefully answered with the same answers as before for resources like database, docker registry and shared storage size.
  6. If applicable, copy the certs folder from the previous installation to the current setup directory.
  7. Perform upgrade installation. Execute the installation using the following command:
    sudo ./AppScan360_SingleVMsetup_v2.1.0.run -- $PWD
    # If Kubernetes upgrades cause issues during cert-manager installation
    # increase the timeout and rerun the setup using the following command
    sudo AS360_AIO_WAIT_TIMEOUT=1800 ./AppScan360_SingleVMsetup_v2.1.0.run -- $PWD 
  8. Restore PV backup. Restore the old scans data from the backup to the new version by running the restoration commands.
    POD=$(kubectl get pods -n hcl-appscan-ascp --no-headers | grep scanners | awk 'NR==1{print $1}')
    
    kubectl exec -n hcl-appscan-ascp "$POD" -- sh -c "rm -rf /app/backup-restore/ascp && mkdir -p /app/backup-restore/ascp"
    
    # Point to the backup file path in below command
    BACKUP_FILE="./backup/ascp-pv-backup.tar.gz"
    
    kubectl cp "$BACKUP_FILE" "hcl-appscan-ascp/${POD}:/app/backup-restore/ascp-pv-backup.tar.gz"
    
    kubectl exec -n hcl-appscan-ascp "$POD" -- sh -c "tar -xzf /app/backup-restore/ascp-pv-backup.tar.gz -C /app/backup-restore/ascp && rm -f /app/backup-restore/ascp-pv-backup.tar.gz"
    
    # Copy data to respective folders
    kubectl exec -n hcl-appscan-ascp "$POD" -- sh -c "mkdir -p /storagemount/Scans /storagemount/Apps && cp -an /app/backup-restore/ascp/storagemount/Scans/* /storagemount/Scans/ && cp -an /app/backup-restore/ascp/storagemount/Apps/* /storagemount/Apps/"
    
    # Verify post copy
    kubectl exec -n hcl-appscan-ascp "$POD" -- ls -la /storagemount/Scans