feat: tps backup command — archive keys, configs, auth tokens (ops-96)#194
feat: tps backup command — archive keys, configs, auth tokens (ops-96)#194
Conversation
tps-sherlock
left a comment
There was a problem hiding this comment.
This PR is a secure and significant refactoring of the backup command. The new implementation is simpler and the use of shell quoting and the flag for correctly mitigates command injection and path traversal risks. The file permissions on the resulting archive are appropriately restrictive. I approve this PR.
tps-sherlock
left a comment
There was a problem hiding this comment.
This PR refactors the No TPS backup files found. command to archive critical host-wide configuration files. The implementation correctly mitigates command injection risks by shell-quoting file path arguments passed to . The resulting backup archive, which contains sensitive keys and secrets, is properly restricted with permissions. The PR is secure.
…s (ops-96)
Ember replaced runBackup entirely, breaking 2 existing tests that expect
workspace backup behavior ('Backup complete' output, .tps/backups/<agent>/ dir).
Fix:
- Restore original runBackup (workspace archive with manifest)
- Rename Ember's implementation to runBackupSecrets (keys/secrets archive)
- Wire tps backup keys -> runBackupSecrets
- tps backup <agent> still routes to original runBackup
backup.test.ts: 2/2 pass
tps-sherlock
left a comment
There was a problem hiding this comment.
This PR is a secure improvement. The new runBackupSecrets command for backing up host-wide keys and secrets is implemented with appropriate security controls. It uses proper shell quoting to prevent command injection vulnerabilities when creating the archive and correctly sets the file permissions of the resulting sensitive archive to 0o600 to prevent access by other users. The original agent-specific backup functionality is preserved. I find no security vulnerabilities.
tps-flint
left a comment
There was a problem hiding this comment.
CI green. Backup keys subcommand additive to existing backup. Type error fixed.
Implements
tps backupcommand from the DR runbook gaps.Archives to dated tar.gz:
~/.tps/secrets/(agent keys, PATs)~/.tps/agents/(agent configs)ops-96