Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Python module to implement the the Hashicorp Cloud Platform vault secrets API
Python package to implement the Hashicorp Cloud Platform - Vault Secrets API
Python package to implement the Hashicorp Cloud Platform - Vault Secrets API. In order for the code to function properly, we will need to set a few environment variables to provide authentication against the HCP API such that, we can retrieve the secret values containing sensitive information (i.e passwords, api_tokens, etc..) from various vault secret applications located within a given project. Please refer to the Package Requirements
section for more information on the (4) required environment variables
You can find the organizationID
and projectID
in their respective settings tab in HCP. However, in order to get the clientID and clientSecret, you will need to navigate to the Projects
-> <Project Name>
-> Access Control (IAM)
-> Service Principals
tab within your organization. Create a service principal with the Contributer Role
and generate keys. This will populate a clientID
and clientSecret
that the code will use to authenticate to the HCP API
pip install hcp-vault-secrets
pip install requests
clientID
: This is the clientID that is associated with the service principal in HashiCorp Cloud Platform.
clientSecret
: This is the clientSecret that is associated with the service principal in HashiCorp Cloud Platform.
organizationID
: The HashiCorp Cloud Platform organization ID that owns the Vault Secrets application
projectID
: The HashiCorp Cloud Platform project ID where the Vault Secrets application is located
HCP Topology
# import hcp_vault_secrets package
import hcp_vault_secrets.vaultsecrets as vaultsecrets
# create hcp instance
hcp = vaultsecrets.vaultsecrets()
GET
Path Parameters
name | type | description | required |
---|---|---|---|
appName | string | The name of the vault secrets application where the key is stored | True |
secretName | string | The name of the secrets' key you want to retrieve | True |
EXAMPLES
import hcp_vault_secrets.vaultsecrets as vaultsecrets
# create hcp instance
hcp = vaultsecrets.vaultsecrets()
# get the secret named "token" from the "assisted-installer" vault secrets application
# return type is <str>
token = hcp.getAppSecret(appName="assisted-installer", secretName="token")
# get the secret named "pull_secret" from the "assisted-installer" vault secrets application
# return type is <str>
pull_secret = hcp.getAppSecret(appName="assisted-installer", secretName="pull_secret")
# get the secret named "password" from the "proxmox" vault secrets application (in the same project)
# return type is <str>
prox = hcp.getAppSecret("proxmox", "password")
FAQs
Python module to implement the the Hashicorp Cloud Platform vault secrets API
We found that hcp-vault-secrets demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.