From 47d4b3b6e4d68660e6e1e05fe2e1c0839f86e40e Mon Sep 17 00:00:00 2001 From: bndw Date: Tue, 10 Feb 2026 21:29:08 -0800 Subject: Harden security: name validation, scoped sudoers, safe.directory - Add ValidateName() enforcing ^[a-z][a-z0-9-]{0,62}$ on all entry points - Tighten sudoers to restrict cp sources/destinations and chown targets - Scope git safe.directory to www-data user only (preserves CVE-2022-24765) - Add www-data to git group and caddy to www-data group for fcgiwrap - Fix vanity import template to use orig_uri placeholder - Restart (not reload) services after group changes - Add name validation to env subcommands and deploy_cmd --- cmd/ship/deploy_cmd.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/ship/deploy_cmd.go') diff --git a/cmd/ship/deploy_cmd.go b/cmd/ship/deploy_cmd.go index ca5c54d..ba45c4f 100644 --- a/cmd/ship/deploy_cmd.go +++ b/cmd/ship/deploy_cmd.go @@ -24,6 +24,9 @@ Examples: func runDeployGit(cmd *cobra.Command, args []string) error { name := args[0] + if err := validateName(name); err != nil { + return err + } st, err := state.Load() if err != nil { -- cgit v1.2.3