Set up instructions to use LetsEncrypt Certificates for TAK Server Certificate Enrollment
NOTE LetsEncrypt requires a Fully Qualified Domain Name (FQDN) and will not work with IP addresses)
This tutorial assumes you have a working knowledge of firewalld, basic linux commands, and basic TAK Server operations. This assumes that your TAK Server is already installed (non-dockerized) and that you are familiar with creating users within TAK Server. This example was used for flat file authentication, however, it should work for ldap with some modifications.
- $
sudo yum install snapd
- $
sudo systemctl enable --now snapd.socket
This needs to be enabled - $
sudo ln -s /var/lib/snapd/snap /snap
Additional Instructions can be found at: https://certbot.eff.org/instructions?ws=webproduct&os=centosrhel7 (go with the "standalone" option)
- $
sudo snap install core; sudo snap refresh core
- $
sudo snap install --classic certbot
- $
sudo ln -s /snap/bin/certbot /usr/bin/certbot
- $
sudo systemctl stop takserver
(If you already have TAK Server running) - $
sudo certbot certonly --standalone
- $
sudo systemctl restart takserver
(If you have takserver installed already.) - $
sudo yum install -y
NOTE: When prompted for a passcode / password, use
atakatak
NOTE: or the following section, DOMAIN =the FQDN,and it MUST follow the name exactly as you submitted with certbot. MY-DOMAIN can be what you wish, though for this example / purpose, they are the same. Pay close attention to when to use periods versus dashes - they are set that way to minimize confusion as to which files to move during the set up. As an example, if your subdomain was "takserver.example.com", you would insert "takserver.example.com" and "takserver-example-com" in lieu of MY.DOMAIN and MY-DOMAIN, respectively.
- $
sudo -i
(to enable access to/etc/letsencrypt/live/MY.DOMAIN/
) - $
openssl pkcs12 -export -in /etc/letsencrypt/live/MY.DOMAIN/fullchain.pem -inkey /etc/letsencrypt/live/MY.DOMAIN/privkey.pem -name MY-DOMAIN -out ~/MY-DOMAIN.p12
- $
keytool -importkeystore -deststorepass atakatak -destkeystore ~/MY-DOMAIN.jks -srckeystore ~/MY-DOMAIN.p12 -srcstoretype PKCS12
- $
keytool -import -alias bundle -trustcacerts -file /etc/letsencrypt/live/MY.DOMAIN/fullchain.pem -keystore ~/MY-DOMAIN.jks
- $
exit
(to exit as root user)
- $
cp ~/MY-DOMAIN.jks /opt/tak/certs/files/
- $
cp ~/MY-DOMAIN.p12 /opt/tak/certs/files/
- $
cd /opt/tak/certs/files
- $
mv /mv ./MY-DOMAIN.jks /letsencrypt
- $
mv ./MY-DOMAIN.p12 /letsencrypt
- $
cd /opt/tak/certs/files/letsencrypt
- $
ls -lah
(ensure the files appear and that they are owned bytak
user)
if not: $sudo chown tak:tak -R /opt/tak/certs/files/letsencrypt
- $
sudo systemctl restart takserver
- Open / allow port 80 if previously closed
- $
sudo systemctl stop takserver
(If you already have TAK Server running) - $
sudo certbot certonly renew --dry-run
(if no errors in #2, then proceed) - $
sudo certbot certonly renew
- Then complete section #2 again.
NOTE: While you can use whatever names for your certs, even the FQDN, the example below has shown to work whereas using the FQDN (unless expressly stated) was not entirely reliable.
sudo su tak
cd /opt/tak/certs
nano cert-metadata.sh
- Edit this file accordingly - Especially take note of the names supplied forO=
(Organization) andOU=
(Organizational Unit)./makeRootCa.sh
- In this case, tak-ca was used../makeCert.sh ca
- In this case, intermediate was used../makeCert.sh server
- In this case, takserver was used.cd /opt/tak/certs/files
exit
cd /opt/tak/certs/files
(If you used the naming convention above, your file list should look like:)sudo systemctl restart takserver
- $
sudo su tak
- $
nano CoreConfig.xml
Locate the <input...>
tag for port="8089
" within the <network>
section and modify it as shown below.
NOTE: If no input exists for
port="8089"
, then add it below the input(s) forport="8087"
<input auth="x509" _name="cert_enroll" protocol="tls" port="8089" archive="true" anongroup="false" archiveOnly="false"/>
Locate `<connector port = "8446" ...> Tag and modify it to reflect the following:
<connector port="8446" _name="cert_https" truststorePass="atakatak"
truststoreFile="certs/files/truststore-intermediate.jks" truststore="JKS" keystorePass="atakatak"
keystoreFile="certs/files/letsencrypt/MY-DOMAIN.jks" keystore="JKS"
clientAuth="false"/>
NOTE: Make sure MY-DOMAIN.jks and its path match the cert created in step 2.2 and ensure your truststoreFile matches the intermediate certificate created in Step #4
Locate <auth..>
tag and add the following: x509checkRevocation="true"
This example includes attritubes that also enable channels:
<auth x509groups="true" x509addAnonymous="false" x509useGroupCache="true" x509checkRevocation="true"> <File location="UserAuthenticationFile.xml"/> </auth>
Locate <dissemination smartRetry="false"/>
and place the following BELOW:
<certificateSigning CA="TAKServer">
<certificateConfig>
<nameEntries>
<nameEntry name="O" value="Organization Name"/>
<nameEntry name="OU" value="Department/Unit Name"/>
</nameEntries>
</certificateConfig>
<TAKServerCAConfig keystore="JKS" keystoreFile="certs/files/intermediate-signing.jks"
keystorePass="atakatak" validityDays="30" signatureAlg="SHA256WithRSA"
CAkey="/opt/tak/certs/files/intermediate.key" CAcertificate="/opt/tak/certs/files/intermediate.pem"/>
</certificateSigning>
<security>
<tls keystore="JKS" keystoreFile="certs/files/takserver.jks" keystorePass="atakatak"
truststore="JKS" truststoreFile="certs/files/truststore-intermediate.jks" truststorePass="atakatak"
context="TLSv1.2" keymanager="SunX509"/>
<crl _name="TAKServer CA" crlFile="certs/files/intermediate.crl"/>
</security>
Where the truststoreFile
attribute matches the cert created in step 2.2 and where the <crl_name=.../>
tag has been added for certificate revocation.
Restart TAK Server:
sudo systemctl restart takserver
Note: TAK Server must be restarted for any changes to the CoreConfig.xml to go into effect.
When attempting to connect to the takserver with certificate enrollment, you can "add a server" in ATAK or use the Quick Connect feature. If using the "add server", the following information will be needed:
- Name: [User Supplied]
- URL: DOMAIN
- Check "Enroll for Client Certficate"
DO NOT CHECK "Use Authentication" for flat file authentication (other authentication methods may require it such as LDAP, etc).
If Using the Quick Connect option, you just need the address (DOMAIN) and the user credentials created TAK Server using the CLI or using the User-Management interface.
iTAK has two ways to utilize certificate enrollment - adding the server manually or by QR Code. The information needed for either approach is:
- Name:
\[User Supplied\]
- URL:
DOMAIN
- Port:
8089
(unless you have specified otherwise) - Protocol:
SSL
For the QR-Code option, generate a text-based QR-Code using the following format for the text:
Name,DOMAIN,8089,SSL