Security guide
Security is critical for deployment orchestration tools. This guide covers authentication, secrets management, network security, and hardening best practices for Apex.
Authentication and Authorization
Section titled “Authentication and Authorization”SSH Key Authentication
Section titled “SSH Key Authentication”Always prefer SSH key-based authentication over passwords for remote deployments.
Generate a dedicated deployment key:
ssh-keygen -t ed25519 -f ~/.ssh/apex-deploy -C "apex-deployment"chmod 600 ~/.ssh/apex-deployDeploy the public key to target nodes:
ssh-copy-id -i ~/.ssh/apex-deploy.pub root@target-hostReference in Deployment YAML:
spec: ssh: user: root keyPath: ~/.ssh/apex-deploy port: 22SSH Password Authentication (Not Recommended)
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 environmentPrinciple of Least Privilege
Section titled “Principle of Least Privilege”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
Secrets Management
Section titled “Secrets Management”Never Commit Secrets
Section titled “Never Commit Secrets”Don’t commit to version control:
- SSH private keys
- Passwords
- API tokens
- License keys
- TLS certificates
Use .gitignore:
# Deployment credentialsdeployment-prod.yaml.env*.key*.pem*-credentials.yamlEnvironment Variables
Section titled “Environment Variables”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:
export PROD_SSH_PASSWORD="strong-password"export PROD_NODE1_HOST="10.0.1.100"apex deploy -f deployment-prod.yaml --yesExternal Secrets Management
Section titled “External Secrets Management”For production environments, integrate with secrets managers:
HashiCorp Vault:
export SSH_PASSWORD=$(vault kv get -field=password secret/apex/prod)apex deploy -f deployment.yaml --yesAWS Secrets Manager:
export SSH_PASSWORD=$(aws secretsmanager get-secret-value \ --secret-id apex/prod/ssh --query SecretString --output text)Azure Key Vault:
export SSH_PASSWORD=$(az keyvault secret show \ --vault-name mykeyvault --name apex-ssh-password --query value -o tsv)File Permissions
Section titled “File Permissions”Protect deployment files and keys:
# Deployment YAML with credentialschmod 600 deployment-prod.yaml
# SSH keyschmod 600 ~/.ssh/apex-deploychmod 644 ~/.ssh/apex-deploy.pub
# Apex configchmod 600 ~/.apex/config.yamlVerify permissions:
ls -la ~/.ssh/apex-deploy*ls -la deployment-prod.yamlNetwork Security
Section titled “Network Security”Firewall Configuration
Section titled “Firewall Configuration”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):
# Allow SSH from control host onlyiptables -A INPUT -p tcp --dport 22 -s 10.0.1.5 -j ACCEPTiptables -A INPUT -p tcp --dport 22 -j DROP
# Allow component ports from application networkiptables -A INPUT -p tcp --dport 6030 -s 10.0.0.0/16 -j ACCEPTiptables -A INPUT -p tcp --dport 6041 -s 10.0.0.0/16 -j ACCEPTSSH Hardening
Section titled “SSH Hardening”On target nodes (/etc/ssh/sshd_config):
# Disable password authentication (after key setup)PasswordAuthentication noPubkeyAuthentication yes
# Disable root password loginPermitRootLogin prohibit-password
# Restrict to specific usersAllowUsers deploy-user
# Use strong key exchange algorithmsKexAlgorithms curve25519-sha256,diffie-hellman-group16-sha512Restart SSH after changes:
systemctl restart sshdNetwork Segmentation
Section titled “Network Segmentation”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:
# SSH through bastionssh -J bastion-user@bastion.example.com root@target-host
# Configure in Deployment YAMLspec: ssh: user: root keyPath: ~/.ssh/apex-deploy proxyJump: bastion-user@bastion.example.comTLS/SSL Certificates
Section titled “TLS/SSL Certificates”For production TDengine deployments:
- Use valid TLS certificates (not self-signed)
- Configure certificate verification
- Rotate certificates before expiration
- Use certificate authorities your clients trust
Artifact Security
Section titled “Artifact Security”Checksum Verification
Section titled “Checksum Verification”Apex automatically verifies SHA256 checksums for all artifacts. Never:
- Skip verification
- Modify manifest checksums
- Download artifacts from untrusted sources
If verification fails:
- Delete the cached artifact
- Re-download from official sources
- If problem persists, report to component teams
Offline Bundle Integrity
Section titled “Offline Bundle Integrity”When creating offline bundles:
# Create checksumscd apex-offline-bundle/sha256sum *.tar.gz *.zip > checksums.txt
# Verify on air-gapped systemsha256sum -c checksums.txtArtifact Sources
Section titled “Artifact Sources”Trusted sources only:
- Official CDN:
downloads.tdengine.com - Verified mirrors listed in official docs
- Internal mirrors after verification
Configure base URL:
base_url: https://verified-mirror.internal.example.comVerify mirror integrity:
# Compare checksums from official and mirrorcurl -s https://downloads.tdengine.com/apex/v0.4.0/checksums.txt > official.txtcurl -s https://mirror.internal/apex/v0.4.0/checksums.txt > mirror.txtdiff official.txt mirror.txtDeployment Security
Section titled “Deployment Security”Pre-Deployment Checks
Section titled “Pre-Deployment Checks”Before production deployment:
# 1. Verify connectivity without deployingapex check -f deployment-prod.yaml
# 2. Validate configurationapex validate -f deployment-prod.yaml --manifests ~/.apex/manifests/
# 3. Review deployment planapex apply -f deployment-prod.yaml --dry-run
# 4. Confirm resourcesapex prepare -f deployment-prod.yaml --manifests ~/.apex/manifests/
# 5. Deployapex apply -f deployment-prod.yaml --yesVersion Pinning
Section titled “Version Pinning”Pin versions in production to prevent unexpected changes:
# Good: pinned versionsroles: - component: tsdb version: "3.3.5.0" - component: idmp version: "1.2.3.0"
# Risky: auto versions in productionroles: - component: tsdb version: auto # Could deploy newer version unexpectedlyFor dynamic versions:
- Run
validateto resolve versions - Save the resolved Deployment YAML
- Review the resolved versions
- Use the resolved YAML for
prepareandapply
Deployment Isolation
Section titled “Deployment Isolation”Separate development, staging, and production:
~/.apex/├── deployments/│ ├── dev-deployment.yaml│ ├── staging-deployment.yaml│ └── prod-deployment.yaml└── config.yamlUse different SSH keys per environment:
spec: ssh: keyPath: ~/.ssh/apex-staging
# prod-deployment.yamlspec: ssh: keyPath: ~/.ssh/apex-prodChange Management
Section titled “Change Management”For production changes:
- Test in development/staging first
- Create change requests/tickets
- Schedule maintenance windows
- Have rollback plans ready
- Keep backups current
- Document changes
Logging and Auditing
Section titled “Logging and Auditing”Log Security
Section titled “Log Security”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:
grep -i "password\|secret\|key" ~/.apex/logs/deploy-*/apex.logRedact before sharing:
# Replace hostnamessed 's/10\.0\.1\.[0-9]\+/X.X.X.X/g' apex.log > apex-redacted.log
# Replace pathssed 's|/home/[^/]\+|/home/USER|g' apex-redacted.logAudit Trail
Section titled “Audit Trail”Enable logging for compliance:
apex_home: ~/.apextelemetry_enabled: true # Optional anonymous telemetryDeployment reports (~/.apex/reports/) contain:
- Timestamp and user
- Nodes and components
- Outcomes per stage
- Configuration references (not secrets)
Retain logs per your security policy:
# Archive deployment logstar czf apex-deploy-$(date +%Y%m).tar.gz ~/.apex/logs/mv apex-deploy-*.tar.gz /secure/archive/Telemetry Privacy
Section titled “Telemetry Privacy”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:
telemetry_enabled: falseOr per-deployment:
export APEX_TELEMETRY_DISABLED=1apex deploy -f deployment.yaml --yesIncident Response
Section titled “Incident Response”Compromised Credentials
Section titled “Compromised Credentials”If SSH keys or passwords are compromised:
- Immediately rotate on all target nodes:
# Remove compromised keyssh root@target-node "sed -i '/compromised-key/d' ~/.ssh/authorized_keys"
# Deploy new keyssh-copy-id -i ~/.ssh/apex-deploy-new.pub root@target-node- Update Deployment YAML:
spec: ssh: keyPath: ~/.ssh/apex-deploy-new- Audit recent deployments:
# Check recent activityls -lt ~/.apex/logs/ | head -20grep "deployment" ~/.apex/logs/*/apex.log- Review component logs for unauthorized access
Suspicious Activity
Section titled “Suspicious Activity”If you suspect unauthorized deployments:
- Check deployment reports:
ls -lt ~/.apex/reports/cat ~/.apex/reports/deploy-*/report.yaml- Review operation logs:
grep -r "ERROR\|FAIL\|unauthorized" ~/.apex/logs/- Check component status:
apex-component-status.sh- Review target node logs for unauthorized access
Recovery
Section titled “Recovery”After a security incident:
- Rotate all credentials
- Re-deploy from known-good configuration
- Update security policies
- Document lessons learned
- Update incident response procedures
Compliance and Hardening
Section titled “Compliance and Hardening”Security Baselines
Section titled “Security Baselines”Follow security baselines for your environment:
- CIS benchmarks for Linux/Windows
- NIST guidelines
- Industry-specific requirements (HIPAA, PCI-DSS, etc.)
Regular Security Tasks
Section titled “Regular Security Tasks”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
Security Checklist
Section titled “Security Checklist”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
Related Topics
Section titled “Related Topics”- Best practices - Operational best practices
- Troubleshooting - Common issues and solutions
- Architecture - Security model and design
- Configuration - Config file security