-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
837160b
commit 0a94f92
Showing
2 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// package cmd | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
rotateAll bool | ||
rotateGroup string | ||
rotateHost string | ||
) | ||
|
||
// rotateKeyCmd represents the rotateKey command | ||
var rotateKeyCmd = &cobra.Command{ | ||
Use: "rotate-key", | ||
Short: "Rotate the encryption key for added security", | ||
Long: `The rotate-key command allows you to rotate the ssh key used by the servers. | ||
This is an important security practice that helps protect your servers by regularly changing the key. | ||
`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if rotateAll { | ||
rotateKeysForAll() | ||
} else if rotateGroup != "" { | ||
rotateKeysForGroup(rotateGroup) | ||
} else if rotateHost != "" { | ||
rotateKeysForHost(rotateHost) | ||
} else { | ||
cmd.Printf("Please specify --all, --group, or --host\n") | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(rotateKeyCmd) | ||
} | ||
|
||
func rotateKeysForAll() { | ||
// Implementation | ||
} | ||
|
||
func rotateKeysForGroup(group string) { | ||
// Implementation | ||
} | ||
|
||
func rotateKeysForHost(host string) { | ||
// Implementation | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters