Skip to content

Certificate Thumbprints

Pre-register client certificates using thumbprint verification.

A certificate thumbprint is a SHA-256 hash of the certificate’s DER encoding, providing a unique identifier:

PropertyValue
AlgorithmSHA-256
Length64 hexadecimal characters
FormatLowercase hex or colon-separated

Example formats:

# Continuous hex (Mantis default)
abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
# Colon-separated (OpenSSL default)
AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:...

Pre-registration allows you to register a thumbprint before the agent connects:

  1. Generate certificate on target server
  2. Extract thumbprint
  3. Pre-register in Mantis
  4. Start Tarsus agent
  5. Agent auto-approved

Tarsus automatically generates a certificate on first run if one is not configured. To generate a certificate manually:

Terminal window
# Generate new certificate using OpenSSL
openssl req -new -x509 -nodes \
-keyout /etc/tarsus/key.pem \
-out /etc/tarsus/cert.pem \
-days 365 \
-subj "/CN=$(hostname)/O=Mantis Agent"
# Get the thumbprint
tarsus show-thumbprint
# Output: abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
Terminal window
# Get thumbprint from certificate file
openssl x509 -noout -fingerprint -sha256 -in /etc/tarsus/cert.pem
# Output:
# SHA256 Fingerprint=AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:...
# Convert to lowercase continuous format
openssl x509 -noout -fingerprint -sha256 -in /etc/tarsus/cert.pem | \
sed 's/SHA256 Fingerprint=//' | tr -d ':' | tr '[:upper:]' '[:lower:]'
# Output:
# abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
Terminal window
# Show current certificate thumbprint
tarsus show-thumbprint
# Output:
# abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
┌─────────────────────────────────────────────────────────────┐
│ Pre-Register Client │
├─────────────────────────────────────────────────────────────┤
│ │
│ Client Name * │
│ [web-prod-01 ] │
│ │
│ Certificate Thumbprint * │
│ [abcdef1234567890abcdef1234567890abcdef12] │
│ [34567890abcdef1234567890abcdef1234567890] │
│ 64 hexadecimal characters (SHA-256) │
│ │
│ Hostname (optional) │
│ [web-prod-01.example.com ] │
│ For documentation purposes │
│ │
│ Target Environment (optional) │
│ [None (target created without environment) ▼] │
│ The environment for the automatically created target │
│ │
│ [Cancel] [Pre-Register] │
│ │
└─────────────────────────────────────────────────────────────┘
Terminal window
# Basic pre-registration
mantisctl cert pre-register --name "web-prod-01" \
--thumbprint "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
# With hostname
mantisctl cert pre-register --name "web-prod-01" \
--thumbprint "abcdef1234..." \
--hostname "web-prod-01.example.com"
# Calculate the thumbprint from a certificate file
mantisctl cert pre-register --name "web-prod-01" \
--from-cert /path/to/client.crt

Pre-registered entries immediately receive Approved status. A pre-registered client that has not yet connected will show “Never” for Last Seen:

┌─────────────────────────────────────────────────────────────┐
│ Registrations │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────┬───────────────┬─────────────────────┐ │
│ │ Client │ Status │ Last Seen │ │
│ ├────────────────┼───────────────┼─────────────────────┤ │
│ │ web-prod-01 │ ● Approved │ Never │ │
│ │ web-prod-02 │ ● Approved │ 2 min ago │ │
│ │ api-prod-01 │ ○ Pending │ 5 min ago │ │
│ └────────────────┴───────────────┴─────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

When an agent connects with a pre-registered thumbprint:

Terminal window
# Start agent (certificate already generated)
tarsus run
# Output:
# Connecting to Mantis server...
# Certificate thumbprint: abcdef1234567890...
# Registration found: web-prod-01 (pre-registered)
# Status: Approved
# Ready to receive deployments.

If thumbprint doesn’t match any pre-registration:

Terminal window
# Start agent
tarsus run
# Output:
# Connecting to Mantis server...
# Certificate thumbprint: xyz789...
# No pre-registration found
# Status: Pending (awaiting approval)

Always verify thumbprint through a secure channel:

┌─────────────────────────────────────────────────────────────┐
│ Verify Thumbprint │
├─────────────────────────────────────────────────────────────┤
│ │
│ Pre-registered thumbprint: │
│ abcdef1234567890abcdef1234567890abcdef1234567890abcdef12 │
│ 34567890abcdef1234567890abcdef1234567890 │
│ │
│ Agent-provided thumbprint: │
│ abcdef1234567890abcdef1234567890abcdef1234567890abcdef12 │
│ 34567890abcdef1234567890abcdef1234567890 │
│ │
│ Result: ✓ Match │
│ │
└─────────────────────────────────────────────────────────────┘

Exchange thumbprints through secure channels:

ChannelSecurity LevelUse Case
In-personHighestHigh-security environments
Phone callHighVerbal verification
Encrypted emailMediumDocumentation trail
Secure chatMediumQuick verification
Configuration managementMediumAutomated deployments
Terminal window
# Pre-register multiple servers from a file
cat servers.txt | while read name thumbprint; do
mantisctl cert pre-register --name "$name" --thumbprint "$thumbprint"
done
# servers.txt format:
# web-prod-01 abcdef1234567890...
# web-prod-02 fedcba0987654321...
# api-prod-01 123456abcdef7890...
# Ansible example
- name: Pre-register Mantis client
uri:
url: '{{ mantis_url }}/api/v1/registrations/pre-register'
method: POST
headers:
Authorization: 'Bearer {{ mantis_token }}'
body_format: json
body:
client_name: '{{ inventory_hostname }}'
thumbprint: '{{ tarsus_thumbprint }}'
# GitHub Actions example
- name: Pre-register with Mantis
run: |
mantisctl cert pre-register --name "${{ matrix.server }}" \
--thumbprint "${{ secrets[format('{0}_THUMBPRINT', matrix.server)] }}"
Terminal window
# List approved client registrations (pre-registered clients are approved)
mantisctl cert list --status approved
# Show details for one registration (by ID or thumbprint prefix)
mantisctl cert show <registration-id>
Terminal window
# Revoke a pre-registration before or after the agent connects
mantisctl cert revoke <registration-id> \
--reason "Server deployment cancelled"

Thumbprints cryptographically bind to the certificate:

PropertyGuarantee
UniquenessEach certificate has unique thumbprint
IntegrityAny change produces different thumbprint
Non-repudiationAgent proves possession of private key

Ensure the agent’s private key is secured:

Terminal window
# Secure permissions on Tarsus certificate
chmod 600 /etc/tarsus/key.pem
chmod 644 /etc/tarsus/cert.pem
chown root:root /etc/tarsus/*.pem

If a private key is compromised:

  1. Revoke the registration immediately
  2. Generate new certificate on the server
  3. Pre-register new thumbprint
  4. Investigate the compromise
Terminal window
# Revoke compromised registration (by ID or thumbprint prefix)
mantisctl cert revoke <registration-id> \
--reason "Private key compromised"
# Pre-register new thumbprint
mantisctl cert pre-register --name "compromised-server" \
--thumbprint "new-thumbprint-here"
AspectThumbprintToken
SecurityHigher (per-agent)Lower (shared secret)
Setup effortHigherLower
AutomationMore complexSimpler
Revocation scopeSingle agentAll using token
Best forHigh securityBulk deployment
  • Production environments
  • High-security requirements
  • Compliance requirements
  • Individual server tracking
  • Development environments
  • CI/CD pipelines
  • Large-scale deployments
  • Ephemeral infrastructure

Always use secure channels:

Terminal window
# Generate thumbprint on server
tarsus show-thumbprint > /tmp/thumbprint.txt
# Securely transfer (example using SSH)
scp /tmp/thumbprint.txt admin@mantis:/tmp/
# Clean up
rm /tmp/thumbprint.txt

Maintain records of:

  • Who requested the pre-registration
  • Purpose of the server
  • When it should be reviewed
  • Associated tickets/approvals

Remove stale pre-registrations:

Terminal window
# List approved registrations and identify stale entries
mantisctl cert list --status approved --verbose
# Revoke stale entries individually (by ID or thumbprint prefix)
mantisctl cert revoke <registration-id> \
--reason "Pre-registration expired - server not provisioned"

Always verify thumbprint for production servers:

Terminal window
# On the server
tarsus show-thumbprint
# Compare with pre-registered value in Mantis
mantisctl cert show <registration-id>

Cause: Certificate was regenerated

Solution:

  1. Get new thumbprint from server
  2. Update or re-create pre-registration
  3. Ensure certificate wasn’t inadvertently regenerated
Terminal window
# Check current thumbprint
tarsus show-thumbprint
# Update pre-registration if needed (revoke + re-pre-register)
mantisctl cert revoke <registration-id>
mantisctl cert pre-register --name "server-name" --thumbprint "new-thumbprint"

Cause: Wrong format or characters

Solution:

Terminal window
# Ensure lowercase hex, no colons, 64 characters
echo "ABCDEF12:34:56..." | tr -d ':' | tr '[:upper:]' '[:lower:]'
# Verify length
thumbprint="abcdef..."
echo ${#thumbprint} # Should be 64

Cause: Thumbprint wasn’t pre-registered or was cancelled

Solution:

  1. Check if pre-registration exists
  2. Verify thumbprint matches exactly
  3. Re-create pre-registration if needed

Agent Connects but Registration Shows Pending

Section titled “Agent Connects but Registration Shows Pending”

Cause: The agent connected with a thumbprint that does not match any pre-registration, so it was created as a new Pending registration instead.

Solution:

  1. Verify the agent’s thumbprint matches the pre-registered value exactly: tarsus show-thumbprint
  2. Check that the correct pre-registration exists in Mantis: mantisctl cert list --status approved
  3. If the thumbprint has changed (certificate was regenerated), revoke the stale entry and pre-register the new thumbprint
  4. Approve the pending registration manually if needed

Cause: Pre-registered registration was revoked before the agent connected.

Solution:

  1. Check the registration status: mantisctl cert list
  2. If revoked, create a new pre-registration for the client’s thumbprint