Giter VIP home page Giter VIP logo

vault-credential-rotator's Introduction

AppVeyor

vault-credential-rotator

A tool used in conjunction with HashiCorp Vault (https://www.vaultproject.io/) to rotate access keys & secret access keys for the AWS secrets engine within Vault.

System Requirements

Roadmap

  • Additional secrets engine configurations (Microsoft Azure, Google Cloud Platform)
  • AppRole Support
  • Lease TTL warning & awareness Lease duration value presented in release/1.1.1

Configuration

Edit the appsettings.json file and add values for the following:

  • BaseClientTokenUri
  • BaseCredentialsUri
  • ValidateServerCertificates
  • Roles

For example, it may look like this:

{
  "AWS": {
    "BaseClientTokenUri": "https://vault.contoso.com/v1/auth/ldap/login/",
    "BaseCredentialsUri": "https://vault.contoso.com/v1/aws/creds/",
    "ValidateServerCertificates": "true",
    "Roles": [
      "grp-aws-r-contoso-powerusers"
    ]
  }
}

Once these parameters have been set in the appsettings.json file, run it with:

dotnet VaultCredentialRotator.dll

vault-credential-rotator's People

Contributors

issafram avatar troydieter avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

troydieter

vault-credential-rotator's Issues

Issue with no such device or address

When executing:

dotnet run

receiving the following:

tdieter@FS000PPRLW13390:/coderepo/vault-credential-rotator/src/VaultCredentialRotator$ dotnet run
Vault Credential Rotator - Version 1.0.0
Created by Issa Fram

Username: tdieter
Password: **********

Unhandled Exception: System.Net.Http.HttpRequestException: No such device or address ---> System.Net.Sockets.SocketException: No such device or address
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at VaultCredentialRotator.Program.GetClientTokenHttpResponseMessageAsync(String getClientTokenUri, String json) in /mnt/c/coderepo/vault-credential-rotator/src/VaultCredentialRotator/Program.cs:line 115
   at VaultCredentialRotator.Program.Main(String[] args) in /mnt/c/coderepo/vault-credential-rotator/src/VaultCredentialRotator/Program.cs:line 58
   at VaultCredentialRotator.Program.<Main>(String[] args)

I have the following in my appsettings.json:


{
  "AWS": {
    "BaseClientTokenUri": "https://REDACTED.com/v1/auth/ldap/login/",
    "BaseCredentialsUri": "http://REDACTED.com/v1/aws/creds/",
    "Roles": [
    "grp-aws-r-REDACTED-powerusers"
    ]
  }
}

Allow certificate mismatch/self-signed certificate bypass

Add something similar to:

public void ConfigureServices(IServiceCollection services)
    {
        services.AddHttpClient("HttpClientWithSSLUntrusted").ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
        {
            ClientCertificateOptions = ClientCertificateOption.Manual,
            ServerCertificateCustomValidationCallback =
            (httpRequestMessage, cert, cetChain, policyErrors) =>
            {
                return true;
            }
        });

to allow for certificate bypass to accommodate self-signed and unknown certificates.

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.