Skip to content

Security guide

Security is critical for deployment orchestration tools. This guide covers authentication, secrets management, network security, and hardening best practices for Apex.

Always prefer SSH key-based authentication over passwords for remote deployments.

Generate a dedicated deployment key:

Terminal window
ssh-keygen -t ed25519 -f ~/.ssh/apex-deploy -C "apex-deployment"
chmod 600 ~/.ssh/apex-deploy

Deploy the public key to target nodes:

Terminal window
ssh-copy-id -i ~/.ssh/apex-deploy.pub root@target-host

Reference in Deployment YAML:

spec:
ssh:
user: root
keyPath: ~/.ssh/apex-deploy
port: 22
Section titled “SSH Password Authentication (Not Recommended)”

If you must use passwords:

  • Use strong, unique passwords per environment
  • Store passwords in environment variables, not in YAML
  • Rotate regularly
  • Migrate to key-based auth as soon as possible
spec:
ssh:
user: root
password: "${SSH_PASSWORD}" # Read from environment

Control host:

  • Run Apex with normal user privileges
  • Don’t run as root unless absolutely necessary
  • Use dedicated service accounts in CI/CD

Target nodes:

  • Use root/Administrator only during installation
  • Component services should run under dedicated accounts
  • Restrict SSH access to deployment keys only

Don’t commit to version control:

  • SSH private keys
  • Passwords
  • API tokens
  • License keys
  • TLS certificates

Use .gitignore:

# Deployment credentials
deployment-prod.yaml
.env
*.key
*.pem
*-credentials.yaml

Use environment variables for sensitive values:

spec:
ssh:
user: root
password: "${PROD_SSH_PASSWORD}"
nodes:
- name: prod-node1
host: "${PROD_NODE1_HOST}"

Set before deployment:

Terminal window
export PROD_SSH_PASSWORD="strong-password"
export PROD_NODE1_HOST="10.0.1.100"
apex deploy -f deployment-prod.yaml --yes

For production environments, integrate with secrets managers:

HashiCorp Vault:

Terminal window
export SSH_PASSWORD=$(vault kv get -field=password secret/apex/prod)
apex deploy -f deployment.yaml --yes

AWS Secrets Manager:

Terminal window
export SSH_PASSWORD=$(aws secretsmanager get-secret-value \
--secret-id apex/prod/ssh --query SecretString --output text)

Azure Key Vault:

Terminal window
export SSH_PASSWORD=$(az keyvault secret show \
--vault-name mykeyvault --name apex-ssh-password --query value -o tsv)

Protect deployment files and keys:

Terminal window
# Deployment YAML with credentials
chmod 600 deployment-prod.yaml
# SSH keys
chmod 600 ~/.ssh/apex-deploy
chmod 644 ~/.ssh/apex-deploy.pub
# Apex config
chmod 600 ~/.apex/config.yaml

Verify permissions:

Terminal window
ls -la ~/.ssh/apex-deploy*
ls -la deployment-prod.yaml

Control host (outbound):

  • HTTPS (443) to download servers
  • SSH (22 or custom) to target nodes
  • Telemetry endpoint (if enabled)

Target nodes (inbound):

  • SSH (22 or custom) from control host
  • Component-specific ports (see component docs)

Example iptables rules (target node):

Terminal window
# Allow SSH from control host only
iptables -A INPUT -p tcp --dport 22 -s 10.0.1.5 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j DROP
# Allow component ports from application network
iptables -A INPUT -p tcp --dport 6030 -s 10.0.0.0/16 -j ACCEPT
iptables -A INPUT -p tcp --dport 6041 -s 10.0.0.0/16 -j ACCEPT

On target nodes (/etc/ssh/sshd_config):

# Disable password authentication (after key setup)
PasswordAuthentication no
PubkeyAuthentication yes
# Disable root password login
PermitRootLogin prohibit-password
# Restrict to specific users
AllowUsers deploy-user
# Use strong key exchange algorithms
KexAlgorithms curve25519-sha256,diffie-hellman-group16-sha512

Restart SSH after changes:

Terminal window
systemctl restart sshd

Separate deployment and application networks:

Management Network (10.0.1.0/24)
├─ Control Host (10.0.1.5)
└─ Target Nodes SSH (10.0.1.100-110)
Application Network (10.0.0.0/16)
└─ TDengine Services (10.0.0.100-110)

Use jump hosts/bastions for production:

Terminal window
# SSH through bastion
ssh -J bastion-user@bastion.example.com root@target-host
# Configure in Deployment YAML
spec:
ssh:
user: root
keyPath: ~/.ssh/apex-deploy
proxyJump: bastion-user@bastion.example.com

For production TDengine deployments:

  • Use valid TLS certificates (not self-signed)
  • Configure certificate verification
  • Rotate certificates before expiration
  • Use certificate authorities your clients trust

Apex automatically verifies SHA256 checksums for all artifacts. Never:

  • Skip verification
  • Modify manifest checksums
  • Download artifacts from untrusted sources

If verification fails:

  1. Delete the cached artifact
  2. Re-download from official sources
  3. If problem persists, report to component teams

When creating offline bundles:

Terminal window
# Create checksums
cd apex-offline-bundle/
sha256sum *.tar.gz *.zip > checksums.txt
# Verify on air-gapped system
sha256sum -c checksums.txt

Trusted sources only:

  • Official CDN: downloads.tdengine.com
  • Verified mirrors listed in official docs
  • Internal mirrors after verification

Configure base URL:

~/.apex/config.yaml
base_url: https://verified-mirror.internal.example.com

Verify mirror integrity:

