Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 402ba5f2 authored by Simon BLONDIEAU's avatar Simon BLONDIEAU
Browse files

Reformated README.md so it uses Markdown

parent 1eec51f8
Branches
Tags database-v0.0.1 helm-v0.0.2
1 merge request!2Resolve "README file is not using Markdown format"
Project Name: Vault Data Retrieval Tool
Description:
# Vault Data Retrieval Tool
This tool is designed to retrieve secrets and secret metadata from HashiCorp Vault using the AppRole authentication method. It provides functions to fetch passwords and key data from a specified path within the Vault.
Requirements:
- Python 3.x
- pip (Python package manager)
## Requirements
* Python 3.x
* pip (Python package manager)
Installation:
## Installation
1. Clone the repository from https://code.europa.eu/digit-c4/dev/ansible-vault.
2. Navigate to the project directory.
3. Create a virtual environment (optional but recommended):
```
```sh
python3 -m venv venv
source venv/bin/activate
```
4. Install dependencies using the provided requirements.txt file:
```
```sh
pip install -r requirements.txt
```
Usage:
## Usage
1. Ensure you have the necessary permissions and access to the HashiCorp Vault.
2. Set up the AppRole authentication method in your Vault instance. Refer to the provided links for detailed instructions.
3. Modify the code to provide your Vault URL, namespace, role ID, secret ID, mount point, and engine details.
4. EXAMPLE
4. Example:
```python
sys.path.append(config_global.get('APPLICATION', 'PYTHON-LIBRARY'))
sys.path.append('/opt/auth')
from ansible-vault.vault.client import clientV
password = clientV.getPasswordByAppRole("dev/SNOW/csui", "https://sam-hcavault.cec.eu.int", "EC/DIGIT_C4_SNET_ADMIN-ACC", "role_id", "secret_id", "apps-kv", "dev")
```
## Functionality
* `getPasswordByAppRole(key, vault_url, namespace_used, role_id, secret_id, mount_point, engine)`: This function retrieves a password from the specified key path in the Vault.
* `getKeysData(key, vault_url, namespace_used, role_id, secret_id, mount_point, engine)`: This function retrieves key data (secret metadata) from the specified key path in the Vault.
Functionality:
- `getPasswordByAppRole(key, vault_url, namespace_used, role_id, secret_id, mount_point, engine)`: This function retrieves a password from the specified key path in the Vault.
- `getKeysData(key, vault_url, namespace_used, role_id, secret_id, mount_point, engine)`: This function retrieves key data (secret metadata) from the specified key path in the Vault.
Notes:
- Ensure that the AppRole authentication method is correctly configured and enabled in your Vault instance.
- Modify the code according to your specific Vault configuration and requirements.
- Handle errors and exceptions appropriately in your code to ensure smooth operation.
## Notes
* Ensure that the AppRole authentication method is correctly configured and enabled in your Vault instance.
* Modify the code according to your specific Vault configuration and requirements.
* Handle errors and exceptions appropriately in your code to ensure smooth operation.
References:
- HashiCorp Vault Documentation: [https://www.vaultproject.io/docs](https://www.vaultproject.io/docs)
- HVAC Documentation: [https://hvac.readthedocs.io](https://hvac.readthedocs.io)
## References
* HashiCorp Vault Documentation: [https://www.vaultproject.io/docs](https://www.vaultproject.io/docs)
* HVAC Documentation: [https://hvac.readthedocs.io](https://hvac.readthedocs.io)
Author:
Marcelo teixeira
Ricardo Silva
\ No newline at end of file
## Authors
* Marcelo Teixeira
* Ricardo Silva
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment