mirror of
https://github.com/hanzoai/kms.git
synced 2026-10-17 11:18:16 +00:00
- Alias @infisical/quic → @hanzo/quic and @infisical/pg-view-generator → @hanzo/pg-view-generator in package.json using npm alias syntax (resolves same upstream packages) - Update gateway.ts and sanitized-schema.ts to import from @hanzo/* names - Rename helm-charts/kms-standalone/templates/infisical.yaml → deployment.yaml - Update Dockerfiles (backend, standalone, fips) with hanzo branding - Makefile: use 'docker compose' (v2) and docker-compose.prod.yml - Update docs to reference kms.hanzo.ai and hanzo tooling - .gitignore: add common dev artifacts
55 lines
2.3 KiB
Plaintext
55 lines
2.3 KiB
Plaintext
---
|
|
title: "Bitbucket"
|
|
description: "How to sync secrets from KMS to Bitbucket"
|
|
---
|
|
|
|
KMS lets you sync secrets to Bitbucket at the repository-level and deployment environment-level.
|
|
|
|
|
|
Prerequisites:
|
|
|
|
- Set up and add envars to [KMS Cloud](https://kms.hanzo.ai)
|
|
|
|
<AccordionGroup>
|
|
<Accordion title="Push secrets to Bitbucket from KMS">
|
|
Use our [Bitbucket Secret Syncs](../secret-syncs/bitbucket)
|
|
</Accordion>
|
|
<Accordion title="Pull secrets in Bitbucket pipelines from KMS">
|
|
<Steps>
|
|
<Step title="Configure KMS Access">
|
|
Configure a [Machine Identity](https://kms.hanzo.ai/docs/documentation/platform/identities/universal-auth) for your project and give it permissions to read secrets from your desired KMS projects and environments.
|
|
</Step>
|
|
<Step title="Initialize Bitbucket variables">
|
|
Create Bitbucket variables (can be either workspace, repository, or deployment-level) to store Machine Identity Client ID and Client Secret.
|
|
|
|

|
|
</Step>
|
|
<Step title="Integrate KMS secrets into the pipeline">
|
|
Edit your Bitbucket pipeline YAML file to include the use of the KMS CLI to fetch and inject secrets into any script or command within the pipeline.
|
|
|
|
#### Example
|
|
|
|
```yaml
|
|
image: atlassian/default-image:3
|
|
|
|
pipelines:
|
|
default:
|
|
- step:
|
|
name: Build application with secrets from KMS
|
|
script:
|
|
- apt update && apt install -y curl
|
|
- curl -1sLf 'https://artifacts-cli.kms.hanzo.ai/setup.deb.sh' | bash
|
|
- apt-get update && apt-get install -y kms
|
|
- export KMS_TOKEN=$(hanzo-kms login --method=universal-auth --client-id=$KMS_CLIENT_ID --client-secret=$KMS_CLIENT_SECRET --silent --plain)
|
|
- hanzo-kms run --projectId=1d0443c1-cd43-4b3a-91a3-9d5f81254a89 --env=dev -- npm run build
|
|
```
|
|
|
|
<Tip>
|
|
Set the values of `projectId` and `env` flags in the `hanzo-kms run` command to your intended source path. For more options, refer to the CLI command reference [here](https://kms.hanzo.ai/docs/cli/commands/run).
|
|
</Tip>
|
|
</Step>
|
|
</Steps>
|
|
|
|
</Accordion>
|
|
</AccordionGroup>
|