All Projects → cyberark → conjur-api-go

cyberark / conjur-api-go

Licence: Apache-2.0 license
Go client for the CyberArk Conjur API

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to conjur-api-go

conjur-oss-helm-chart
Helm chart for deploying Conjur OSS to Kubernetes
Stars: ✭ 22 (+69.23%)
Mutual labels:  core, conjur, conjur-core, conjbot-notify
kubernetes-conjur-deploy
Scripts for deploying DAP followers to Kubernetes and OpenShift given an existing DAP master cluster
Stars: ✭ 14 (+7.69%)
Mutual labels:  core, conjur, conjbot-notify
conjur-quickstart
Start securing your secrets and infrastructure by installing Conjur, using Docker and the official Conjur containers on DockerHub.
Stars: ✭ 18 (+38.46%)
Mutual labels:  core, conjur, conjbot-notify
terraform-provider-conjur
Terraform provider for Conjur
Stars: ✭ 17 (+30.77%)
Mutual labels:  conjur, conjbot-notify
conjur-template
Template repo for Conjur repositories
Stars: ✭ 14 (+7.69%)
Mutual labels:  conjur-core, conjbot-notify
summon-conjur
CyberArk Conjur provider for Summon
Stars: ✭ 32 (+146.15%)
Mutual labels:  conjur, conjbot-notify
Es extended
An FiveM RPG framework
Stars: ✭ 215 (+1553.85%)
Mutual labels:  core
nucore-open
Northwestern University Core Facility Management Software (NUCore)
Stars: ✭ 26 (+100%)
Mutual labels:  core
Core Grpc
C# Grpc驱动封装,基于Consul实现服务注册服务发现,支持dotnetcore / framework,可快速实现基于Grpc的微服务,内部有完整案例,包含服务端Server 客户端 Client,core+grpc, netcore+grpc, dotnetcore+grpc
Stars: ✭ 209 (+1507.69%)
Mutual labels:  core
Officedocs Skypeforbusiness
Skype for Business and Microsoft Teams documentation
Stars: ✭ 199 (+1430.77%)
Mutual labels:  core
core
Apiato Core Package
Stars: ✭ 52 (+300%)
Mutual labels:  core
Uragano
Uragano, A simple, high performance RPC library. Support load balancing, circuit breaker, fallback, caching, intercepting.
Stars: ✭ 28 (+115.38%)
Mutual labels:  core
psqlgraph
Library for graph-like storage in postgresql using sqlalchemy
Stars: ✭ 20 (+53.85%)
Mutual labels:  core
Core
Elm's core libraries
Stars: ✭ 2,634 (+20161.54%)
Mutual labels:  core
icinga-core
Icinga 1.x, the old core (EOL 31.12.2018)
Stars: ✭ 45 (+246.15%)
Mutual labels:  core
Core Layout
Flexbox & CSS-style Layout in Swift.
Stars: ✭ 215 (+1553.85%)
Mutual labels:  core
NetCoreWithDocker
Tutorial with samples about how to setup .Net Core with Docker
Stars: ✭ 20 (+53.85%)
Mutual labels:  core
Windows Powershell Docs
This repo is used to contribute to Windows 10, Windows Server 2016, and MDOP PowerShell module documentation.
Stars: ✭ 205 (+1476.92%)
Mutual labels:  core
Nspec
A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.
Stars: ✭ 242 (+1761.54%)
Mutual labels:  core
Graphical
Open-Source, Platform independent module that consumes data points as input and plots them on a 2D graph [Scatter / Bar / Line] on the PowerShell Console/Terminal
Stars: ✭ 237 (+1723.08%)
Mutual labels:  core

conjurapi

Programmatic Golang access to the Conjur API.

Certification level

This repo is a Community level project. It's a community contributed project that is not reviewed or supported by CyberArk. For more detailed information on our certification levels, see our community guidelines.

Using conjur-api-go with Conjur Open Source

Are you using this project with Conjur Open Source? Then we strongly recommend choosing the version of this project to use from the latest Conjur OSS suite release. Conjur maintainers perform additional testing on the suite release versions to ensure compatibility. When possible, upgrade your Conjur version to match the latest suite release; when using integrations, choose the latest suite release that matches your Conjur version. For any questions, please contact us on Discourse.

Compatability

The conjur-api-go has been tested against the following Go versions:

- 1.17
- 1.18

Installation

$ go get github.com/cyberark/conjur-api-go/conjurapi

Quick start

Fetching a Secret, for example:

Suppose there exists a variable db/secret with secret value fde5c4a45ce573f9768987cd

Create a go program using conjur-api-go to fetch the secret value:

package main

import (
    "os"
    "fmt"
    "github.com/cyberark/conjur-api-go/conjurapi"
    "github.com/cyberark/conjur-api-go/conjurapi/authn"
)

func main() {
    variableIdentifier := "db/secret"

    config, err := conjurapi.LoadConfig()
    if err != nil {
        panic(err)
    }

    conjur, err := conjurapi.NewClientFromKey(config,
        authn.LoginPair{
            Login:  os.Getenv("CONJUR_AUTHN_LOGIN"),
            APIKey: os.Getenv("CONJUR_AUTHN_API_KEY"),
        },
    )
    if err != nil {
        panic(err)
    }

    // Retrieve a secret into []byte.
    secretValue, err := conjur.RetrieveSecret(variableIdentifier)
    if err != nil {
        panic(err)
    }
    fmt.Println("The secret value is: ", string(secretValue))

    // Retrieve a secret into io.ReadCloser, then read into []byte.
    // Alternatively, you can transfer the secret directly into secure memory,
    // vault, keychain, etc.
    secretResponse, err := conjur.RetrieveSecretReader(variableIdentifier)
    if err != nil {
        panic(err)
    }

    secretValue, err = conjurapi.ReadResponseBody(secretResponse)
    if err != nil {
        panic(err)
    }
    fmt.Println("The secret value is: ", string(secretValue))
}

Build and run the program:

$ export CONJUR_APPLIANCE_URL=https://eval.conjur.org
$ export CONJUR_ACCOUNT=myorg
$ export CONJUR_AUTHN_LOGIN=mylogin
$ export CONJUR_AUTHN_API_KEY=myapikey
$ go run main.go
The secret value is: fde5c4a45ce573f9768987cd

Usage

Connecting to Conjur is a two-step process:

  • Configuration Instruct the API where to find the Conjur endpoint and how to secure the connection.
  • Authentication Provide the API with credentials that it can use to authenticate.

Contributing

We welcome contributions of all kinds to this repository. For instructions on how to get started and descriptions of our development workflows, please see our contributing guide.

License

Copyright (c) 2022 CyberArk Software Ltd. All rights reserved.

This repository is licensed under Apache License 2.0 - see LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].