Terminal window
# Compare checksums from official and mirror
curl -s https://downloads.tdengine.com/apex/v0.4.0/checksums.txt > official.txt
curl -s https://mirror.internal/apex/v0.4.0/checksums.txt > mirror.txt
diff official.txt mirror.txt

Before production deployment:

Terminal window
# 1. Verify connectivity without deploying
apex check -f deployment-prod.yaml
# 2. Validate configuration
apex validate -f deployment-prod.yaml --manifests ~/.apex/manifests/
# 3. Review deployment plan
apex apply -f deployment-prod.yaml --dry-run
# 4. Confirm resources
apex prepare -f deployment-prod.yaml --manifests ~/.apex/manifests/
# 5. Deploy
apex apply -f deployment-prod.yaml --yes

Pin versions in production to prevent unexpected changes:

# Good: pinned versions
roles:
- component: tsdb
version: "3.3.5.0"
- component: idmp
version: "1.2.3.0"
# Risky: auto versions in production
roles:
- component: tsdb
version: auto # Could deploy newer version unexpectedly

For dynamic versions:

  1. Run validate to resolve versions
  2. Save the resolved Deployment YAML
  3. Review the resolved versions
  4. Use the resolved YAML for prepare and apply

Separate development, staging, and production:

~/.apex/
├── deployments/
│ ├── dev-deployment.yaml
│ ├── staging-deployment.yaml
│ └── prod-deployment.yaml
└── config.yaml

Use different SSH keys per environment:

staging-deployment.yaml
spec:
ssh:
keyPath: ~/.ssh/apex-staging
# prod-deployment.yaml
spec:
ssh:
keyPath: ~/.ssh/apex-prod

For production changes:

  1. Test in development/staging first
  2. Create change requests/tickets
  3. Schedule maintenance windows
  4. Have rollback plans ready
  5. Keep backups current
  6. Document changes

Protect sensitive data in logs:

  • Apex automatically redacts passwords
  • Private keys are referenced by path, not content
  • Review logs before sharing

Review logs for sensitive data:

Terminal window
grep -i "password\|secret\|key" ~/.apex/logs/deploy-*/apex.log

Redact before sharing:

Terminal window
# Replace hostnames
sed 's/10\.0\.1\.[0-9]\+/X.X.X.X/g' apex.log > apex-redacted.log
# Replace paths
sed 's|/home/[^/]\+|/home/USER|g' apex-redacted.log

Enable logging for compliance:

~/.apex/config.yaml
apex_home: ~/.apex
telemetry_enabled: true # Optional anonymous telemetry

Deployment reports (~/.apex/reports/) contain:

  • Timestamp and user
  • Nodes and components
  • Outcomes per stage
  • Configuration references (not secrets)

Retain logs per your security policy:

Terminal window
# Archive deployment logs
tar czf apex-deploy-$(date +%Y%m).tar.gz ~/.apex/logs/
mv apex-deploy-*.tar.gz /secure/archive/

Apex telemetry is:

  • Anonymous (no credentials, hostnames, or configuration)
  • Best-effort (never blocks deployment)
  • Optional (disable with telemetry_enabled: false)

Disable telemetry for sensitive environments:

~/.apex/config.yaml
telemetry_enabled: false

Or per-deployment:

Terminal window
export APEX_TELEMETRY_DISABLED=1
apex deploy -f deployment.yaml --yes

If SSH keys or passwords are compromised:

  1. Immediately rotate on all target nodes:
Terminal window
# Remove compromised key
ssh root@target-node "sed -i '/compromised-key/d' ~/.ssh/authorized_keys"
# Deploy new key
ssh-copy-id -i ~/.ssh/apex-deploy-new.pub root@target-node
  1. Update Deployment YAML:
spec:
ssh:
keyPath: ~/.ssh/apex-deploy-new
  1. Audit recent deployments:
Terminal window
# Check recent activity
ls -lt ~/.apex/logs/ | head -20
grep "deployment" ~/.apex/logs/*/apex.log
  1. Review component logs for unauthorized access

If you suspect unauthorized deployments:

  1. Check deployment reports:
Terminal window
ls -lt ~/.apex/reports/
cat ~/.apex/reports/deploy-*/report.yaml
  1. Review operation logs:
Terminal window
grep -r "ERROR\|FAIL\|unauthorized" ~/.apex/logs/
  1. Check component status:
Terminal window
apex-component-status.sh
  1. Review target node logs for unauthorized access

After a security incident:

  1. Rotate all credentials
  2. Re-deploy from known-good configuration
  3. Update security policies
  4. Document lessons learned
  5. Update incident response procedures

Follow security baselines for your environment:

  • CIS benchmarks for Linux/Windows
  • NIST guidelines
  • Industry-specific requirements (HIPAA, PCI-DSS, etc.)

Monthly:

  • Review access logs
  • Update SSH keys rotation plan
  • Check for CVEs in components
  • Review firewall rules

Quarterly:

  • Audit user access
  • Review deployment procedures
  • Update security documentation
  • Security training for operators

Annually:

  • Comprehensive security audit
  • Penetration testing
  • Disaster recovery drills
  • Update security policies

Before production deployment:

  • SSH key authentication configured
  • Strong passwords or keys only
  • File permissions set correctly (600 for keys and configs)
  • Secrets stored in vault or environment variables
  • No secrets in version control
  • Firewall rules configured
  • Network segmentation implemented
  • TLS certificates valid
  • Artifact checksums verified
  • Versions pinned in production
  • Change management process followed
  • Backups current
  • Rollback plan ready
  • Logging and monitoring configured
  • Incident response procedures documented