diff --git a/README.md b/README.md index a953bc1..1257103 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ $ alpacon server create # Delete server $ alpacon server delete [SERVER NAME] +$ alpacon server rm [SERVER NAME] Server Name: Platform(debian, rhel): @@ -173,6 +174,18 @@ $ alpacon websh -u [USER NAME] -g [GROUP NAME] [COMMAND] $ alpacon websh --username=[USER NAME] --groupname=[GROUP NAME] [COMMAND] ``` +#### Share your terminal +You can share the current terminal to others via a temporary link: +```bash +# Open a websh terminal and share the current terminal +$ alpacon websh [SERVER NAME] --share +$ alpacon websh [SERVER NAME] --share --read-only true + +# Join an existing shared session +$ alpacon websh join --url [SHARED_URL] --password [PASSWORD] +``` + + #### Identity and Access Management (IAM) Efficiently manage user and group resources: @@ -193,6 +206,7 @@ $ alpacon user update [USER NAME] # Delete user $ alpacon user delete [USER NAME] +$ alpacon user rm [USER NAME] # Managing Groups @@ -204,13 +218,15 @@ $ alpacon group describe [GROUP NAME] # Delete group $ alpacon group delete [GROUP NAME] +$ alpacon group rm [GROUP NAME] # Add a member to a group with a specific role $ alpacon group member add -$ alpacon group member add --group=[GROUP NAME] --member=[MEMBER NAME] --role=[ROLE] +$ alpacon group member add --group [GROUP NAME] --member [MEMBER NAME] --role [ROLE] # Remove a member from a group -$ alpacon group member delete --group=[GROUP NAME] --member=[MEMBER NAME] +$ alpacon group member delete --group [GROUP NAME] --member[MEMBER NAME] +$ alpacon group member rm --group [GROUP NAME] --member [MEMBER NAME] ``` #### API tokens @@ -226,6 +242,7 @@ $ alpacon token ls # Delete API token $ alpacon token delete [TOKEN_ID_OR_NAME] +$ alpacon token rm [TOKEN_ID_OR_NAME] # Log in via API token $ alpacon login -s [SERVER URL] -t [TOKEN KEY] @@ -243,6 +260,7 @@ $ alpacon token acl ls [TOKEN_ID_OR_NAME] # Delete the specified command ACL from an API token. $ alpacon token acl delete [COMMAND_ACL_ID] +$ alpacon token acl rm [COMMAND_ACL_ID] $ alpacon token acl delete --token=[TOKEN_ID_OR_NAME] --command=[COMMAND] ``` @@ -271,7 +289,7 @@ $ alpacon package python upload alpamon-1.1.0-py3-none-any.whl $ alpacon package python download alpamon-1.1.0-py3-none-any.whl . # system -$ alpacon package system ls / list /all +$ alpacon package system ls / list / all $ alpacon package system upload osquery-5.10.2-1.linux.x86_64.rpm $ alpacon package system download osquery-5.10.2-1.linux.x86_64.rpm . ``` @@ -318,6 +336,7 @@ $ alpacon note create -s [SERVER NAME] -c [CONTENT] -p [PRIVATE(true or false)] # Delete a specified note $ alpacon note delete [NOTE ID] +$ alpacon note rm [NOTE ID] ``` #### Private CA, Certificate Commands @@ -337,6 +356,7 @@ $ alpacon authority download-crt [AUTHOIRY ID] --out=/path/to/root.crt # Delete a CA along with its certificate and CSR $ alpacon authority delete [AUTHORITY ID] +$ alpacon authority rm [AUTHORITY ID] # Generate a new Certificate Signing Request (CSR) $ alpacon csr create @@ -353,6 +373,7 @@ $ alpacon csr deny [CSR ID] # Delete a Certificate Signing Request $ alpacon csr delete [CSR ID] +$ alpacon csr rm [CSR ID] # Get detailed information about a specific Signing Request. $ alpacon csr describe [CSR ID] diff --git a/cmd/authority/authority_delete.go b/cmd/authority/authority_delete.go index e49b4b4..ff8ce9e 100644 --- a/cmd/authority/authority_delete.go +++ b/cmd/authority/authority_delete.go @@ -8,14 +8,16 @@ import ( ) var authorityDeleteCmd = &cobra.Command{ - Use: "delete [CSR ID]", - Short: "Delete a CA along with its certificate and CSR", + Use: "delete [CSR ID]", + Aliases: []string{"rm"}, + Short: "Delete a CA along with its certificate and CSR", Long: ` This command removes a Certificate Authority (CA) from the system, including its certificate and CSR. Note that this action requires manual configuration adjustments to alpamon-cert-authority. `, Example: ` alpacon authority delete [AUTHORITY ID] + alpacon authority rm [AUTHORITY_ID] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/csr/csr_delete.go b/cmd/csr/csr_delete.go index 68204a7..9b040b8 100644 --- a/cmd/csr/csr_delete.go +++ b/cmd/csr/csr_delete.go @@ -8,14 +8,16 @@ import ( ) var csrDeleteCmd = &cobra.Command{ - Use: "delete [CSR ID]", - Short: "Delete a CSR", + Use: "delete [CSR ID]", + Aliases: []string{"rm"}, + Short: "Delete a CSR", Long: ` Removes a Certificate Signing Request from the system, effectively canceling the request and any associated processing. `, Example: ` alpacon csr delete [CSR ID] + alpacon csr rm [CSR ID] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/iam/group_delete.go b/cmd/iam/group_delete.go index f9b6130..710c74d 100644 --- a/cmd/iam/group_delete.go +++ b/cmd/iam/group_delete.go @@ -8,15 +8,17 @@ import ( ) var groupDeleteCmd = &cobra.Command{ - Use: "delete [GROUP NAME]", - Short: "Delete a specified group", + Use: "delete [GROUP NAME]", + Aliases: []string{"rm"}, + Short: "Delete a specified group", Long: ` This command is used to permanently delete a specified group from the Alpacon. The command requires the exact username as an argument. NOTE : alpacon(Alpacon users) group cannot delete or update memberships `, Example: ` - alpacon group delete [GROUP NAME] + alpacon group delete [GROUP NAME] + alpacon group rm [GROUP NAME] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/iam/member_delete.go b/cmd/iam/member_delete.go index 3a12cf6..5136b7d 100644 --- a/cmd/iam/member_delete.go +++ b/cmd/iam/member_delete.go @@ -10,8 +10,9 @@ import ( var memberDeleteRequest iam.MemberDeleteRequest var memberDeleteCmd = &cobra.Command{ - Use: "delete", - Short: "Remove a member from a group", + Use: "delete", + Aliases: []string{"rm"}, + Short: "Remove a member from a group", Long: ` This command removes an existing member from the specified group. It's useful for managing group membership and ensuring only current members have access. diff --git a/cmd/iam/user_delete.go b/cmd/iam/user_delete.go index 20ac30a..eaa3399 100644 --- a/cmd/iam/user_delete.go +++ b/cmd/iam/user_delete.go @@ -8,14 +8,16 @@ import ( ) var userDeleteCmd = &cobra.Command{ - Use: "delete [USER NAME]", - Short: "Delete a specified user", + Use: "delete [USER NAME]", + Aliases: []string{"rm"}, + Short: "Delete a specified user", Long: ` This command is used to permanently delete a specified user account from the Alpacon. The command requires the exact username as an argument. `, Example: ` alpacon user delete [USER NAME] + alpacon user rm [USER NAME] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/note/note_delete.go b/cmd/note/note_delete.go index 93a1e47..5ab96cb 100644 --- a/cmd/note/note_delete.go +++ b/cmd/note/note_delete.go @@ -8,8 +8,9 @@ import ( ) var noteDeleteCmd = &cobra.Command{ - Use: "delete [NOTE ID]", - Short: "Delete a specified note", + Use: "delete [NOTE ID]", + Aliases: []string{"rm"}, + Short: "Delete a specified note", Long: ` This command permanently deletes a specified note from the Alpacon server. It's important to verify that you have the necessary permissions to delete a note before using this command. @@ -17,6 +18,7 @@ var noteDeleteCmd = &cobra.Command{ `, Example: ` alpacon server delete [NOTE ID] + alpacon server rm [NOTE ID] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/server/server_delete.go b/cmd/server/server_delete.go index ca91b8b..4f3cd0c 100644 --- a/cmd/server/server_delete.go +++ b/cmd/server/server_delete.go @@ -8,8 +8,9 @@ import ( ) var serverDeleteCmd = &cobra.Command{ - Use: "delete [SERVER NAME]", - Short: "Delete a specified server", + Use: "delete [SERVER NAME]", + Aliases: []string{"rm"}, + Short: "Delete a specified server", Long: ` This command is used to permanently delete a specified server from the Alpacon. It is crucial to ensure that you have the appropriate permissions to delete a server before attempting this operation. @@ -17,6 +18,7 @@ var serverDeleteCmd = &cobra.Command{ `, Example: ` alpacon server delete [SERVER NAME] + alpacon server rm [SERVER NAME] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/token/acl_delete.go b/cmd/token/acl_delete.go index fd71470..e9d339d 100644 --- a/cmd/token/acl_delete.go +++ b/cmd/token/acl_delete.go @@ -8,15 +8,17 @@ import ( ) var aclDeleteCmd = &cobra.Command{ - Use: "delete", - Short: "Delete the specified command ACL from an API token.", + Use: "delete", + Aliases: []string{"rm"}, + Short: "Delete the specified command ACL from an API token.", Long: ` Removes an existing command acl from the API token This command requires the command acl id to identify the command acl to be deleted. `, Example: ` alpacon token acl delete [COMMAND_ACL_ID] - alpacon token acl delete --token=[TOKEN_ID_OR_NAME] --command=[COMMAND] + alpacon token acl rm [COMMAND_ACL_ID] + alpacon token acl rm --token=[TOKEN_ID_OR_NAME] --command=[COMMAND] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/token/token_delete.go b/cmd/token/token_delete.go index 3161e05..a587f95 100644 --- a/cmd/token/token_delete.go +++ b/cmd/token/token_delete.go @@ -8,14 +8,16 @@ import ( ) var tokenDeleteCmd = &cobra.Command{ - Use: "delete [tok NAME]", - Short: "Delete a specified api token", + Use: "delete [TOKEN NAME]", + Aliases: []string{"rm"}, + Short: "Delete a specified api token", Long: ` Removes an existing API token from the system. This command requires the token name to identify the token to be deleted. `, Example: ` - alpacon token delete [TOKEN_ID_OR_NAME] + alpacon token delete [TOKEN_ID_OR_NAME] + alpacon token rm [TOKEN_ID_OR_NAME] `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/go.mod b/go.mod index 9cb91d0..298de13 100644 --- a/go.mod +++ b/go.mod @@ -14,13 +14,11 @@ require ( ) require ( - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect golang.org/x/net v0.17.0 // indirect diff --git a/go.sum b/go.sum index 0d8ab8c..1bed324 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -22,7 +21,6 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=