Coder Social home page Coder Social logo

go-spiffe's Introduction

go-spiffe (v2)

This library is a convenient Go library for working with SPIFFE.

It leverages the SPIFFE Workload API, providing high level functionality that includes:

  • Establishing mutually authenticated TLS (mTLS) between workloads powered by SPIFFE.
  • Obtaining and validating X509-SVIDs and JWT-SVIDs.
  • Federating trust between trust domains using SPIFFE bundles.
  • Bundle management.

Documentation

See the Go Package documentation.

Quick Start

Prerequisites:

  1. Running SPIRE or another SPIFFE Workload API implementation.
  2. SPIFFE_ENDPOINT_SOCKET environment variable set to address of the Workload API (e.g. unix:///tmp/agent.sock). Alternatively the socket address can be provided programatically.

To create an mTLS server:

listener, err := spiffetls.Listen(ctx, "tcp", "127.0.0.1:8443", tlsconfig.AuthorizeAny())

To dial an mTLS server:

conn, err := spiffetls.Dial(ctx, "tcp", "127.0.0.1:8443", tlsconfig.AuthorizeAny())

The client and server obtain X509-SVIDs and X.509 bundles from the SPIFFE Workload API. The X509-SVIDs are presented by each peer and authenticated against the X.509 bundles. Both sides continue to be updated with X509-SVIDs and X.509 bundles streamed from the Workload API (e.g. secret rotation).

Examples

The examples directory contains rich examples for a variety of circumstances.

go-spiffe's People

Contributors

azdagron avatar amartinezfayo avatar evan2645 avatar martincapello avatar marcosy avatar marcosdy avatar dependabot[bot] avatar kunzimariano avatar jkanywhere avatar y2bishop2y avatar guilhermocc avatar sword-jin avatar sorindumitru avatar ajessup avatar sanderson042 avatar arukiidou avatar pxp928 avatar maxlambrecht avatar mmorel-35 avatar mbyczkowski avatar yangmarcyang avatar loveyana avatar lorenz avatar solarkennedy avatar frankli0324 avatar odeke-em avatar drrt avatar csstaub avatar bnevis-i avatar benburry avatar

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.