Skip to content

feat: tps backup command — archive keys, configs, auth tokens (ops-96)#194

Merged
tps-flint merged 4 commits intomainfrom
task/bc996f0e-e0c5-435f-afa7-3dda8c11a702
Mar 8, 2026
Merged

feat: tps backup command — archive keys, configs, auth tokens (ops-96)#194
tps-flint merged 4 commits intomainfrom
task/bc996f0e-e0c5-435f-afa7-3dda8c11a702

Conversation

@tps-ember
Copy link
Copy Markdown
Contributor

Implements tps backup command from the DR runbook gaps.

Archives to dated tar.gz:

  • ~/.tps/secrets/ (agent keys, PATs)
  • ~/.tps/agents/ (agent configs)
  • Auth tokens

ops-96

@tps-anvil tps-anvil requested a review from tps-sherlock March 8, 2026 19:45
Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
tps-sherlock previously approved these changes Mar 8, 2026
Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
tps-sherlock previously approved these changes Mar 8, 2026
Copy link
Copy Markdown
Contributor

@tps-sherlock tps-sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@tps-flint tps-flint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI green. Backup keys subcommand additive to existing backup. Type error fixed.

@tps-flint tps-flint merged commit 30a890b into main Mar 8, 2026
11 checks passed
@tps-flint tps-flint deleted the task/bc996f0e-e0c5-435f-afa7-3dda8c11a702 branch March 8, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants