• Stars
    star
    143
  • Rank 247,767 (Top 6 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Secret management by contract toolchain

License Go Report Card made-with-Go GitHub release Maintenance

Harp

Harp is for Harpocrates (Ancient Greek: แผ‰ฯฯ€ฮฟฮบฯฮฌฯ„ฮทฯ‚) the god of silence, secrets and confidentiality in the Hellenistic religion. - Wikipedia

TL;DR.

Harp is a tool set to operate secret management by contract. The objective is to reduce the value centric management by handling secret data in a reproducible way by providing a technical stack to describe how your value is managed by contracts and pipelines. Furthermore, we know that naming thing is hard, as a consequence a secret could be consistently associated to a predictable secret identifier used as a key to refer to the secret value. Finally, the secret can hold additional metadata (ownership, rotation period, leak severity, etc.) which can be consumed during the pipeline executions.

These key/value associations (path โ‡’ value) form a Bundle stored in an immutable file named a Container. This Container acts as a pivot format to allow Harp commands to communicate and create data management pipelines.

In addition to that, it provides a template engine used to generate various confidence values (password, passphrase, crypto keys, etc.) and allow more sophisticated rendering operations (configuration files, etc.).

Finally, it provides a SDK to allow developers to integrate Harp features in their products, and/or extend the Harp pipeline features by creating new plugins.

Visual overview

Visual overview

Why harp?

  • Secret management is in essence a collection of processes that must be auditable, executable and reproducible for infosec and operation requirements;
  • Secret provisioning must be designed with secret rotation as a day one task, due to the fact that secret data must be rotated periodically to keep its secret property;
  • Developers should negotiate secret value for the secret consumer they are currently developing, by the contract based on a path (reference to the secret) and a value specification (for code contract) without the knowledge of the final deployed value;
  • Secret Operators use different set of tools to achieve secret management operation which increases the error/secret exposure probability due to tool count involved in the process (incompatibility, changes, etc.);
  • Without a defined secret naming convention, the secret storage becomes difficult to handle in time (naming is hard) and secret naming could not be helped to get a consistent, reliable and flexible secret tree;
  • Secret storage backend can use various implementations in different environments and should be provisioned consistently.

Use cases

  • You want to have a single secret value and you are asking yourself how to generate a strong password - Harp has a template engine with secret value generation functions to allow you to generate such values.
  • You have thousands secrets to handle to deploy your platform/customers on multiple cloud providers with different secret storages - Harp will help you to define consistent secret provisioning bundles and pipelines.
  • You need a ephemeral secret storage to bootstrap your long term cloud secret storage - Harp will help you to create secret containers that can be consumed on deployment.
  • You want to migrate massively your secrets from one secret storage to another - Harp provides you a secret container to store these secrets while they are going to be distributed in other secret storage implementations.
  • You have to alter/modifiy a secret (rotation/deprecation/renewal) - Harp provides you a GitOps-able secret storage agnostic operation set, so that you can define a specification to describe how your secret operation is going to be applied offline on the secret container.

How does it work?

Secret management Pipeline

Like a Data pipeline but for secret

harp allows you to handle secrets using deterministic pipelines expressed using an atomic series of CLI operations applied to a commonly shared container immutable and standalone file system used to store secret collection (Bundle) generated from a template engine via user specification, or external secret value coming from files or external secret storage.

Pipelines

These pipelines use the immutable container file system as a data exchange protocol and could be extended for new input, intermediary operation or output via plugins created with the harp SDK.

Immutable transformation

Each applied transformation creates a container with transformed data inside. This will enforce container reproducibility by eliminating cumulative side effects applied to the same container.

The container handles for you the confidentiality and integrity protection applied to the secret collection stored inside and manipulated by copy during the pipeline execution.

What can I do?

New to harp, let's start with onboarding tutorial ! TL;DR - Features overview

Harp provides :

  • A methodology to design your secret management;
    • Secret naming convention (CSO);
    • A defined common language and complete processes to achieve secret management operations;
  • A SDK to create your own tools to orchestrate your secret management pipelines;
    • A container manipulation library exposed as github.com/elastic/harp/pkg/container;
    • A secret bundle specification to store and manipulate secrets exposed as github.com/elastic/harp/pkg/bundle;
    • An on-steroid template engine exposed as github.com/elastic/harp/pkg/template
    • A path name validation library exposed as github.com/elastic/harp/pkg/cso
  • A CLI for secret management implementation
    • CI/CD integration;
    • Based on human-readable definitions (YAML);
    • In order to create auditable and reproducible pipelines.
    • An extensible tool which can be enhanced via plugins.

And allows :

  • Bundle level operations
    • Create a bundle from scratch / template / JSON (more via plugins);
    • Generate a complete bundle using a YAML Descriptor (BundleTemplate) to describe secret and their usages;
    • Read value stored in the K/V virtual file system;
    • Update the K/V virtual file system;
    • Reproducible patch applied on immutable container (copy-on-write);
    • Import / Export to Vault.
  • Immutable container level operations
    • Seal / Unseal a container for integrity and confidentiality property conservation to enforce at-rest encryption (aes256-gcm96 or chacha20-poly1305);
    • Multiple identities sealing algorithm;

FAQ

  • Is it used internally at Elastic? - Yes. It is used to generate bootstrap secrets used to bootstrap the new region infrastructure components. #ChickenEggProblem

  • Harp is only supporting Vault? - No, it has been published with only vault support built-in, but it supports many other secret storage implementations via plugins.

  • What's the difference with Vault? - HashiCorp Vault is an encrypted highly available K/V store with advanced authorization engine, it doesn't handle secret provisioning for you. You can't ask Vault to generate secrets for your application and store them using a defined logic. Harp is filling this requirement.

License

harp artifacts and source code is released under Apache 2.0 Software License.

Homebrew install

Download a release or build from source.

For stable version

brew tap elastic/harp
brew install elastic/harp/harp

Build instructions

Download a release or build from source.

Clone repository

$ git clone [email protected]:elastic/harp.git
$ export HARP_REPOSITORY=$(pwd)/harp

Manual dev environment

Check your go version

Only last 2 minor versions of a major are supported.

Go 1.17/1.16

Harp is compiled with :

$ go version
go version go1.17.8 linux/amd64

Simple go version manager - https://github.com/stefanmaric/g

Go 1.18 (beta)

Go 1.18 compilation is enabled for testing purpose and golangci-lint looks to hang, so it has been disabled for the moment.

Install mage

Mage is an alternative to Make where language used is Go. You can install it using 2 different methods.

From source

# Install mage
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go

Daily

export PATH=$HARP_REPOSITORY/tools/bin:$PATH
# Build harp in bin folder
mage

With nix-shell

Install nix on your system, if not already installed.

$ sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
$ curl -L https://nixos.org/nix/install | sh

More information? - https://nixos.wiki/wiki/Nix_Installation_Guide

$ cd $HARP_REPOSITORY
$ nix-shell

Bootstrap tools

# Go to tools submodule
cd $HARP_REPOSITORY/tools
# Resolve dependencies
go mod tidy
go mod vendor
# Pull tools sources, compile them and install executable in tools/bin
mage

Docker

For Tools

You have to build this image once before executing artifact pipelines.

mage docker:tools

Or you can download harp-tools from GitHub registry

# Standard usecase
$ docker pull ghcr.io/elastic/harp/harp-tools:latest
# FIPS compliant go toolchain
$ docker pull ghcr.io/elastic/harp/harp-tools-fips:latest

Check image integrity with cosign and the public key build/artifact/cosign.pub

cosign verify --key build/artifact/cosign.pub ghcr.io/elastic/harp/harp-tools:latest

Verification for ghcr.io/elastic/harp/harp-tools:latest --
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
  - Any certificates were verified against the Fulcio roots.

[{"critical":{"identity":{"docker-reference":"ghcr.io/elastic/harp/harp-tools"},"image":{"docker-manifest-digest":"sha256:1be31528e7b00c9e836479aadfdf49319f3b4d7916e705c43ffd0b14965763a8"},"type":"cosign container image signature"},"optional":{"ref":"40714fef947d018e6053991f5ddb54283f466b04","repo":"elastic/harp","workflow":"Build and push docker tools"}}]

For CLI

# or docker image [distroless:static, rootless, noshell]
mage docker:harp
# To execute in the container
docker run --rm -ti --read-only elastic/harp:<version>

Plugins

You can find more Harp feature extensions - https://github.com/elastic/harp-plugins

Community

Here is the list of external projects used as inspiration :

More Repositories

1

elasticsearch

Free and Open, Distributed, RESTful Search Engine
Java
65,029
star
2

kibana

Your window into the Elastic Stack
TypeScript
19,124
star
3

logstash

Logstash - transport and process your logs, events, or other data
Java
13,615
star
4

beats

๐Ÿ  Beats - Lightweight shippers for Elasticsearch & Logstash
Go
11,967
star
5

elasticsearch-php

Official PHP client for Elasticsearch.
PHP
5,190
star
6

elasticsearch-js

Official Elasticsearch client library for Node.js
TypeScript
5,174
star
7

go-elasticsearch

The official Go client for Elasticsearch
Go
4,933
star
8

elasticsearch-py

Official Python client for Elasticsearch
Python
4,034
star
9

elasticsearch-dsl-py

High level Python client for Elasticsearch
Python
3,695
star
10

elasticsearch-definitive-guide

The Definitive Guide to Elasticsearch
HTML
3,521
star
11

elasticsearch-net

This strongly-typed, client library enables working with Elasticsearch. It is the official client maintained and supported by Elastic.
C#
3,469
star
12

curator

Curator: Tending your Elasticsearch indices
Python
3,020
star
13

elasticsearch-rails

Elasticsearch integrations for ActiveModel/Record and Ruby on Rails
Ruby
3,017
star
14

examples

Home for Elasticsearch examples available to everyone. It's a great way to get started.
Jupyter Notebook
2,587
star
15

cloud-on-k8s

Elastic Cloud on Kubernetes
Go
2,461
star
16

elasticsearch-ruby

Ruby integrations for Elasticsearch
Ruby
1,928
star
17

elasticsearch-hadoop

๐Ÿ˜ Elasticsearch real-time search and analytics natively integrated with Hadoop
Java
1,915
star
18

helm-charts

You know, for Kubernetes
Python
1,807
star
19

search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
TypeScript
1,796
star
20

logstash-forwarder

An experiment to cut logs in preparation for processing elsewhere. Replaced by Filebeat: https://github.com/elastic/beats/tree/master/filebeat
Go
1,788
star
21

detection-rules

Python
1,751
star
22

ansible-elasticsearch

Ansible playbook for Elasticsearch
Ruby
1,567
star
23

otel-profiling-agent

The production-scale datacenter profiler
Go
1,231
star
24

stack-docker

Project no longer maintained.
Shell
1,189
star
25

apm-server

APM Server
Go
1,100
star
26

ecs

Elastic Common Schema
Python
920
star
27

protections-artifacts

Elastic Security detection content for Endpoint
YARA
848
star
28

ember

Elastic Malware Benchmark for Empowering Researchers
Jupyter Notebook
799
star
29

elasticsearch-docker

Official Elasticsearch Docker image
Python
790
star
30

elasticsearch-rs

Official Elasticsearch Rust Client
Rust
612
star
31

elasticsearch-cloud-aws

AWS Cloud Plugin for Elasticsearch
580
star
32

apm-agent-dotnet

Elastic APM .NET Agent
C#
540
star
33

apm-agent-nodejs

Elastic APM Node.js Agent
JavaScript
540
star
34

apm-agent-java

Elastic APM Java Agent
Java
536
star
35

eland

Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in Elasticsearch
Python
516
star
36

elasticsearch-mapper-attachments

Mapper Attachments Type plugin for Elasticsearch
Java
503
star
37

elasticsearch-servicewrapper

A service wrapper on top of elasticsearch
Shell
489
star
38

apm-agent-go

Official Go agent for Elastic APM
Go
390
star
39

sense

A JSON aware developer's interface to Elasticsearch. Comes with handy machinery such as syntax highlighting, autocomplete, formatting and code folding.
JavaScript
382
star
40

apm-agent-python

Official Python agent for Elastic APM
Python
381
star
41

elastic-charts

๐Ÿ“Š Elastic Charts library
TypeScript
362
star
42

stream2es

Stream data into ES (Wikipedia, Twitter, stdin, or other ESes)
Clojure
356
star
43

timelion

Timelion was absorbed into Kibana 5. Don't use this. Time series composer for Elasticsearch and beyond.
JavaScript
347
star
44

elasticsearch-labs

Notebooks & Example Apps for Search & AI Applications with Elasticsearch
Jupyter Notebook
341
star
45

apm

Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.
Gherkin
317
star
46

elasticsearch-net-example

A tutorial repository for Elasticsearch and NEST
305
star
47

elasticsearch-migration

This plugin will help you to check whether you can upgrade directly to the next major version of Elasticsearch, or whether you need to make changes to your data and cluster before doing so.
291
star
48

logstash-docker

Official Logstash Docker image
Python
286
star
49

elasticsearch-py-async

Backend for elasticsearch-py based on python's asyncio module.
Python
283
star
50

support-diagnostics

Support diagnostics utility for elasticsearch and logstash
Java
278
star
51

elasticsearch-java

Official Elasticsearch Java Client
Java
274
star
52

es2unix

Command-line ES
Clojure
274
star
53

elasticsearch-analysis-smartcn

Smart Chinese Analysis Plugin for Elasticsearch
268
star
54

dockerfiles

Dockerfiles for the official Elastic Stack images
Shell
253
star
55

go-sysinfo

go-sysinfo is a library for collecting system information.
Go
249
star
56

kibana-docker

Official Kibana Docker image
Python
243
star
57

elasticsearch-metrics-reporter-java

Metrics reporter, which reports to elasticsearch
Java
232
star
58

apm-agent-php

Elastic APM PHP Agent
PHP
229
star
59

docs

Ruby
229
star
60

elasticsearch-river-twitter

Twitter River Plugin for elasticsearch (STOPPED)
Java
202
star
61

elasticsearch-formal-models

Formal models of core Elasticsearch algorithms
Isabelle
200
star
62

rally-tracks

Track specifications for the Elasticsearch benchmarking tool Rally
Python
197
star
63

beats-dashboards

DEPRECATED. Moved to https://github.com/elastic/beats. Please use the new repository to add new issues.
Shell
192
star
64

elasticsearch-analysis-icu

ICU Analysis plugin for Elasticsearch
189
star
65

elasticsearch-river-rabbitmq

RabbitMQ River Plugin for elasticsearch (STOPPED)
Java
173
star
66

elasticsearch-analysis-kuromoji

Japanese (kuromoji) Analysis Plugin
168
star
67

terraform-provider-ec

Terraform provider for the Elasticsearch Service and Elastic Cloud Enterprise
Go
165
star
68

beats-docker

Official Beats Docker images
Python
165
star
69

elasticsearch-river-couchdb

CouchDB River Plugin for elasticsearch (STOPPED)
Java
163
star
70

apm-agent-ruby

Elastic APM agent for Ruby
Ruby
156
star
71

integrations

Elastic Integrations
Handlebars
155
star
72

require-in-the-middle

Module to hook into the Node.js require function
JavaScript
149
star
73

dorothy

Dorothy is a tool to test security monitoring and detection for Okta environments
Python
141
star
74

ml-cpp

Machine learning C++ code
C++
139
star
75

ecs-logging-java

Centralized logging for Java applications with the Elastic stack made easy
Java
137
star
76

SWAT

Simple Workspace Attack Tool (SWAT) is a tool for simulating malicious behavior against Google Workspace in reference to the MITRE ATT&CK framework.
Python
135
star
77

go-libaudit

go-libaudit is a library for communicating with the Linux Audit Framework.
Go
133
star
78

ansible-beats

Ansible Beats Role
Ruby
131
star
79

logstash-contrib

THIS REPOSITORY IS NO LONGER USED.
Ruby
128
star
80

elasticsearch-analysis-phonetic

Phonetic Analysis Plugin for Elasticsearch
127
star
81

azure-marketplace

Elasticsearch Azure Marketplace offering + ARM template
Shell
122
star
82

bpfcov

Source-code based coverage for eBPF programs actually running in the Linux kernel
C
115
star
83

anonymize-it

a general utility for anonymizing data
Python
114
star
84

windows-installers

Windows installers for the Elastic stack
C#
113
star
85

terraform-provider-elasticstack

Terraform provider for Elastic Stack
Go
111
star
86

makelogs

JavaScript
108
star
87

golang-crossbuild

Shell
107
star
88

elasticsearch-lang-python

Python language Plugin for elasticsearch
104
star
89

elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Go
102
star
90

go-freelru

GC-less, fast and generic LRU hashmap library for Go
Go
101
star
91

elasticsearch-lang-javascript

JavaScript language Plugin for elasticsearch
93
star
92

stack-docs

Elastic Stack Documentation
Java
92
star
93

elasticsearch-specification

Elasticsearch full specification
TypeScript
89
star
94

elasticsearch-perl

Official Perl low-level client for Elasticsearch.
Perl
87
star
95

next-eui-starter

Start building Kibana protoypes quickly with the Next.js EUI Starter
TypeScript
87
star
96

vue-search-ui-demo

A demo of implementing Elastic's Search UI and App Search using Vue.js
Vue
87
star
97

elasticsearch-transport-thrift

Thrift Transport for elasticsearch (STOPPED)
Java
84
star
98

ecs-dotnet

.NET integrations that use the Elastic Common Schema (ECS)
HTML
82
star
99

generator-kibana-plugin

DEPRECATED Yeoman Generator for Kibana Plugins, please use https://github.com/elastic/template-kibana-plugin/
JavaScript
79
star
100

hipio

A DNS server that parses a domain for an IPv4 Address
Haskell
76
star