HomeDocumentationAPI Reference
Log In
Documentation

Maintenance Scripts

Sandfly is largely self-maintaining. Outside of the expected installation and upgrade scripts, there are additional scripts provided in the package that can be of aid in certain situations. For example, some scripts reset different configurations or clear out large backlogs of events.

Install and Upgrade Scripts

These scripts are located in the setup directory and are used for installation or Docker management:

  • clean_docker.sh - Used to delete existing Sandfly Docker containers, typically used prior to an upgrade. Please see the section on Upgrading Sandfly Docker/Podman Deployment for more information.
  • clean_docker_full.sh - Used to delete ALL existing Docker containers on that system.
  • generate_compose.sh - Used as part of the Docker Compose installation process.
  • generate_k8s.sh - Used as part of the Kubernetes installation process.
  • install.sh - Sandfly Server install script.

Sandfly Setup Scripts

These scripts are located in the setup_scripts directory and are used to install the Sandfly Server and SSL:

  • load_images.sh - Used by install and start scripts to load images from the "offline" setup package.
  • reload_server_https_certificate.sh - Used to update the running server container's TLS certificate and key.

System Utility Scripts

These scripts are located in the util_scripts directory and are used to aid in the management of the Sandfly system in various ways:

  • check_ipv6_support.sh - Checks whether this host can give the Sandfly container network (sandfly-net) IPv6 support. It reports each host and container runtime setting that the install and start scripts check, and any existing sandfly-net network, as PASS, WARN, or FAIL, and then shows the final result. The script only reads settings; it changes nothing on the host. For details, see IPv6 Networking Support.
  • delete_sandfly_installation.sh - This script deletes EVERYTHING created and configured as part of an installation and subsequent use. This includes Sandfly configuration files, databases, any other unused Docker volumes on the host, etc. The sandfly-setup directory itself and the remaining files within it will not be affected. Use this script as an initial step to uninstall Sandfly or to make a clean environment for re-installation on the host.
  • reset_admin_password.sh - Reset the system admin password to a random value.
  • reset_db_data.sh - Deletes system alarm and log data, but preserves the configuration data. Useful if you have a large number of alarms you want to purge and start again without needing to reload all your other user data.
  • reset_ssh_hunter_data.sh - Deletes all of the SSH Investigation SSH key data from the Sandfly Server.
  • reset_system_password.sh - Resets the system password used by nodes to log in to the API. This is only needed if you feel the node password has been compromised and you wish to reset it to something new. Please contact Sandfly for assistance.
  • upgrade_postgres.sh - Upgrades the Sandfly Postgres 14 database to Postgres 18 in place. First stop Sandfly with shutdown_sandfly.sh, then run the script, and then start Sandfly as usual. If the upgrade fails, the database is restored to Postgres 14. After a successful upgrade, the Postgres 14 data is deleted and can only be recovered from a backup. We strongly recommend that you make a backup first (see the Backup and Restore Guide). While Sandfly still uses Postgres 14, the start scripts show a note that recommends this upgrade.

Sandfly Administration Scripts

These scripts are located in the start_scripts directory and are used to aid in the administration of the Sandfly application:

  • shutdown_sandfly.sh - Use when it is necessary to properly and completely shut down the Sandfly containers in the correct order to minimize problems and error messages in the logs. Should the database have active sandfly connections at the time of running this script, it will wait up to 15 minutes for those connections to end. To skip this check, invoke this script with the environment variable SKIP_DB_ACTIVITY_CHECK set to any non-empty value.

Did this page help you?