Harbor provides a web console which is user-friendly and intuitive, users may still want to operate in terminal, which offers power and flexibility that can be indispensable for certain tasks and users. For example, the terminal allows for the automation of repetitive tasks through scripting. You can write scripts to perform complex operations on images stored in Harbor, reducing manual effort and errors.
There are two methods listed below. The first one is recommended as there are security risks when the second method is picked up.
1.) Harbor CLI
It is a powerful command-line tool, facilitating seamless interaction with the Harbor container registry. It simplifies various tasks such as creating, updating, and managing projects, registries, and other resources in Harbor.
For example, we can list all projects in this Harbor.
1. Command History: If you run the command in a terminal, the username and password will be stored in the command history. Anyone with access to your terminal can retrieve these credentials.
2. Process List: While the command is running, the username and password can be visible in the process list. This means that anyone who can view the process list on your system can see your credentials.
3. Logs: If the command is logged by any logging mechanism, the credentials will be stored in the logs, which can be accessed by unauthorized users.
4. Network Traffic: If you are not using HTTPS, the credentials will be sent over the network in plain text, making them susceptible to interception by attackers.
To mitigate these risks, you can use more secure methods such as: