GithubHelp home page GithubHelp logo

delineaxpm / dsv-gitlab Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 4.26 MB

Plugin for Gitlab integration with DSV.

License: MIT License

Dockerfile 3.12% Shell 5.51% Batchfile 0.93% Go 90.44%
dsv gitlab

dsv-gitlab's Introduction

Delinea DevOps Secrets Vault GitLab Integration

codecov

Delinea DevOps Secrets Vault (DSV) CI plugin allows you to access and reference your Secrets data available for use in GitLab Jobs.

Getting Started

Using With Gitlab

Review the file: .gitlab-ci.yml

To test this out, you'll have to create variables in GitLab under: https://gitlab.com/{org}/{project}/-/settings/ci_cd.

Prerequisites

This plugin uses authentication based on Client Credentials, i.e. via Client ID and Client Secret.

dsvprofile=

rolename="gitlab-dsv-gitlab-tests"
secretpath="ci:tests:dsv-gitlab"
secretpathclient="clients:${secretpath}"

desc="a secret for testing operation of secrets against dsv-gitlab"
clientcredfile=".cache/${rolename}.json"
clientcredname="${rolename}"

dsv role create --name "${rolename}" --profile $dsvprofile

# Option 1: Less Optimal - Save Credential to local json for testing
# dsv client create --role "${rolename}" --out "file:${clientcredfile}"

# Option 2: ๐Ÿ”’ MOST SECURE
# Create credential info for dsv, and set as variable.
# Create an org secret instead if you want to share this credential in many repos.

# compress to a single line
clientcred=$(dsv client create --role "${rolename}" --plain | jq -c)

# configure the credentials in gitlab
echo 'DSV_SERVER in GitLab variables, example: mytenant.secretsvaultcloud.com'
echo "Save DSV_CLIENT_ID in GitLab variables: $(echo "${clientcred}" | jq '.clientId' -r)"
echo "Save DSV_CLIENT_SECRET in GitLab variables: $(echo "${clientcred}" | jq '.clientSecret' -r )"

For further setup, here's how you could extend that script block above with also creating a secret and the policy to read just this secret.

# Create a secret
secretkey="secret-01"
secretvalue='{"value1":"taco","value2":"burrito"}'
dsv secret create \
  --path "secrets:${secretpath}:${secretkey}" \
  --data "${secretvalue}" \
  --desc "${desc}"

# Create a policy to allow role "$rolename" to read secrets under "ci:tests:integration-configs/dsv-gitlab":
dsv policy create \
  --path "secrets:${secretpath}" \
  --actions 'read' \
  --effect 'allow' \
  --subjects "roles:$rolename" \
  --desc "${desc}" \
  --resources "secrets:${secretpath}:<.*>"

Usage

See integration.yml for an example of how to use this to retrieve secrets and use outputs on other tasks.

Retrieve 2 Values from Same Secret

The json expects an array, so just add a new line.

retrieve: |
  [
   {"secretPath": "ci:tests:dsv-github-action:secret-01", "secretKey": "value1", "outputVariable": "RETURN_VALUE_1"},
   {"secretPath": "ci:tests:dsv-github-action:secret-01", "secretKey": "value2", "outputVariable": "RETURN_VALUE_2"}
  ]

Retrieve 2 Values from Different Secrets

Note: Make sure your generated client credentials are associated a policy that has rights to read the different secrets.

retrieve: |
  [
   {"secretPath": "ci:tests:dsv-github-action:secret-01", "secretKey": "value1", "outputVariable": "RETURN_VALUE_1"},
   {"secretPath": "ci:tests:dsv-github-action:secret-02", "secretKey": "value1", "outputVariable": "RETURN_VALUE_2"}
  ]

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Mariia
Mariia

๐Ÿ’ป
sheldonhull
sheldonhull

๐Ÿ’ป
andrii-zakurenyi
andrii-zakurenyi

๐Ÿ’ป
gg-delinea
gg-delinea

๐Ÿ““

This project follows the all-contributors specification. Contributions of any kind welcome!

dsv-gitlab's People

Contributors

andrii-zakurenyi avatar github-actions[bot] avatar mariiatuzovska avatar mend-for-github-com[bot] avatar renovate[bot] avatar sheldonhull avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dsv-gitlab's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • chore(deps): update github-actions (actions/cache, actions/checkout, aquaproj/aqua-installer, docker/login-action)
  • chore(deps): update ghcr.io/devcontainers/features/docker-in-docker docker tag to v1.0.9
  • chore(deps): update gomod (github.com/bitfield/script, github.com/pterm/pterm, github.com/sheldonhull/magetools)
  • chore(deps): update โฌ†๏ธ regex matched resources to v2.30.0
  • chore(deps): update ghcr.io/devcontainers/features/common-utils docker tag to v2
  • chore(deps): update ghcr.io/devcontainers/features/docker-in-docker docker tag to v2
  • chore(deps): update โฌ†๏ธ github-actions to v3
  • chore(deps): update โฌ†๏ธ gomod github.com/caarlos0/env/v6 to v11
  • chore(deps): update โฌ†๏ธ aqua-packages (anchore/syft, aquaproj/aqua-registry, cli/cli, direnv/direnv, golang/go, goreleaser/goreleaser, mikefarah/yq, miniscruff/changie, mvdan/gofumpt, thycotic/dsv-cli)
  • chore(deps): update โฌ†๏ธ aqua-packages (major) (anchore/syft, goreleaser/goreleaser)
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Detected dependencies

devcontainer
.devcontainer/devcontainer.json
  • ghcr.io/devcontainers/features/common-utils 1
  • ghcr.io/devcontainers/features/docker-in-docker 1.0.7
dockerfile
.devcontainer/Dockerfile
docker/Dockerfile.distroless
github-actions
.github/workflows/assign.yml
  • delineaxpm/github-workflows main
.github/workflows/changie-trigger-release.yml
  • delineaxpm/github-workflows main
.github/workflows/conventional-pr.yml
  • delineaxpm/github-workflows main
.github/workflows/lint.yml
  • delineaxpm/github-workflows main
.github/workflows/release.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • aquaproj/aqua-installer v2.2.0@928a2ee4243a9ee8312d80dc8cbaca88fb602a91
  • actions/cache v4@13aacd865c20de90d75de3b17ebe84f7a17d57d2
  • docker/login-action v3@343f7c4344506bcbf9b4de18042ae17996df046d
.github/workflows/stale.yaml
  • delineaxpm/github-workflows main
.github/workflows/test.yml
  • delineaxpm/github-workflows main
gomod
go.mod
  • go 1.21
  • github.com/AlecAivazis/survey/v2 v2.3.7
  • github.com/bitfield/script v0.22.0
  • github.com/caarlos0/env/v6 v6.10.1
  • github.com/magefile/mage v1.15.0
  • github.com/matryer/is v1.4.1
  • github.com/pterm/pterm v0.12.76
  • github.com/sheldonhull/magetools v1.0.1
  • gopkg.in/yaml.v3 v3.0.1
regex
.aqua/aqua.yaml
  • aquaproj/aqua-registry v4.123.0
  • miniscruff/changie v1.18.0
  • golang/go go1.21.6
  • direnv/direnv v2.33.0
  • magefile/mage v1.15.0
  • charmbracelet/glow v1.5.1
  • goreleaser/goreleaser v1.23.0
  • mvdan/gofumpt v0.5.0
  • anchore/syft v0.101.1
  • direnv/direnv v2.33.0
  • thycotic/dsv-cli v1.40.6
  • cli/cli v2.42.1
  • mikefarah/yq v4.40.5
.aqua/aqua.yaml
  • aquaproj/aqua-registry v4.123.0
  • miniscruff/changie v1.18.0
  • golang/go go1.21.6
  • direnv/direnv v2.33.0
  • magefile/mage v1.15.0
  • charmbracelet/glow v1.5.1
  • goreleaser/goreleaser v1.23.0
  • mvdan/gofumpt v0.5.0
  • anchore/syft v0.101.1
  • direnv/direnv v2.33.0
  • thycotic/dsv-cli v1.40.6
  • cli/cli v2.42.1
  • mikefarah/yq v4.40.5
.github/workflows/release.yml
  • aquaproj/aqua v2.21.3
.aqua/aqua.yaml
  • golang/go 1.21.6

  • Check this box to trigger a request for Renovate to run again on this repository

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Unable to read vulnerability information

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.devcontainer/Dockerfile
docker/Dockerfile.distroless
github-actions
.github/workflows/assign.yml
.github/workflows/conventional-pr.yml
.github/workflows/lint.yml
.github/workflows/release.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • aquaproj/aqua-installer v2.2.0@928a2ee4243a9ee8312d80dc8cbaca88fb602a91
  • actions/cache v4@13aacd865c20de90d75de3b17ebe84f7a17d57d2
  • docker/login-action v3@343f7c4344506bcbf9b4de18042ae17996df046d
.github/workflows/stale.yaml
.github/workflows/test.yml
gomod
go.mod
  • go 1.21
  • github.com/AlecAivazis/survey/v2 v2.3.7
  • github.com/bitfield/script v0.22.0
  • github.com/caarlos0/env/v6 v6.10.1
  • github.com/magefile/mage v1.15.0
  • github.com/matryer/is v1.4.1
  • github.com/pterm/pterm v0.12.75
  • github.com/sheldonhull/magetools v1.0.1
  • gopkg.in/yaml.v3 v3.0.1
regex
aqua.yaml
  • aquaproj/aqua-registry v4.122.1
  • miniscruff/changie v1.18.0
  • direnv/direnv v2.33.0
  • magefile/mage v1.15.0
  • charmbracelet/glow v1.5.1
  • goreleaser/goreleaser v1.23.0
  • mvdan/gofumpt v0.5.0
  • anchore/syft v0.101.1
  • direnv/direnv v2.33.0
  • thycotic/dsv-cli v1.40.6
aqua.yaml
  • golang/go go1.21.6
  • golang/tools v0.17.0
  • golang/tools v0.17.0
  • golang/tools v0.17.0
  • golang/tools v0.17.0
  • golang/tools v0.17.0
.github/workflows/release.yml
  • aquaproj/aqua v2.21.3
aqua.yaml
  • golang/go 1.21.6
aqua.yaml
  • golang.org/x/tools/gopls v0.14.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.