Upgrading
This guide aims to walk you through the standard procedure for updating/upgrading of ACUBE services.
Upgrading of apt packages
Updating of apt packages should not cause any breaking changes (most of the time, anyways).
sudo apt update
sudo apt upgrade
- Upgrading of
containerd.iohas been known to cause issues fordocker. It is recommended to restart all services that use docker (these services should automatically restart on their own anyways). - If you are connecting to your machine remotely (either through ssh or other means), upgrading of the firewall (
ufw), if enabled, may cause your connection to be terminated.- Recommend upgrading in a
tmuxshell, so in the event that your connection is shut off, you can still attach back to your shell viatmux attach, and so the upgrading process will not be cut-off halfway.
- Recommend upgrading in a
- Upgrading of
qemumay cause the CAPEv2 sandbox to break. The qemu installation method performed viaansibleuses the online installation, and holds theqemupackage inapt.
Upgrading of ACUBETotal Stack
Update Script
The ACUBE team maintains an updating script that automates the updating process. Ideally, this script should be used to update the ACUBETotal stack. Otherwise, manual updating can be done, but requires reading the changelog and and ensuring any additional changes required are done.
Manual Updating
Before doing any form of updates or upgrades, take a look at changelogs, notably:
- Change in services - do you need to edit the
systemdunit files? - New services - do you need to add new
systemdunit files or update thepipeline.ymlfile? - Change in environment variables - do you need to declare new environment variables in
.envfiles?
For services that run on docker
- Load in the new docker images
- Online:
docker pull <image_name> - Offline:
docker load -i <image_name>
- Online:
- Restart the appropriate
systemdservicessystemctl restart <service_name>
- Debug errors, if any
- Check the
journalctllogs
- Check the
For databases (e.g. Postgres or MongoDB)
Check the relevant database documentations for upgrading procedures.
For CAPEv2 Sandbox
All commands are run from the default CAPEv2 directory (/opt/CAPEv2) by the cape user
-
Copy the new files (either manually or using
git pull)- Take special care when copying in the file
pyproject.toml- If there are, update your dependencies:
python3 -m poetry update
- If there are, update your dependencies:
- Take special care when copying in the file
-
Download the community signatures and modules
# This will remove all git-untracked files in the folder modules
git clean -f modules/ data/ analyzer/
# If you're installing from a zip file
python3 -m poetry run python utils/community.py -waf --file <local_zip_filename>
# If you're installing from the git repository directly
python3 -m poetry run python utils/community.py -waf --url <git_url>
# If you're installing from a private git repository directly
python3 -m poetry run python utils/community.py -waf --url <git_url> --token <api_token> -
Restart all cape-related services:
cape,cape-web,cape-processor,cape-rooter -
Ensure that the services are running smoothly, and debug errors if any