Note: This was for a specific use case, but these are a more consolidated and straightforward instruction set for deploying a TAK Hardened Server in a Docker rootless configuration.
sudo apt-get update -y && sudo apt-get upgrade -ysudo apt-get install -y uidmap
sudo apt-get install ca-certificates curlsudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc
echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
sudo useradd -m -G <dockergroup> <username>
Example: docker dockeruser
sudo su <username of docker user>whoamigrep ^$(whoami): /etc/subuidgrep ^$(whoami): /etc/subgid
Ensure the user uid/gids have at least 65,536 sub uid/gids. If needed you can edit the respective file
vim /etc/subuidvim /etc/subgid
Note:
format is <username>:<uid or gid>:<count>
sudo apt-get install -y dbus-user-sessionsudo apt-get install -y systemd-containersudo apt-get install -y docker-ce-rootless-extras
ls /var/lib/systemd/linger
Note: If the user you created is here. Skip to the next section. If not, continue.
loginctl enable-linger <username>ls /var/lib/systemd/linger
systemctl --user
Note: If the output has no errors, you can skip to the next section. Else, continue down.
Under the username you created add the following to the .bashrcexport XDG_RUNTIME_DIR=/run/user/$UIDsource .bashrc
sudo systemctl disable --now docker.service docker.socketsudo rm /var/run/docker.sock
dockerd-rootless-setuptool.sh installUnder the username you created add the following to the .bashrcexport PATH=/usr/bin:$PATHexport DOCKER_HOST=unix:///run/user/<user id>/docker.socksource .bashrc
systemctl --user start dockersystemctl --user enable docker
Note: Under the non-root user
docker run hello-world
Note: This should only work under the new rootless user. It should not run on other users if properly installed.
takserver-docker-hardened-<current stable release>.zip
Note: TAK has tar files as well, zip was just more direct for this deployment
scp takserver-docker-hardened-<current stable release>.zip <dockeruser>@<IP>:/home/<dockeruser>
Note: The user doesn't matter ultimately, however, consider ownership of the file. It may need to be changed.
- Ensure you are under the correct directory
cd \takserver-docker-hardened-'version'\
Note: There should be
\takand\dockerunder the main dir.
docker login registry1.dso.mil -u <username for IronBank>
Note: The password is the CLI secret found through the web browser Note: Before building, edit the
cert-metadata.sh. The default password for the CA isatakatakand should be changed. The file is under/tak/certs/
docker build -t ca-setup-hardened \--build-arg ARG_CA_NAME=<CA_NAME> \--build-arg ARG_STATE=<ST> \--build-arg ARG_CITY=<CITY> \--build-arg ARG_ORGANIZATIONAL_UNIT=<UNIT> \-f docker/Dockerfile.ca .docker run --name ca-setup-hardened -it -d ca-setup-hardeneddocker cp ca-setup-hardened:/tak/certs/files files[ -d tak/certs/files ] || mkdir tak/certs/files \&& docker cp ca-setup-hardened:/tak/certs/files/takserver.jks tak/certs/files/ \&& docker cp ca-setup-hardened:/tak/certs/files/truststore-root.jks tak/certs/files/ \&& docker cp ca-setup-hardened:/tak/certs/files/fed-truststore.jks tak/certs/files/ \&& docker cp ca-setup-hardened:/tak/certs/files/admin.pem tak/certs/files/ \&& docker cp ca-setup-hardened:/tak/certs/files/config-takserver.cfg tak/certs/files/
Note: Ensure you edit the CoreConfig file under /tak and update the tag with the hardened TAK Database container name and the DB password. Note: Also, change the keystore and truststore passwords
Example:
<connection url="jdbc:postgresql://tak-database-hardened-<version>:5432/cot" username="martiuser" password="<changeme>" />Note: Ensure you are in the root TAK directory of the unzipped folder
docker network create takserver-net-hardened-"$(cat tak/version.txt)"docker network inspect takserver-net-hardened-"$(cat tak/version.txt)"- Take the subnet information and edit the /tak/db-utils/pg_hba.conf and ensure it is included.
Note: Again, ensure you are in the root directory of the unzipped folder
docker build -t tak-database-hardened:"$(cat tak/version.txt)" -f docker/Dockerfile.hardened-takserver-db .docker run \--name tak-database-hardened-"$(cat tak/version.txt)" \--network takserver-net-hardened-"$(cat tak/version.txt)" \--network-alias tak-database \-d tak-database-hardened:"$(cat tak/version.txt)" \-p 5432:5432
docker build -t takserver-hardened:"$(cat tak/version.txt)" -f docker/Dockerfile.hardened-takserver .docker run \--name takserver-hardened-"$(cat tak/version.txt)" \--network takserver-net-hardened-"$(cat tak/version.txt)" \-p 8089:8089 -p 8443:8443 -p 8444:8444 -p 8446:8446 \-t -d \takserver-hardened:"$(cat tak/version.txt)"
docker exec -it ca-setup-hardened bash -c "openssl x509 -noout -fingerprint -md5 -inform pem -in files/admin.pem | grep -oP 'MD5 Fingerprint=\K.*'"docker exec -it takserver-hardened-"$(cat tak/version.txt)" bash -c 'java -jar /opt/tak/utils/UserManager.jar usermod -A -f <admin fingerprint> admin'
- First, you’ll need to pull off the host a few certs, namely, the .p12 files for the admin user you just created and the
trust store-root.p12. (The truststore-root will be needed to connect clients i.e., WinTAK, ATAK, etc) - Once you have them on your local system, how you import them depends on your specific browser but generally involves uploading them under your security settings.
- Navigate to
https://<IP Address>:8443/for the dashboard. You’ll see the normal security warnings for using a self-signed cert. Ensure you finish setting set up the server underhttps://<IP Address>:8443/setup.
docker exec -u root -it <id> sh./makeCert.sh client admin