Securden – Command Line Interface¶
Securden CLI (Command Line Interface) provides a secure, seamless and an efficient way for non-developers and system admins to integrate Securden’s powerful password management abilities into their CLIs & tools. You can use it across various environments, whether it’s local development, CI/CD, staging, or production.
This guide will take you through the process of installing and getting data through Securden CLI using pre-defined commands.
Summary of steps:¶
-
Installing & Updating Securden CLI
-
Commands for Data Retrieval
1. Installation of Securden CLI¶
Installation of the Securden CLI can be done on Windows, Linux, and Mac Devices. Follow the instructions accordingly.
1.1 Installation of Securden CLI in Windows
Installation of Scoop Package Manager
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Run these two commands on your Windows Powershell to install Scoop. Make sure the installation is complete – you can do this by checking the version of Scoop installed.
a) Add CLI to your local Scoop’s bucket
scoop bucket add secureden https://github.com/SecurdenDevOps/win-cli.git
b) Install Securden CLI from the Scoop Package Manager
scoop install securden-cli
Updating of Securden CLI in Windows
Once Securden CLI is installed, further updates can also be installed via Scoop. Use the following command to update the CLI:
scoop update securden-cli
1.2 Installation of Securden CLI in Mac
a) Install CLI using brew
brew install SecurdenDevOps/get-cli/securden
Once Securden CLI is installed, further updates can also be installed via brew. Use the following command to update the CLI:
brew update && brew upgrade securden
1.3 Installation of Securden CLI in Linux
Add CLI to your apt using the following command:
echo "deb https://SecurdenDevOps.github.io/get-cli-apt stable main" | sudo tee /etc/apt/sources.list.d/securden-cli.list
Add the GPG key to verify signature of the application using the following command:
sudo wget -0 /etc/apt/trusted.gpg.d/get-cli-apt.asc
https://SecurdenDevOps.github.io/get-cli-apt/public.key
Use the following command to install Securden CLI using apt on Linux:
sudo apt update && sudo apt install securden-cli
Once Securden CLI is installed, further updates can also be installed via apt Use the following sudo command to update the CLI:
If you only wish to upgrade, use this command:
sudo apt update && sudo apt install securden-cli --only-upgrade securden-cli
2. Commands for Data Retrieval¶
You can retrieve the credentials of a specific account by passing the attributes of the account as parameters.
Before we begin with getting data from Securden, you must provide the authtoken & the URL every time you open the CLI (Once each session).
Tip
You can save this URL using a config command
3. API Token for Authentication¶
Securden server supports API token-based authentication for programmatic access to credentials. You can generate and copy the auth token from the Securden web interface.
1) You need to specify the API reference name and description for identification purposes.
2) You need to specify the IP addresses or a range of IP from which this token can be used.
3) You can create a static (with a permanent or a time limited validity) or a dynamic auth token.
4) You can specify the scope of the actions this auth token by selecting the required capabilities from the list.
5) Once the preferences are set, click on Create Token.
6) Now copy this authentication token.
Useful Commands¶
1) config <URL>
- To save a URL so you do not have to enter it every time
2) help
- To list all the available commands.
3) clear-config
- To delete the URL that was saved using config.
4) clear
- To clear the screen.
5) <any-command> --help
- To view the params for the command.