Compare commits
	
		
			55 Commits
		
	
	
		
			v0.1.3
			...
			fce78d234d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fce78d234d | |||
| 940a512d56 | |||
| 52c2bd1060 | |||
| d2fa727990 | |||
| 0ed71be705 | |||
| 4ff47521b4 | |||
| 07fe16b72a | |||
| 4c77b5ef9b | |||
| 329d93a759 | |||
| ecc7f9bdc0 | |||
| cd376a0d00 | |||
| 73a26193bf | |||
| bd7e36e98b | |||
| ae21fd8a11 | |||
| b70d057cb8 | |||
| 603d70334e | |||
| 4912eef00a | |||
| ed66cd5492 | |||
| 631bec38d0 | |||
| 9db21cb15d | |||
| 056ac87eee | |||
| a1526c9334 | |||
| 21ce2e32d7 | |||
| 87794ee634 | |||
| 801dc967f8 | |||
| f213d9cc29 | |||
| c952c8d3cf | |||
| db8372f6db | |||
| 8ba601a2b1 | |||
| a19fb3086b | |||
| b2edb2b4bf | |||
| bd6eafd9f7 | |||
| 492c88c5b2 | |||
| 0560e2a76c | |||
| e7074257b1 | |||
| 03525cdad8 | |||
| 47f3ae2b81 | |||
| 0fd4e00c02 | |||
| bc9c5dbe0e | |||
| 94e7faae78 | |||
| a71ff52ab4 | |||
| 047478b9eb | |||
| 5535a88fb1 | |||
| 6810202f3f | |||
| 6e6e4ff8c4 | |||
| b371dca158 | |||
| a76a95b300 | |||
| 2b016aecb2 | |||
| 64ee43d75b | |||
| 756e9d661c | |||
| a13e9c0eba | |||
| 36a487cb0c | |||
| 59c401b1dc | |||
| 0cce8aecc6 | |||
| baa3990d38 | 
@@ -25,4 +25,5 @@ COPY --from=builder /app/etc/apiary/apiary.toml /app/apiary.toml
 | 
				
			|||||||
COPY --from=builder /app/bin/apiary /app/apiary
 | 
					COPY --from=builder /app/bin/apiary /app/apiary
 | 
				
			||||||
EXPOSE 8080
 | 
					EXPOSE 8080
 | 
				
			||||||
EXPOSE 2222
 | 
					EXPOSE 2222
 | 
				
			||||||
 | 
					HEALTHCHECK --interval=1m --timeout=10s --start-period=5s --retries=3 CMD curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8080/api/health || exit 1
 | 
				
			||||||
CMD ["/app/apiary", "serve"]
 | 
					CMD ["/app/apiary", "serve"]
 | 
				
			||||||
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							@@ -5,14 +5,14 @@ NAME = apiary
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
INSTALL_PREFIX ?= /usr/local
 | 
					INSTALL_PREFIX ?= /usr/local
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VERSION = $(shell cat version.go |grep "var Version"| cut -d "=" -f2| tr -d "\" ")
 | 
					VERSION = $(shell cat version.go |grep "Version"| head -n 1 |cut -d "=" -f2| tr -d "\" ")
 | 
				
			||||||
ARCH = $(shell go env | grep GOHOSTARCH | cut -d"=" -f2 | tr -d "\"")
 | 
					ARCH = $(shell go env | grep GOHOSTARCH | cut -d"=" -f2 | tr -d "\"")
 | 
				
			||||||
OS = $(shell go env | grep GOHOSTOS | cut -d"=" -f2 | tr -d "\"")
 | 
					OS = $(shell go env | grep GOHOSTOS | cut -d"=" -f2 | tr -d "\"")
 | 
				
			||||||
GIT_COMMIT := $(shell git rev-parse --short HEAD)
 | 
					GIT_COMMIT := $(shell git rev-parse --short HEAD)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BUILD_DIR = build/binary/current
 | 
					BUILD_DIR = build/binary/current
 | 
				
			||||||
BUILD_OUTPUT = $(BUILD_DIR)/$(NAME)-$(VERSION)-$(OS)-$(ARCH)
 | 
					BUILD_OUTPUT = $(BUILD_DIR)/$(NAME)-$(VERSION)-$(OS)-$(ARCH)
 | 
				
			||||||
BUILD_FLAGS = -tags embed -ldflags "-X github.uio.no/torjus/apiary.Build=$(GIT_COMMIT)" -o $(BUILD_OUTPUT)
 | 
					BUILD_FLAGS = -tags embed -ldflags "-X git.t-juice.club/torjus/apiary.Build=$(GIT_COMMIT)" -o $(BUILD_OUTPUT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GEODB_URL = https://raw.githubusercontent.com/geoacumen/geoacumen-country/master/Geoacumen-Country.mmdb
 | 
					GEODB_URL = https://raw.githubusercontent.com/geoacumen/geoacumen-country/master/Geoacumen-Country.mmdb
 | 
				
			||||||
GEODB_PATH = honeypot/Geoacumen-Country.mmdb
 | 
					GEODB_PATH = honeypot/Geoacumen-Country.mmdb
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.md
									
									
									
									
									
								
							@@ -33,3 +33,14 @@ vim /etc/apiary/apiary.toml
 | 
				
			|||||||
# 2021-04-10T11:27:42.783+0200    INFO   APP     Starting SSH server
 | 
					# 2021-04-10T11:27:42.783+0200    INFO   APP     Starting SSH server
 | 
				
			||||||
# 2021-04-10T11:27:42.783+0200    INFO   APP     Starting web server
 | 
					# 2021-04-10T11:27:42.783+0200    INFO   APP     Starting web server
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Development
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Run postgres-tests by running a postgres container:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```text
 | 
				
			||||||
 | 
					podman run -d -q -e POSTGRES_PASSWORD=apiary -e POSTGRES_USER=apiary -e POSTGRES_DB=apiary --rm --name apiary-test-db -p5432:5432 postgres:latest
 | 
				
			||||||
 | 
					export APIARY_TEST_POSTGRES_DSN="postgresql://apiary:apiary@localhost/apiary"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					go test ./...
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,8 @@ Description=Apiary SSH Honeypot
 | 
				
			|||||||
After=postgresql.service
 | 
					After=postgresql.service
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Service]
 | 
					[Service]
 | 
				
			||||||
 | 
					Type=notify
 | 
				
			||||||
 | 
					WatchdogSec=10
 | 
				
			||||||
User=apiary
 | 
					User=apiary
 | 
				
			||||||
ExecStart=/usr/bin/apiary serve
 | 
					ExecStart=/usr/bin/apiary serve
 | 
				
			||||||
Restart=on-failure
 | 
					Restart=on-failure
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										36
									
								
								apiary.toml
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								apiary.toml
									
									
									
									
									
								
							@@ -4,6 +4,9 @@
 | 
				
			|||||||
# Must be "memory" or "postgres"
 | 
					# Must be "memory" or "postgres"
 | 
				
			||||||
# Default: "memory"
 | 
					# Default: "memory"
 | 
				
			||||||
Type = "memory"
 | 
					Type = "memory"
 | 
				
			||||||
 | 
					# Enable caching
 | 
				
			||||||
 | 
					# Default: false
 | 
				
			||||||
 | 
					EnableCache = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Store.Postgres]
 | 
					[Store.Postgres]
 | 
				
			||||||
# Connection string for postgres
 | 
					# Connection string for postgres
 | 
				
			||||||
@@ -35,6 +38,9 @@ LogLevel = "INFO"
 | 
				
			|||||||
# Enable access logging
 | 
					# Enable access logging
 | 
				
			||||||
# Default: true
 | 
					# Default: true
 | 
				
			||||||
AccessLogEnable = true
 | 
					AccessLogEnable = true
 | 
				
			||||||
 | 
					# Disable logging of successful requests to metrics endpoint
 | 
				
			||||||
 | 
					# Default: false
 | 
				
			||||||
 | 
					AccessLogIgnoreMetrics = false
 | 
				
			||||||
# Address and port to listen to
 | 
					# Address and port to listen to
 | 
				
			||||||
# Default: ":8080"
 | 
					# Default: ":8080"
 | 
				
			||||||
ListenAddr = ":8080"
 | 
					ListenAddr = ":8080"
 | 
				
			||||||
@@ -56,3 +62,33 @@ CacheDir = "/var/apiary/certs"
 | 
				
			|||||||
# Redirect HTTP to HTTPS
 | 
					# Redirect HTTP to HTTPS
 | 
				
			||||||
# Default: true
 | 
					# Default: true
 | 
				
			||||||
RedirectHTTP = true
 | 
					RedirectHTTP = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Ports]
 | 
				
			||||||
 | 
					# Enable the port listener.
 | 
				
			||||||
 | 
					# Default: false
 | 
				
			||||||
 | 
					Enable = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Which address to listen on.
 | 
				
			||||||
 | 
					# Default: "" (listen to all addresses)
 | 
				
			||||||
 | 
					Addr = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Which TCP ports to listen to.
 | 
				
			||||||
 | 
					# Default: []
 | 
				
			||||||
 | 
					TCPPorts = ["25"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Which UDP ports to listen to.
 | 
				
			||||||
 | 
					# Default: []
 | 
				
			||||||
 | 
					UDPPorts = ["25"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[SMTP]
 | 
				
			||||||
 | 
					# Enable the port listener.
 | 
				
			||||||
 | 
					# Default: false
 | 
				
			||||||
 | 
					Enable = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Which address and port to listen on.
 | 
				
			||||||
 | 
					# Default: ":25"
 | 
				
			||||||
 | 
					Addr = ":25"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Enable collecting prometheus metrics
 | 
				
			||||||
 | 
					# Default: false
 | 
				
			||||||
 | 
					EnableMetrics = true
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										200
									
								
								cmd/apiary.go
									
									
									
									
									
								
							
							
						
						
									
										200
									
								
								cmd/apiary.go
									
									
									
									
									
								
							@@ -6,15 +6,19 @@ import (
 | 
				
			|||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/signal"
 | 
						"os/signal"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/gliderlabs/ssh"
 | 
						"git.t-juice.club/torjus/apiary"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/config"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ports"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/smtp"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/web"
 | 
				
			||||||
 | 
						"github.com/coreos/go-systemd/daemon"
 | 
				
			||||||
 | 
						sshlib "github.com/gliderlabs/ssh"
 | 
				
			||||||
	"github.com/urfave/cli/v2"
 | 
						"github.com/urfave/cli/v2"
 | 
				
			||||||
	"github.uio.no/torjus/apiary"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/config"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/honeypot"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/honeypot/store"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/web"
 | 
					 | 
				
			||||||
	"go.uber.org/zap"
 | 
						"go.uber.org/zap"
 | 
				
			||||||
	"go.uber.org/zap/zapcore"
 | 
						"go.uber.org/zap/zapcore"
 | 
				
			||||||
	"golang.org/x/crypto/acme/autocert"
 | 
						"golang.org/x/crypto/acme/autocert"
 | 
				
			||||||
@@ -53,13 +57,17 @@ func ActionServe(c *cli.Context) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Setup logging
 | 
						// Setup logging
 | 
				
			||||||
	loggers := setupLoggers(cfg)
 | 
						loggers := setupLoggers(cfg)
 | 
				
			||||||
 | 
						loggers.rootLogger.Infow("Starting apiary", "version", apiary.FullVersion())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Setup store
 | 
						// Setup store
 | 
				
			||||||
	var s store.LoginAttemptStore
 | 
						var s store.LoginAttemptStore
 | 
				
			||||||
	switch cfg.Store.Type {
 | 
						switch cfg.Store.Type {
 | 
				
			||||||
	case "MEMORY", "memory":
 | 
						case "MEMORY", "memory":
 | 
				
			||||||
 | 
							loggers.rootLogger.Infow("Initialized store", "store_type", "memory")
 | 
				
			||||||
		s = &store.MemoryStore{}
 | 
							s = &store.MemoryStore{}
 | 
				
			||||||
	case "POSTGRES", "postgres":
 | 
						case "POSTGRES", "postgres":
 | 
				
			||||||
 | 
							pgStartTime := time.Now()
 | 
				
			||||||
 | 
							loggers.rootLogger.Debugw("Initializing store", "store_type", "postgres")
 | 
				
			||||||
		pgStore, err := store.NewPostgresStore(cfg.Store.Postgres.DSN)
 | 
							pgStore, err := store.NewPostgresStore(cfg.Store.Postgres.DSN)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
@@ -67,13 +75,54 @@ func ActionServe(c *cli.Context) error {
 | 
				
			|||||||
		if err := pgStore.InitDB(); err != nil {
 | 
							if err := pgStore.InitDB(); err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		s = pgStore
 | 
							loggers.rootLogger.Infow("Initialized store", "store_type", "postgres", "init_time", time.Since(pgStartTime))
 | 
				
			||||||
 | 
							if cfg.Store.EnableCache {
 | 
				
			||||||
 | 
								loggers.rootLogger.Debugw("Initializing store", "store_type", "cache-postgres")
 | 
				
			||||||
 | 
								startTime := time.Now()
 | 
				
			||||||
 | 
								cachingStore := store.NewCachingStore(pgStore)
 | 
				
			||||||
 | 
								s = cachingStore
 | 
				
			||||||
 | 
								loggers.rootLogger.Infow("Initialized store", "store_type", "cache-postgres", "init_time", time.Since(startTime))
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								s = pgStore
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case "bolt", "BOLT":
 | 
				
			||||||
 | 
							boltStartTime := time.Now()
 | 
				
			||||||
 | 
							loggers.rootLogger.Debugw("Initializing store", "store_type", "bolt")
 | 
				
			||||||
 | 
							boltStore, err := store.NewBBoltStore(cfg.Store.Bolt.DBPath)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							defer boltStore.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							loggers.rootLogger.Infow("Initialized store", "store_type", "bolt", "init_time", time.Since(boltStartTime))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if cfg.Store.EnableCache {
 | 
				
			||||||
 | 
								loggers.rootLogger.Debugw("Initializing store", "store_type", "cache-bolt")
 | 
				
			||||||
 | 
								startTime := time.Now()
 | 
				
			||||||
 | 
								cachingStore := store.NewCachingStore(boltStore)
 | 
				
			||||||
 | 
								s = cachingStore
 | 
				
			||||||
 | 
								loggers.rootLogger.Infow("Initialized store", "store_type", "cache-bolt", "init_time", time.Since(startTime))
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								s = boltStore
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return fmt.Errorf("Invalid store configured")
 | 
							return fmt.Errorf("Invalid store configured")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Setup interrupt handling
 | 
				
			||||||
 | 
						interruptChan := make(chan os.Signal, 1)
 | 
				
			||||||
 | 
						signal.Notify(interruptChan, os.Interrupt)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						rootCtx, rootCancel := context.WithCancel(c.Context)
 | 
				
			||||||
 | 
						defer rootCancel()
 | 
				
			||||||
 | 
						serversCtx, serversCancel := context.WithCancel(rootCtx)
 | 
				
			||||||
 | 
						defer serversCancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Setup metrics collection
 | 
				
			||||||
 | 
						s = store.NewMetricsCollectingStore(rootCtx, s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Setup honeypot
 | 
						// Setup honeypot
 | 
				
			||||||
	hs, err := honeypot.NewHoneypotServer(cfg.Honeypot, s)
 | 
						hs, err := ssh.NewHoneypotServer(cfg.Honeypot, s)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -97,12 +146,59 @@ func ActionServe(c *cli.Context) error {
 | 
				
			|||||||
		web.TLSConfig = tlsConfig
 | 
							web.TLSConfig = tlsConfig
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Setup interrupt handling
 | 
						// Setup portlistener, if configured
 | 
				
			||||||
	interruptChan := make(chan os.Signal, 1)
 | 
						if cfg.Ports.Enable {
 | 
				
			||||||
	signal.Notify(interruptChan, os.Interrupt)
 | 
							portsCtx, cancel := context.WithCancel(rootCtx)
 | 
				
			||||||
 | 
							defer cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rootCtx, rootCancel := context.WithCancel(c.Context)
 | 
							// TODO: Add more stores
 | 
				
			||||||
	serversCtx, serversCancel := context.WithCancel(rootCtx)
 | 
							store := &ports.MemoryStore{}
 | 
				
			||||||
 | 
							portsServer := ports.New(store)
 | 
				
			||||||
 | 
							portsServer.Logger = loggers.portsLogger
 | 
				
			||||||
 | 
							for _, port := range cfg.Ports.TCPPorts {
 | 
				
			||||||
 | 
								portsServer.AddTCPPort(port)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							go func() {
 | 
				
			||||||
 | 
								loggers.rootLogger.Info("Starting ports server")
 | 
				
			||||||
 | 
								if err := portsServer.Start(portsCtx); err != nil {
 | 
				
			||||||
 | 
									loggers.rootLogger.Warnw("Ports server returned error", "err", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}()
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Setup smtp honeypot if enabled
 | 
				
			||||||
 | 
						if cfg.SMTP.Enable {
 | 
				
			||||||
 | 
							honeypot, err := smtp.NewSMTPHoneypot()
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								loggers.rootLogger.Warnw("Error seting up SMTP honeypot", "error", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							honeypot.Addr = cfg.SMTP.Addr
 | 
				
			||||||
 | 
							honeypot.Logger = loggers.smtpLogger
 | 
				
			||||||
 | 
							if cfg.SMTP.EnableMetrics {
 | 
				
			||||||
 | 
								honeypot.Store = smtp.NewMetricsStore(&smtp.DiscardStore{})
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								honeypot.Store = &smtp.DiscardStore{}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Start smtp honeypot
 | 
				
			||||||
 | 
							go func() {
 | 
				
			||||||
 | 
								loggers.rootLogger.Info("Starting SMTP server")
 | 
				
			||||||
 | 
								if err := honeypot.ListenAndServe(); err != nil {
 | 
				
			||||||
 | 
									loggers.rootLogger.Warnw("SMTP server returned error", "error", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Wait for smtp shutdown
 | 
				
			||||||
 | 
							go func() {
 | 
				
			||||||
 | 
								<-serversCtx.Done()
 | 
				
			||||||
 | 
								loggers.rootLogger.Info("SMTP server shutdown started")
 | 
				
			||||||
 | 
								if err := honeypot.Shutdown(); err != nil {
 | 
				
			||||||
 | 
									loggers.rootLogger.Errorw("Error shutting down SMTP server", "error", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								loggers.rootLogger.Info("SMTP server shutdown complete")
 | 
				
			||||||
 | 
							}()
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Handle interrupt
 | 
						// Handle interrupt
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
@@ -114,7 +210,7 @@ func ActionServe(c *cli.Context) error {
 | 
				
			|||||||
	// Start ssh server
 | 
						// Start ssh server
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
		loggers.rootLogger.Info("Starting SSH server")
 | 
							loggers.rootLogger.Info("Starting SSH server")
 | 
				
			||||||
		if err := hs.ListenAndServe(); err != nil && err != ssh.ErrServerClosed {
 | 
							if err := hs.ListenAndServe(); err != nil && err != sshlib.ErrServerClosed {
 | 
				
			||||||
			loggers.rootLogger.Warnw("SSH server returned error", "error", err)
 | 
								loggers.rootLogger.Warnw("SSH server returned error", "error", err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}()
 | 
						}()
 | 
				
			||||||
@@ -127,6 +223,60 @@ func ActionServe(c *cli.Context) error {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}()
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// If run by systemd, enable watchdog and notify ready
 | 
				
			||||||
 | 
						go func() {
 | 
				
			||||||
 | 
							notifyCtx, cancel := context.WithCancel(rootCtx)
 | 
				
			||||||
 | 
							defer cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							_, ok := os.LookupEnv("NOTIFY_SOCKET")
 | 
				
			||||||
 | 
							if !ok {
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							loggers.rootLogger.Info("Systemd notify socket detected. Sending ready and enabling watchdog.")
 | 
				
			||||||
 | 
							ok, err := daemon.SdNotify(false, daemon.SdNotifyReady)
 | 
				
			||||||
 | 
							if !ok {
 | 
				
			||||||
 | 
								loggers.rootLogger.Info("Systemd notify not enabled.")
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								loggers.rootLogger.Warnw("Unable to connect to NOTIFY_SOCKET.", "error", err)
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							loggers.rootLogger.Debug("Sent READY=1 to NOTIFY_SOCKET.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Setup timer
 | 
				
			||||||
 | 
							timeout, err := daemon.SdWatchdogEnabled(false)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								loggers.rootLogger.Warnw("Unable to get watchdog timeout.", "error", err)
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if timeout == 0 {
 | 
				
			||||||
 | 
								loggers.rootLogger.Infow("Systemd watchdog not enabled.")
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							ticker := time.NewTicker(timeout / 2)
 | 
				
			||||||
 | 
							for {
 | 
				
			||||||
 | 
								// TODO: Consider using ctx with deadline to avoid healthcheck taking more time than ticker,
 | 
				
			||||||
 | 
								// which will result in being killed by watchdog.
 | 
				
			||||||
 | 
								healthy := s.IsHealthy()
 | 
				
			||||||
 | 
								select {
 | 
				
			||||||
 | 
								case <-ticker.C:
 | 
				
			||||||
 | 
									if healthy == nil {
 | 
				
			||||||
 | 
										if _, err := daemon.SdNotify(false, daemon.SdNotifyWatchdog); err != nil {
 | 
				
			||||||
 | 
											loggers.rootLogger.Warnw("Error notifying watchdog.", "err", err)
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										continue
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									// TODO: If unhealthy, should we retry healthcheck immediately, otherwise service will most likely get killed by watchdog.
 | 
				
			||||||
 | 
									loggers.rootLogger.Errorw("Store reported not healthy, might get killed by watchdog.", "err", healthy)
 | 
				
			||||||
 | 
								case <-notifyCtx.Done():
 | 
				
			||||||
 | 
									loggers.rootLogger.Debugw("Notify context cancelled.")
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	go func() {
 | 
						go func() {
 | 
				
			||||||
		<-serversCtx.Done()
 | 
							<-serversCtx.Done()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -154,7 +304,6 @@ func ActionServe(c *cli.Context) error {
 | 
				
			|||||||
	<-rootCtx.Done()
 | 
						<-rootCtx.Done()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type loggerCollection struct {
 | 
					type loggerCollection struct {
 | 
				
			||||||
@@ -162,16 +311,30 @@ type loggerCollection struct {
 | 
				
			|||||||
	honeypotLogger  *zap.SugaredLogger
 | 
						honeypotLogger  *zap.SugaredLogger
 | 
				
			||||||
	webAccessLogger *zap.SugaredLogger
 | 
						webAccessLogger *zap.SugaredLogger
 | 
				
			||||||
	webServerLogger *zap.SugaredLogger
 | 
						webServerLogger *zap.SugaredLogger
 | 
				
			||||||
 | 
						portsLogger     *zap.SugaredLogger
 | 
				
			||||||
 | 
						smtpLogger      *zap.SugaredLogger
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func setupLoggers(cfg config.Config) *loggerCollection {
 | 
					func setupLoggers(cfg config.Config) *loggerCollection {
 | 
				
			||||||
	logEncoderCfg := zap.NewProductionEncoderConfig()
 | 
						logEncoderCfg := zap.NewProductionEncoderConfig()
 | 
				
			||||||
	logEncoderCfg.EncodeCaller = func(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) {}
 | 
						logEncoderCfg.EncodeCaller = func(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	level := zap.NewAtomicLevelAt(zap.InfoLevel)
 | 
						var level zap.AtomicLevel
 | 
				
			||||||
 | 
						switch strings.ToUpper(cfg.Honeypot.LogLevel) {
 | 
				
			||||||
 | 
						case "INFO":
 | 
				
			||||||
 | 
							level = zap.NewAtomicLevelAt(zap.InfoLevel)
 | 
				
			||||||
 | 
						case "DEBUG":
 | 
				
			||||||
 | 
							level = zap.NewAtomicLevelAt(zap.DebugLevel)
 | 
				
			||||||
 | 
						case "WARN", "WARNING":
 | 
				
			||||||
 | 
							level = zap.NewAtomicLevelAt(zap.WarnLevel)
 | 
				
			||||||
 | 
						case "ERR", "ERROR":
 | 
				
			||||||
 | 
							level = zap.NewAtomicLevelAt(zap.WarnLevel)
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							level = zap.NewAtomicLevelAt(zap.InfoLevel)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	logEncoderCfg.EncodeLevel = zapcore.CapitalColorLevelEncoder
 | 
						logEncoderCfg.EncodeLevel = zapcore.CapitalColorLevelEncoder
 | 
				
			||||||
	logEncoderCfg.EncodeTime = zapcore.ISO8601TimeEncoder
 | 
						logEncoderCfg.EncodeTime = zapcore.ISO8601TimeEncoder
 | 
				
			||||||
	logEncoderCfg.EncodeDuration = zapcore.NanosDurationEncoder
 | 
						logEncoderCfg.EncodeDuration = zapcore.StringDurationEncoder
 | 
				
			||||||
	rootLoggerCfg := &zap.Config{
 | 
						rootLoggerCfg := &zap.Config{
 | 
				
			||||||
		Level:            level,
 | 
							Level:            level,
 | 
				
			||||||
		OutputPaths:      []string{"stdout"},
 | 
							OutputPaths:      []string{"stdout"},
 | 
				
			||||||
@@ -189,8 +352,9 @@ func setupLoggers(cfg config.Config) *loggerCollection {
 | 
				
			|||||||
		honeypotLogger:  rootLogger.Named("HON").Sugar(),
 | 
							honeypotLogger:  rootLogger.Named("HON").Sugar(),
 | 
				
			||||||
		webAccessLogger: rootLogger.Named("ACC").Sugar(),
 | 
							webAccessLogger: rootLogger.Named("ACC").Sugar(),
 | 
				
			||||||
		webServerLogger: rootLogger.Named("WEB").Sugar(),
 | 
							webServerLogger: rootLogger.Named("WEB").Sugar(),
 | 
				
			||||||
 | 
							portsLogger:     rootLogger.Named("PRT").Sugar(),
 | 
				
			||||||
 | 
							smtpLogger:      rootLogger.Named("SMT").Sugar(),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func getConfig() (config.Config, error) {
 | 
					func getConfig() (config.Config, error) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,16 +13,24 @@ type Config struct {
 | 
				
			|||||||
	Store    StoreConfig    `toml:"Store"`
 | 
						Store    StoreConfig    `toml:"Store"`
 | 
				
			||||||
	Honeypot HoneypotConfig `toml:"Honeypot"`
 | 
						Honeypot HoneypotConfig `toml:"Honeypot"`
 | 
				
			||||||
	Frontend FrontendConfig `toml:"Frontend"`
 | 
						Frontend FrontendConfig `toml:"Frontend"`
 | 
				
			||||||
 | 
						Ports    PortsConfig    `toml:"Ports"`
 | 
				
			||||||
 | 
						SMTP     SMTPConfig     `toml:"SMTP"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
type StoreConfig struct {
 | 
					type StoreConfig struct {
 | 
				
			||||||
	Type     string              `toml:"Type"`
 | 
						Type        string              `toml:"Type"`
 | 
				
			||||||
	Postgres PostgresStoreConfig `toml:"Postgres"`
 | 
						EnableCache bool                `toml:"EnableCache"`
 | 
				
			||||||
 | 
						Postgres    PostgresStoreConfig `toml:"Postgres"`
 | 
				
			||||||
 | 
						Bolt        BoltStoreConfig     `toml:"Bolt"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type PostgresStoreConfig struct {
 | 
					type PostgresStoreConfig struct {
 | 
				
			||||||
	DSN string `toml:"DSN"`
 | 
						DSN string `toml:"DSN"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type BoltStoreConfig struct {
 | 
				
			||||||
 | 
						DBPath string `toml:"DBPath"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type HoneypotConfig struct {
 | 
					type HoneypotConfig struct {
 | 
				
			||||||
	ListenAddr    string  `toml:"ListenAddr"`
 | 
						ListenAddr    string  `toml:"ListenAddr"`
 | 
				
			||||||
	LogLevel      string  `toml:"LogLevel"`
 | 
						LogLevel      string  `toml:"LogLevel"`
 | 
				
			||||||
@@ -31,10 +39,11 @@ type HoneypotConfig struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type FrontendConfig struct {
 | 
					type FrontendConfig struct {
 | 
				
			||||||
	ListenAddr      string                 `toml:"ListenAddr"`
 | 
						ListenAddr             string                 `toml:"ListenAddr"`
 | 
				
			||||||
	LogLevel        string                 `toml:"LogLevel"`
 | 
						LogLevel               string                 `toml:"LogLevel"`
 | 
				
			||||||
	AccessLogEnable bool                   `toml:"AccessLogEnable"`
 | 
						AccessLogEnable        bool                   `toml:"AccessLogEnable"`
 | 
				
			||||||
	Autocert        FrontendAutocertConfig `toml:"Autocert"`
 | 
						AccessLogIgnoreMetrics bool                   `toml:"AccessLogIgnoreMetrics"`
 | 
				
			||||||
 | 
						Autocert               FrontendAutocertConfig `toml:"Autocert"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type FrontendAutocertConfig struct {
 | 
					type FrontendAutocertConfig struct {
 | 
				
			||||||
@@ -45,6 +54,19 @@ type FrontendAutocertConfig struct {
 | 
				
			|||||||
	RedirectHTTP bool     `toml:"RedirectHTTP"`
 | 
						RedirectHTTP bool     `toml:"RedirectHTTP"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type PortsConfig struct {
 | 
				
			||||||
 | 
						Enable   bool     `toml:"Enable"`
 | 
				
			||||||
 | 
						Addr     string   `toml:"Addr"`
 | 
				
			||||||
 | 
						TCPPorts []string `toml:"TCPPorts"`
 | 
				
			||||||
 | 
						UDPPorts []string `toml:"UDPPorts"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type SMTPConfig struct {
 | 
				
			||||||
 | 
						Enable        bool   `toml:"Enable"`
 | 
				
			||||||
 | 
						Addr          string `toml:"Addr"`
 | 
				
			||||||
 | 
						EnableMetrics bool   `toml:"EnableMetrics"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func FromReader(r io.Reader) (Config, error) {
 | 
					func FromReader(r io.Reader) (Config, error) {
 | 
				
			||||||
	var c Config
 | 
						var c Config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -54,6 +76,7 @@ func FromReader(r io.Reader) (Config, error) {
 | 
				
			|||||||
	c.Frontend.ListenAddr = ":8080"
 | 
						c.Frontend.ListenAddr = ":8080"
 | 
				
			||||||
	c.Frontend.LogLevel = "INFO"
 | 
						c.Frontend.LogLevel = "INFO"
 | 
				
			||||||
	c.Frontend.AccessLogEnable = true
 | 
						c.Frontend.AccessLogEnable = true
 | 
				
			||||||
 | 
						c.SMTP.Addr = ":25"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Read from config
 | 
						// Read from config
 | 
				
			||||||
	decoder := toml.NewDecoder(r)
 | 
						decoder := toml.NewDecoder(r)
 | 
				
			||||||
@@ -61,7 +84,7 @@ func FromReader(r io.Reader) (Config, error) {
 | 
				
			|||||||
		return c, fmt.Errorf("unable to parse config: %w", err)
 | 
							return c, fmt.Errorf("unable to parse config: %w", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//c.readEnv()
 | 
						// c.readEnv()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return c, nil
 | 
						return c, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										59
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										59
									
								
								go.mod
									
									
									
									
									
								
							@@ -1,22 +1,49 @@
 | 
				
			|||||||
module github.uio.no/torjus/apiary
 | 
					module git.t-juice.club/torjus/apiary
 | 
				
			||||||
 | 
					
 | 
				
			||||||
go 1.16
 | 
					go 1.18
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require (
 | 
				
			||||||
 | 
						github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
 | 
				
			||||||
 | 
						github.com/emersion/go-smtp v0.15.0
 | 
				
			||||||
 | 
						github.com/fujiwara/shapeio v1.0.0
 | 
				
			||||||
 | 
						github.com/gliderlabs/ssh v0.3.4
 | 
				
			||||||
 | 
						github.com/go-chi/chi/v5 v5.0.7
 | 
				
			||||||
 | 
						github.com/google/uuid v1.3.0
 | 
				
			||||||
 | 
						github.com/jackc/pgx/v4 v4.17.1
 | 
				
			||||||
 | 
						github.com/oschwald/maxminddb-golang v1.10.0
 | 
				
			||||||
 | 
						github.com/pelletier/go-toml v1.9.5
 | 
				
			||||||
 | 
						github.com/prometheus/client_golang v1.13.0
 | 
				
			||||||
 | 
						github.com/urfave/cli/v2 v2.11.2
 | 
				
			||||||
 | 
						go.etcd.io/bbolt v1.3.6
 | 
				
			||||||
 | 
						go.uber.org/zap v1.23.0
 | 
				
			||||||
 | 
						golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require (
 | 
					require (
 | 
				
			||||||
	github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
 | 
						github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
 | 
				
			||||||
	github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
 | 
						github.com/beorn7/perks v1.0.1 // indirect
 | 
				
			||||||
	github.com/fujiwara/shapeio v1.0.0
 | 
						github.com/cespare/xxhash/v2 v2.1.2 // indirect
 | 
				
			||||||
	github.com/gliderlabs/ssh v0.3.2
 | 
						github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
 | 
				
			||||||
	github.com/go-chi/chi/v5 v5.0.2
 | 
						github.com/emersion/go-sasl v0.0.0-20211008083017-0b9dcfb154ac // indirect
 | 
				
			||||||
	github.com/google/uuid v1.2.0
 | 
						github.com/golang/protobuf v1.5.2 // indirect
 | 
				
			||||||
	github.com/jackc/pgx/v4 v4.11.0
 | 
						github.com/jackc/chunkreader/v2 v2.0.1 // indirect
 | 
				
			||||||
	github.com/oschwald/maxminddb-golang v1.8.0
 | 
						github.com/jackc/pgconn v1.13.0 // indirect
 | 
				
			||||||
	github.com/pelletier/go-toml v1.9.0
 | 
						github.com/jackc/pgio v1.0.0 // indirect
 | 
				
			||||||
 | 
						github.com/jackc/pgpassfile v1.0.0 // indirect
 | 
				
			||||||
 | 
						github.com/jackc/pgproto3/v2 v2.3.1 // indirect
 | 
				
			||||||
 | 
						github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
 | 
				
			||||||
 | 
						github.com/jackc/pgtype v1.12.0 // indirect
 | 
				
			||||||
 | 
						github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
 | 
				
			||||||
 | 
						github.com/prometheus/client_model v0.2.0 // indirect
 | 
				
			||||||
 | 
						github.com/prometheus/common v0.37.0 // indirect
 | 
				
			||||||
 | 
						github.com/prometheus/procfs v0.8.0 // indirect
 | 
				
			||||||
	github.com/russross/blackfriday/v2 v2.1.0 // indirect
 | 
						github.com/russross/blackfriday/v2 v2.1.0 // indirect
 | 
				
			||||||
	github.com/stretchr/testify v1.7.0 // indirect
 | 
						github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
 | 
				
			||||||
	github.com/urfave/cli/v2 v2.3.0
 | 
						go.uber.org/atomic v1.10.0 // indirect
 | 
				
			||||||
	go.uber.org/zap v1.13.0
 | 
						go.uber.org/multierr v1.8.0 // indirect
 | 
				
			||||||
	golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
 | 
						golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect
 | 
				
			||||||
	golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1 // indirect
 | 
						golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
 | 
				
			||||||
	golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
 | 
						golang.org/x/text v0.3.7 // indirect
 | 
				
			||||||
 | 
						golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
 | 
				
			||||||
 | 
						google.golang.org/protobuf v1.28.1 // indirect
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										678
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										678
									
								
								go.sum
									
									
									
									
									
								
							@@ -1,142 +1,163 @@
 | 
				
			|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 | 
					cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 | 
				
			||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 | 
					cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 | 
				
			||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
 | 
					cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
 | 
				
			||||||
 | 
					cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
 | 
				
			||||||
 | 
					cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
 | 
				
			||||||
 | 
					cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
 | 
				
			||||||
 | 
					cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
 | 
				
			||||||
 | 
					cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
 | 
				
			||||||
 | 
					cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
 | 
				
			||||||
 | 
					cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
 | 
				
			||||||
 | 
					cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
 | 
				
			||||||
 | 
					cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
 | 
				
			||||||
 | 
					cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
 | 
				
			||||||
 | 
					cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
 | 
				
			||||||
 | 
					cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
 | 
				
			||||||
 | 
					cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
 | 
				
			||||||
 | 
					cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
 | 
				
			||||||
 | 
					cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
 | 
				
			||||||
 | 
					cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
 | 
				
			||||||
 | 
					cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
 | 
				
			||||||
 | 
					cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
 | 
				
			||||||
 | 
					dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 | 
				
			||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 | 
					github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 | 
				
			||||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
 | 
					github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 | 
				
			||||||
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
 | 
					github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
 | 
				
			||||||
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
 | 
					github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
 | 
				
			||||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
 | 
					 | 
				
			||||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
 | 
					 | 
				
			||||||
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
 | 
					 | 
				
			||||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
 | 
					 | 
				
			||||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 | 
					github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 | 
				
			||||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 | 
					github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 | 
				
			||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 | 
					github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 | 
				
			||||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 | 
					github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 | 
				
			||||||
 | 
					github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
 | 
				
			||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
 | 
				
			||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
 | 
				
			||||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 | 
					github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
 | 
				
			||||||
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 | 
					 | 
				
			||||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
 | 
					 | 
				
			||||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
 | 
					 | 
				
			||||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
 | 
					 | 
				
			||||||
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
 | 
					 | 
				
			||||||
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
 | 
					 | 
				
			||||||
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
 | 
					 | 
				
			||||||
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
 | 
					 | 
				
			||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 | 
					github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 | 
				
			||||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 | 
					github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 | 
				
			||||||
 | 
					github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 | 
				
			||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 | 
					github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 | 
				
			||||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
 | 
					 | 
				
			||||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
 | 
					 | 
				
			||||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
 | 
					 | 
				
			||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 | 
					github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 | 
				
			||||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 | 
					github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 | 
				
			||||||
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
 | 
					github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
 | 
				
			||||||
 | 
					github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 | 
				
			||||||
 | 
					github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 | 
				
			||||||
 | 
					github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 | 
				
			||||||
 | 
					github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
 | 
				
			||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 | 
					github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 | 
				
			||||||
 | 
					github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
 | 
				
			||||||
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
 | 
					github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
 | 
				
			||||||
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
 | 
					github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
 | 
				
			||||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
 | 
					 | 
				
			||||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
 | 
					 | 
				
			||||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
 | 
					 | 
				
			||||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
					 | 
				
			||||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
					github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
				
			||||||
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
					github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
				
			||||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
 | 
					github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
 | 
				
			||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 | 
					github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 | 
				
			||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
 | 
					github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
 | 
				
			||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 | 
					github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 | 
				
			||||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
 | 
					github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
					github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 | 
					github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
					github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 | 
					 | 
				
			||||||
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 | 
					 | 
				
			||||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
 | 
					github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
 | 
				
			||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 | 
					github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 | 
				
			||||||
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
 | 
					github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
 | 
				
			||||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
 | 
					github.com/emersion/go-sasl v0.0.0-20211008083017-0b9dcfb154ac h1:tn/OQ2PmwQ0XFVgAHfjlLyqMewry25Rz7jWnVoh4Ggs=
 | 
				
			||||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
 | 
					github.com/emersion/go-sasl v0.0.0-20211008083017-0b9dcfb154ac/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
 | 
				
			||||||
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
 | 
					github.com/emersion/go-smtp v0.15.0 h1:3+hMGMGrqP/lqd7qoxZc1hTU8LY8gHV9RFGWlqSDmP8=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
 | 
					github.com/emersion/go-smtp v0.15.0/go.mod h1:qm27SGYgoIPRot6ubfQ/GpiPy/g3PaZAVRxiO/sDUgQ=
 | 
				
			||||||
 | 
					github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
					github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
				
			||||||
 | 
					github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
 | 
				
			||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 | 
					github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 | 
				
			||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 | 
					 | 
				
			||||||
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
 | 
					 | 
				
			||||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
 | 
					 | 
				
			||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 | 
					 | 
				
			||||||
github.com/fujiwara/shapeio v1.0.0 h1:xG5D9oNqCSUUbryZ/jQV3cqe1v2suEjwPIcEg1gKM8M=
 | 
					github.com/fujiwara/shapeio v1.0.0 h1:xG5D9oNqCSUUbryZ/jQV3cqe1v2suEjwPIcEg1gKM8M=
 | 
				
			||||||
github.com/fujiwara/shapeio v1.0.0/go.mod h1:LmEmu6L/8jetyj1oewewFb7bZCNRwE7wLCUNzDLaLVA=
 | 
					github.com/fujiwara/shapeio v1.0.0/go.mod h1:LmEmu6L/8jetyj1oewewFb7bZCNRwE7wLCUNzDLaLVA=
 | 
				
			||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 | 
					github.com/gliderlabs/ssh v0.3.4 h1:+AXBtim7MTKaLVPgvE+3mhewYRawNLTd+jEEz/wExZw=
 | 
				
			||||||
github.com/gliderlabs/ssh v0.3.2 h1:gcfd1Aj/9RQxvygu4l3sak711f/5+VOwBw9C/7+N4EI=
 | 
					github.com/gliderlabs/ssh v0.3.4/go.mod h1:ZSS+CUoKHDrqVakTfTWUlKSr9MtMFkC4UvtQKD7O914=
 | 
				
			||||||
github.com/gliderlabs/ssh v0.3.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
 | 
					github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8=
 | 
				
			||||||
github.com/go-chi/chi/v5 v5.0.2 h1:4xKeALZdMEsuI5s05PU2Bm89Uc5iM04qFubUCl5LfAQ=
 | 
					github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
 | 
				
			||||||
github.com/go-chi/chi/v5 v5.0.2/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
 | 
					github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 | 
				
			||||||
 | 
					github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
				
			||||||
 | 
					github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
				
			||||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
					github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
				
			||||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
					github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 | 
				
			||||||
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
 | 
					github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
 | 
				
			||||||
 | 
					github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
 | 
				
			||||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
 | 
					github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
 | 
				
			||||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
 | 
					github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
 | 
				
			||||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
 | 
					github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
 | 
				
			||||||
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
 | 
					github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
 | 
				
			||||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 | 
					github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 | 
				
			||||||
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
 | 
					github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
 | 
				
			||||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
 | 
					github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
 | 
				
			||||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
 | 
					 | 
				
			||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 | 
					github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 | 
				
			||||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 | 
					 | 
				
			||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
 | 
					 | 
				
			||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 | 
					github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
 | 
					github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
 | 
					github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
				
			||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 | 
					github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 | 
				
			||||||
 | 
					github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 | 
				
			||||||
 | 
					github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
 | 
				
			||||||
 | 
					github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 | 
				
			||||||
 | 
					github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 | 
				
			||||||
 | 
					github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 | 
				
			||||||
 | 
					github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
 | 
				
			||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
					github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
				
			||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
					github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
				
			||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
					github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
				
			||||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 | 
					github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
 | 
				
			||||||
 | 
					github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 | 
				
			||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 | 
					github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 | 
				
			||||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 | 
					github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 | 
				
			||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
 | 
					github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
 | 
				
			||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 | 
					github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 | 
				
			||||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 | 
					github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
 | 
					github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
 | 
				
			||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 | 
					github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 | 
				
			||||||
 | 
					github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 | 
				
			||||||
 | 
					github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
				
			||||||
 | 
					github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
				
			||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 | 
					github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 | 
				
			||||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 | 
					github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
 | 
				
			||||||
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
 | 
					github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 | 
				
			||||||
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 | 
					github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
 | 
				
			||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 | 
					github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
 | 
				
			||||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
 | 
					 | 
				
			||||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 | 
					 | 
				
			||||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 | 
					 | 
				
			||||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
 | 
					 | 
				
			||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
 | 
					 | 
				
			||||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
 | 
					 | 
				
			||||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
 | 
					 | 
				
			||||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
 | 
					 | 
				
			||||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
 | 
					 | 
				
			||||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
 | 
					 | 
				
			||||||
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
 | 
					 | 
				
			||||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
 | 
					 | 
				
			||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 | 
					github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 | 
				
			||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 | 
					github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 | 
				
			||||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
 | 
					github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
				
			||||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
 | 
					 | 
				
			||||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
 | 
					 | 
				
			||||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
 | 
					 | 
				
			||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 | 
					 | 
				
			||||||
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
 | 
					 | 
				
			||||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 | 
					 | 
				
			||||||
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
 | 
					 | 
				
			||||||
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
 | 
					 | 
				
			||||||
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
 | 
					github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
 | 
				
			||||||
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
 | 
					github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
 | 
				
			||||||
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
 | 
					github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
 | 
				
			||||||
@@ -144,61 +165,59 @@ github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgO
 | 
				
			|||||||
github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA=
 | 
					github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA=
 | 
				
			||||||
github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE=
 | 
					github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE=
 | 
				
			||||||
github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s=
 | 
					github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s=
 | 
				
			||||||
github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk=
 | 
					github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o=
 | 
				
			||||||
github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
 | 
					github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY=
 | 
				
			||||||
github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
 | 
					github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI=
 | 
				
			||||||
github.com/jackc/pgconn v1.8.1 h1:ySBX7Q87vOMqKU2bbmKbUvtYhauDFclYbNDYIE1/h6s=
 | 
					github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys=
 | 
				
			||||||
github.com/jackc/pgconn v1.8.1/go.mod h1:JV6m6b6jhjdmzchES0drzCcYcAHS1OPD5xu3OZ/lE2g=
 | 
					github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI=
 | 
				
			||||||
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
 | 
					github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
 | 
				
			||||||
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
 | 
					github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
 | 
				
			||||||
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA=
 | 
					 | 
				
			||||||
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
 | 
					github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
 | 
				
			||||||
 | 
					github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c=
 | 
				
			||||||
 | 
					github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc=
 | 
				
			||||||
 | 
					github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak=
 | 
				
			||||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
 | 
					github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
 | 
				
			||||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
 | 
					github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
 | 
				
			||||||
github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
 | 
					 | 
				
			||||||
github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
 | 
					github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
					github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
					 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.6 h1:b1105ZGEMFe7aCvrT1Cca3VoVb4ZFMaFJLJcg/3zD+8=
 | 
					 | 
				
			||||||
github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
					github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
				
			||||||
github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
 | 
					github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
				
			||||||
 | 
					github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y=
 | 
				
			||||||
 | 
					github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
 | 
				
			||||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
 | 
					github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
 | 
				
			||||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
 | 
					github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
 | 
				
			||||||
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
 | 
					github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
 | 
				
			||||||
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
 | 
					github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
 | 
				
			||||||
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
 | 
					github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
 | 
				
			||||||
github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0=
 | 
					github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM=
 | 
				
			||||||
github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po=
 | 
					github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w=
 | 
				
			||||||
github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ=
 | 
					github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
 | 
				
			||||||
github.com/jackc/pgtype v1.7.0 h1:6f4kVsW01QftE38ufBYxKciO6gyioXSC0ABIRLcZrGs=
 | 
					 | 
				
			||||||
github.com/jackc/pgtype v1.7.0/go.mod h1:ZnHF+rMePVqDKaOfJVI4Q8IVvAQMryDlDkZnKOI75BE=
 | 
					 | 
				
			||||||
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
 | 
					github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
 | 
					github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
 | 
					github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA=
 | 
					github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o=
 | 
					github.com/jackc/pgx/v4 v4.17.1 h1:tASdE79tX9LOQu3MMvioWT6YaZkf58ZhmLHhV4sv5WM=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg=
 | 
					github.com/jackc/pgx/v4 v4.17.1/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw=
 | 
				
			||||||
github.com/jackc/pgx/v4 v4.11.0 h1:J86tSWd3Y7nKjwT/43xZBvpi04keQWx8gNC2YkdJhZI=
 | 
					 | 
				
			||||||
github.com/jackc/pgx/v4 v4.11.0/go.mod h1:i62xJgdrtVDsnL3U8ekyrQXEwGNTRoG7/8r+CIdYfcc=
 | 
					 | 
				
			||||||
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					 | 
				
			||||||
github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					 | 
				
			||||||
github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
					github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
 | 
					github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
 | 
				
			||||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
 | 
					github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
 | 
				
			||||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 | 
					github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 | 
				
			||||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
					github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
				
			||||||
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
					github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
				
			||||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
 | 
					github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
 | 
				
			||||||
 | 
					github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
 | 
				
			||||||
 | 
					github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
 | 
				
			||||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
 | 
					github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
 | 
				
			||||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
 | 
					github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
 | 
				
			||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 | 
					github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 | 
				
			||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 | 
					github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 | 
				
			||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 | 
					github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 | 
				
			||||||
 | 
					github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 | 
				
			||||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
 | 
					github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
 | 
				
			||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 | 
					github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 | 
				
			||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 | 
					github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 | 
				
			||||||
@@ -207,303 +226,430 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 | 
				
			|||||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
				
			||||||
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
 | 
					github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
 | 
				
			||||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 | 
					github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 | 
				
			||||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
 | 
					 | 
				
			||||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
 | 
					 | 
				
			||||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
 | 
					 | 
				
			||||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 | 
					 | 
				
			||||||
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
 | 
					github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
 | 
				
			||||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
 | 
					 | 
				
			||||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
 | 
					github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 | 
					 | 
				
			||||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 | 
					 | 
				
			||||||
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
 | 
					github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
 | 
					github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
 | 
					 | 
				
			||||||
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
 | 
					 | 
				
			||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
					github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
 | 
					github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 | 
				
			||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 | 
					github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 | 
				
			||||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
 | 
					 | 
				
			||||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
 | 
					 | 
				
			||||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 | 
					 | 
				
			||||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
 | 
					 | 
				
			||||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
 | 
					 | 
				
			||||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
 | 
					 | 
				
			||||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 | 
					 | 
				
			||||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 | 
					 | 
				
			||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 | 
					github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 | 
				
			||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 | 
					github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 | 
				
			||||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 | 
					github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 | 
				
			||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 | 
					github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 | 
				
			||||||
 | 
					github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
 | 
				
			||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
					github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
				
			||||||
github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
 | 
					github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 | 
				
			||||||
github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
 | 
					github.com/oschwald/maxminddb-golang v1.10.0 h1:Xp1u0ZhqkSuopaKmk1WwHtjF0H9Hd9181uj2MQ5Vndg=
 | 
				
			||||||
github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
 | 
					github.com/oschwald/maxminddb-golang v1.10.0/go.mod h1:Y2ELenReaLAZ0b400URyGwvYxHV1dLIxBuyOsyYjHK0=
 | 
				
			||||||
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
 | 
					github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
 | 
				
			||||||
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
 | 
					github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 | 
				
			||||||
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
 | 
					 | 
				
			||||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
 | 
					 | 
				
			||||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
 | 
					 | 
				
			||||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
 | 
					 | 
				
			||||||
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
 | 
					 | 
				
			||||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 | 
					 | 
				
			||||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 | 
					 | 
				
			||||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 | 
					 | 
				
			||||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
 | 
					 | 
				
			||||||
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
 | 
					 | 
				
			||||||
github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
 | 
					 | 
				
			||||||
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 | 
					 | 
				
			||||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 | 
					 | 
				
			||||||
github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA=
 | 
					 | 
				
			||||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 | 
					 | 
				
			||||||
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
 | 
					 | 
				
			||||||
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
 | 
					 | 
				
			||||||
github.com/oschwald/maxminddb-golang v1.8.0 h1:Uh/DSnGoxsyp/KYbY1AuP0tYEwfs0sCph9p/UMXK/Hk=
 | 
					 | 
				
			||||||
github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis=
 | 
					 | 
				
			||||||
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
 | 
					 | 
				
			||||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 | 
					 | 
				
			||||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
 | 
					 | 
				
			||||||
github.com/pelletier/go-toml v1.9.0 h1:NOd0BRdOKpPf0SxkL3HxSQOG7rNh+4kl6PHcBPFs7Q0=
 | 
					 | 
				
			||||||
github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 | 
					 | 
				
			||||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
 | 
					 | 
				
			||||||
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
 | 
					 | 
				
			||||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
 | 
					 | 
				
			||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
					github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
				
			||||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
 | 
					 | 
				
			||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
					github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
				
			||||||
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
 | 
					github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 | 
				
			||||||
 | 
					github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 | 
					github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
					github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
				
			||||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
 | 
					 | 
				
			||||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
 | 
					github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
 | 
				
			||||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
 | 
					 | 
				
			||||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
 | 
					github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
 | 
				
			||||||
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
 | 
					github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
 | 
				
			||||||
 | 
					github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
 | 
				
			||||||
 | 
					github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
 | 
				
			||||||
 | 
					github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU=
 | 
				
			||||||
 | 
					github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 | 
					github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 | 
					 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
 | 
				
			||||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
					github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
				
			||||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
					github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
 | 
				
			||||||
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
 | 
					github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
 | 
				
			||||||
 | 
					github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
 | 
				
			||||||
 | 
					github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
 | 
				
			||||||
 | 
					github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
 | 
				
			||||||
 | 
					github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
					github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 | 
					 | 
				
			||||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
					github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
 | 
				
			||||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
 | 
					github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
 | 
				
			||||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
 | 
					github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
 | 
				
			||||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
 | 
					github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
 | 
				
			||||||
 | 
					github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
 | 
				
			||||||
 | 
					github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
 | 
				
			||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 | 
					github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 | 
				
			||||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
 | 
					github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
 | 
				
			||||||
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
 | 
					github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
 | 
				
			||||||
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
 | 
					github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
 | 
				
			||||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
					 | 
				
			||||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
 | 
					github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
 | 
				
			||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
					github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
				
			||||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
 | 
					 | 
				
			||||||
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
 | 
					 | 
				
			||||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 | 
					github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 | 
				
			||||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 | 
					 | 
				
			||||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 | 
					github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 | 
				
			||||||
github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc h1:jUIKcSPO9MoMJBbEoyE/RJoE8vz7Mb8AjvifMMwSyvY=
 | 
					github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
 | 
				
			||||||
github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
 | 
					github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
 | 
				
			||||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 | 
					 | 
				
			||||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 | 
					github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 | 
				
			||||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
 | 
					github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
 | 
				
			||||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
 | 
					github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
 | 
				
			||||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
 | 
					github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
 | 
				
			||||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
 | 
					 | 
				
			||||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
 | 
					 | 
				
			||||||
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
 | 
					 | 
				
			||||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
 | 
					 | 
				
			||||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 | 
					 | 
				
			||||||
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
 | 
					 | 
				
			||||||
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
 | 
					 | 
				
			||||||
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
 | 
					 | 
				
			||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
					github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
					github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 | 
					github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 | 
				
			||||||
 | 
					github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 | 
				
			||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 | 
					github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 | 
				
			||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 | 
					github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 | 
				
			||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 | 
					github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 | 
				
			||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
 | 
					github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
 | 
				
			||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
					 | 
				
			||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
 | 
					 | 
				
			||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
					github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
				
			||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 | 
					github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
				
			||||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
 | 
					github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
 | 
				
			||||||
github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY=
 | 
					github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 | 
				
			||||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
 | 
					github.com/urfave/cli/v2 v2.11.2 h1:FVfNg4m3vbjbBpLYxW//WjxUoHvJ9TlppXcqY9Q9ZfA=
 | 
				
			||||||
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
 | 
					github.com/urfave/cli/v2 v2.11.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
 | 
				
			||||||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
 | 
					github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
 | 
				
			||||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
 | 
					github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
 | 
				
			||||||
 | 
					github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
				
			||||||
 | 
					github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
				
			||||||
 | 
					github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
				
			||||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 | 
					github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 | 
				
			||||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 | 
					go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
 | 
				
			||||||
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
 | 
					go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
 | 
				
			||||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 | 
					go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 | 
				
			||||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 | 
					go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 | 
				
			||||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
					go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
				
			||||||
 | 
					go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
				
			||||||
 | 
					go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
				
			||||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
					go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
				
			||||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
					go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 | 
				
			||||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
					go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
				
			||||||
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
 | 
					 | 
				
			||||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
					go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 | 
				
			||||||
 | 
					go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 | 
				
			||||||
 | 
					go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
 | 
				
			||||||
 | 
					go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
 | 
				
			||||||
 | 
					go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
 | 
				
			||||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 | 
					go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 | 
				
			||||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
 | 
					go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
 | 
				
			||||||
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
 | 
					 | 
				
			||||||
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 | 
					go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 | 
				
			||||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
 | 
					go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
 | 
				
			||||||
 | 
					go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
 | 
				
			||||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
 | 
					go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
 | 
				
			||||||
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
					go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
				
			||||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
					go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 | 
				
			||||||
go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU=
 | 
					 | 
				
			||||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
 | 
					go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
 | 
				
			||||||
 | 
					go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY=
 | 
				
			||||||
 | 
					go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 | 
					golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 | 
					golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
 | 
					golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
					golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
 | 
					golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 | 
					golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d h1:3qF+Z8Hkrw9sOhrFHti9TlB1Hkac1x+DNRkv0XQiFjo=
 | 
				
			||||||
 | 
					golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 | 
				
			||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 | 
					golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
 | 
				
			||||||
 | 
					golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
 | 
				
			||||||
 | 
					golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
 | 
				
			||||||
 | 
					golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
 | 
				
			||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 | 
					golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 | 
				
			||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
 | 
					golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
 | 
				
			||||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 | 
					golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 | 
				
			||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
					golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
				
			||||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
 | 
					golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
				
			||||||
 | 
					golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
				
			||||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
					golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
				
			||||||
 | 
					golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
 | 
				
			||||||
 | 
					golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
 | 
				
			||||||
 | 
					golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
 | 
				
			||||||
 | 
					golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
 | 
				
			||||||
 | 
					golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
 | 
				
			||||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
 | 
					golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
 | 
				
			||||||
 | 
					golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
 | 
				
			||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
 | 
					golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
 | 
				
			||||||
 | 
					golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
 | 
				
			||||||
 | 
					golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 | 
				
			||||||
 | 
					golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 | 
				
			||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
 | 
					golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 | 
				
			||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 | 
					golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 | 
				
			||||||
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1 h1:4qWs8cYYH6PoEFy4dfhDFgoMGkwAcETd+MmPdCPMzUc=
 | 
					golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
				
			||||||
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
 | 
					golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY=
 | 
				
			||||||
 | 
					golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
					golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
					golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
				
			||||||
 | 
					golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
				
			||||||
 | 
					golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
				
			||||||
 | 
					golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
				
			||||||
 | 
					golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 | 
				
			||||||
 | 
					golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
 | 
					golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
 | 
					golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
 | 
					golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
 | 
					golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY=
 | 
				
			||||||
 | 
					golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
 | 
					golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 | 
				
			||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 | 
					golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 | 
				
			||||||
 | 
					golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
 | 
				
			||||||
 | 
					golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 | 
				
			||||||
 | 
					golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
				
			||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
					golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
				
			||||||
 | 
					golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
				
			||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 | 
					golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 | 
				
			||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
 | 
					golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
 | 
				
			||||||
 | 
					golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 | 
				
			||||||
 | 
					golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
 | 
					golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE=
 | 
					 | 
				
			||||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
 | 
					golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
					golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
					golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
					golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
					golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
					golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
					golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE=
 | 
					golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 | 
				
			||||||
 | 
					golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
 | 
					golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
 | 
					google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
 | 
				
			||||||
 | 
					google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
 | 
				
			||||||
 | 
					google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
 | 
				
			||||||
 | 
					google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
 | 
				
			||||||
 | 
					google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
 | 
				
			||||||
 | 
					google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
 | 
				
			||||||
 | 
					google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
 | 
				
			||||||
 | 
					google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
 | 
				
			||||||
 | 
					google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
 | 
				
			||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 | 
					google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 | 
				
			||||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
				
			||||||
 | 
					google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
				
			||||||
 | 
					google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
 | 
				
			||||||
 | 
					google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 | 
				
			||||||
 | 
					google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 | 
					google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
 | 
					google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
					google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
				
			||||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
 | 
					google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
				
			||||||
 | 
					google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
				
			||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 | 
					google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 | 
				
			||||||
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 | 
					google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 | 
				
			||||||
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 | 
					google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 | 
				
			||||||
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
					google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
				
			||||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
					google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
 | 
				
			||||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
					google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
 | 
				
			||||||
 | 
					google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
 | 
				
			||||||
 | 
					google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 | 
				
			||||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 | 
					gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 | 
				
			||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
					gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
					gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
 | 
					gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 | 
					gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 | 
				
			||||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 | 
					 | 
				
			||||||
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
 | 
					 | 
				
			||||||
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
 | 
					gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
 | 
				
			||||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
 | 
					 | 
				
			||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
 | 
					 | 
				
			||||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
 | 
					 | 
				
			||||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
 | 
					 | 
				
			||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
					gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
					gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
					gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
 | 
					gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
					gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
 | 
					honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
 | 
					honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
				
			||||||
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 | 
					honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 | 
				
			||||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
 | 
					honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
				
			||||||
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
 | 
					honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
				
			||||||
 | 
					rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 | 
				
			||||||
 | 
					rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 | 
				
			||||||
 | 
					rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										71
									
								
								honeypot/ports/postgresstore.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								honeypot/ports/postgresstore.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
				
			|||||||
 | 
					package ports
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"database/sql"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						_ "github.com/jackc/pgx/v4/stdlib"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const DBSchema = `
 | 
				
			||||||
 | 
					CREATE TABLE IF NOT EXISTS port_attempts(
 | 
				
			||||||
 | 
						id serial PRIMARY KEY,
 | 
				
			||||||
 | 
						date timestamptz,
 | 
				
			||||||
 | 
						remote_ip inet,
 | 
				
			||||||
 | 
						port varchar(5)
 | 
				
			||||||
 | 
					);`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type PostgresStore struct {
 | 
				
			||||||
 | 
						db *sql.DB
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewPostgresStore(dsn string) (*PostgresStore, error) {
 | 
				
			||||||
 | 
						db, err := sql.Open("pgx", dsn)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						s := &PostgresStore{db: db}
 | 
				
			||||||
 | 
						return s, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *PostgresStore) InitDB() error {
 | 
				
			||||||
 | 
						_, err := s.db.Exec(DBSchema)
 | 
				
			||||||
 | 
						return err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *PostgresStore) Add(attempt *ConnectionAttempt) error {
 | 
				
			||||||
 | 
						stmt := `INSERT INTO port_attempts(date, remote_ip, port)
 | 
				
			||||||
 | 
						VALUES ($1, $2, $3)`
 | 
				
			||||||
 | 
						tx, err := s.db.Begin()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						defer tx.Rollback() // nolint: errcheck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						_, err = tx.Exec(stmt, time.Now(), attempt.From, attempt.Port)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return tx.Commit()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *PostgresStore) List() ([]*ConnectionAttempt, error) {
 | 
				
			||||||
 | 
						stmt := `SELECT remote_ip, port FROM port_attempts`
 | 
				
			||||||
 | 
						rows, err := s.db.Query(stmt)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						defer rows.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var attempts []*ConnectionAttempt
 | 
				
			||||||
 | 
						for rows.Next() {
 | 
				
			||||||
 | 
							var a ConnectionAttempt
 | 
				
			||||||
 | 
							if err := rows.Scan(&a.From, &a.Port); err != nil {
 | 
				
			||||||
 | 
								return nil, err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							attempts = append(attempts, &a)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return attempts, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										102
									
								
								honeypot/ports/server.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								honeypot/ports/server.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,102 @@
 | 
				
			|||||||
 | 
					package ports
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"net"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"go.uber.org/zap"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Server struct {
 | 
				
			||||||
 | 
						EnabledPortsTCP []string
 | 
				
			||||||
 | 
						EnabledPortsUDP []string
 | 
				
			||||||
 | 
						IP              string
 | 
				
			||||||
 | 
						Logger          *zap.SugaredLogger
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						store Store
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func New(store Store) *Server {
 | 
				
			||||||
 | 
						return &Server{store: store, Logger: zap.NewNop().Sugar()}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *Server) Start(ctx context.Context) error {
 | 
				
			||||||
 | 
						for _, port := range s.EnabledPortsTCP {
 | 
				
			||||||
 | 
							portCtx, cancel := context.WithCancel(ctx)
 | 
				
			||||||
 | 
							go func() {
 | 
				
			||||||
 | 
								if err := s.doListenTCP(portCtx, port); err != nil {
 | 
				
			||||||
 | 
									s.Logger.Errorw("Unable to listen to port.", "err", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}()
 | 
				
			||||||
 | 
							defer cancel()
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						<-ctx.Done()
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *Server) AddTCPPort(port string) {
 | 
				
			||||||
 | 
						s.EnabledPortsTCP = append(s.EnabledPortsTCP, port)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *Server) doListenTCP(ctx context.Context, port string) error {
 | 
				
			||||||
 | 
						lAddr, err := net.ResolveTCPAddr("tcp", net.JoinHostPort(s.IP, port))
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							s.Logger.Warnw("Error resoling listening addr.", "network", "tcp", "port", port)
 | 
				
			||||||
 | 
							return fmt.Errorf("error resolving listening address: %w", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						listener, err := net.ListenTCP("tcp", lAddr)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return fmt.Errorf("error starting listener: %w", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						defer listener.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						go func() {
 | 
				
			||||||
 | 
							<-ctx.Done()
 | 
				
			||||||
 | 
							s.Logger.Debug("Listener context cancelled.")
 | 
				
			||||||
 | 
							listener.Close()
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						s.Logger.Infow("Listening for connections to TCP port.", "port", port)
 | 
				
			||||||
 | 
						for {
 | 
				
			||||||
 | 
							conn, err := listener.Accept()
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								select {
 | 
				
			||||||
 | 
								case <-ctx.Done():
 | 
				
			||||||
 | 
									s.Logger.Infow("Listener shutting down.", "port", port, "network", "tcp")
 | 
				
			||||||
 | 
									return nil
 | 
				
			||||||
 | 
								default:
 | 
				
			||||||
 | 
									s.Logger.Infow("Error accepting connection.", "error", err)
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							s.Logger.Infow("Got connection on port.", "port", port, "network", "tcp", "remote_addr", conn.RemoteAddr().String())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if err := conn.SetReadDeadline(time.Now().Add(time.Second * 15)); err != nil {
 | 
				
			||||||
 | 
								s.Logger.Warnw("Error setting connection read deadline.", "err", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							buf := make([]byte, 256)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							_, err = conn.Read(buf)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								buf = []byte{}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							attempt := &ConnectionAttempt{
 | 
				
			||||||
 | 
								Port:    port,
 | 
				
			||||||
 | 
								Network: "tcp",
 | 
				
			||||||
 | 
								From:    conn.RemoteAddr().String(),
 | 
				
			||||||
 | 
								Data:    buf,
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							conn.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if err := s.store.Add(attempt); err != nil {
 | 
				
			||||||
 | 
								s.Logger.Warnw("Error storing attempt in store.", "error", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										46
									
								
								honeypot/ports/server_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								honeypot/ports/server_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					// nolint: errcheck
 | 
				
			||||||
 | 
					package ports_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"net"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ports"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestServer(t *testing.T) {
 | 
				
			||||||
 | 
						ctx, cancel := context.WithCancel(context.Background())
 | 
				
			||||||
 | 
						defer cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						store := &ports.MemoryStore{}
 | 
				
			||||||
 | 
						server := ports.New(store)
 | 
				
			||||||
 | 
						server.IP = "127.0.0.1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						server.AddTCPPort("2555")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						go server.Start(ctx)
 | 
				
			||||||
 | 
						time.Sleep(1 * time.Second)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						rAddr, err := net.ResolveTCPAddr("tcp", net.JoinHostPort(server.IP, "2555"))
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error resolving remote address: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						conn, err := net.DialTCP("tcp", nil, rAddr)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Dialing server returned error: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						conn.Write([]byte("LOL"))
 | 
				
			||||||
 | 
						conn.Close()
 | 
				
			||||||
 | 
						time.Sleep(1 * time.Second)
 | 
				
			||||||
 | 
						cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						attempts, err := store.List()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Getting attempts from store returned error: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if len(attempts) != 1 {
 | 
				
			||||||
 | 
							t.Fatalf("Wrong amount of attempts in store: %d", len(attempts))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										26
									
								
								honeypot/ports/store.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								honeypot/ports/store.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					package ports
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type ConnectionAttempt struct {
 | 
				
			||||||
 | 
						Port    string
 | 
				
			||||||
 | 
						Network string
 | 
				
			||||||
 | 
						From    string
 | 
				
			||||||
 | 
						Data    []byte
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Store interface {
 | 
				
			||||||
 | 
						Add(attempt *ConnectionAttempt) error
 | 
				
			||||||
 | 
						List() ([]*ConnectionAttempt, error)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type MemoryStore struct {
 | 
				
			||||||
 | 
						data []*ConnectionAttempt
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MemoryStore) Add(attempt *ConnectionAttempt) error {
 | 
				
			||||||
 | 
						s.data = append(s.data, attempt)
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MemoryStore) List() ([]*ConnectionAttempt, error) {
 | 
				
			||||||
 | 
						return s.data, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										12
									
								
								honeypot/smtp/mail.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								honeypot/smtp/mail.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					package smtp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type MailData struct {
 | 
				
			||||||
 | 
						From       string
 | 
				
			||||||
 | 
						Recipients []string
 | 
				
			||||||
 | 
						Data       string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						RemoteAddr string
 | 
				
			||||||
 | 
						Timestamp  time.Time
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										30
									
								
								honeypot/smtp/metrics.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								honeypot/smtp/metrics.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					package smtp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "github.com/prometheus/client_golang/prometheus"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type MetricsStore struct {
 | 
				
			||||||
 | 
						backend   SMTPStore
 | 
				
			||||||
 | 
						mailTotal *prometheus.CounterVec
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewMetricsStore(backend SMTPStore) *MetricsStore {
 | 
				
			||||||
 | 
						store := &MetricsStore{backend: backend}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						store.mailTotal = prometheus.NewCounterVec(
 | 
				
			||||||
 | 
							prometheus.CounterOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_smtp_received_total",
 | 
				
			||||||
 | 
								Help:        "Total count of received emails.",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "honeypot_smtp"},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							[]string{"from"},
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
						prometheus.MustRegister(store.mailTotal)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return store
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MetricsStore) AddMailData(data *MailData) error {
 | 
				
			||||||
 | 
						s.mailTotal.WithLabelValues(data.From).Inc()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return s.backend.AddMailData(data)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										124
									
								
								honeypot/smtp/server.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								honeypot/smtp/server.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,124 @@
 | 
				
			|||||||
 | 
					package smtp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"bytes"
 | 
				
			||||||
 | 
						"io"
 | 
				
			||||||
 | 
						"net/mail"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						smtplib "github.com/emersion/go-smtp"
 | 
				
			||||||
 | 
						"go.uber.org/zap"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type backend struct {
 | 
				
			||||||
 | 
						honeypot *SMTPHoneypot
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (b *backend) Login(state *smtplib.ConnectionState, username, password string) (smtplib.Session, error) {
 | 
				
			||||||
 | 
						sess := &session{
 | 
				
			||||||
 | 
							honeypot:      b.honeypot,
 | 
				
			||||||
 | 
							loginUsername: username,
 | 
				
			||||||
 | 
							loginPassword: password,
 | 
				
			||||||
 | 
							remoteAddr:    state.RemoteAddr.String(),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return sess, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (b *backend) AnonymousLogin(state *smtplib.ConnectionState) (smtplib.Session, error) {
 | 
				
			||||||
 | 
						sess := &session{
 | 
				
			||||||
 | 
							loginAnonymous: true,
 | 
				
			||||||
 | 
							remoteAddr:     state.RemoteAddr.String(),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return sess, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type session struct {
 | 
				
			||||||
 | 
						honeypot *SMTPHoneypot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						loginUsername  string
 | 
				
			||||||
 | 
						loginPassword  string
 | 
				
			||||||
 | 
						loginAnonymous bool
 | 
				
			||||||
 | 
						remoteAddr     string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mail MailData
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (sess *session) Reset() {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (sess *session) Logout() error {
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (sess *session) Mail(from string, opts smtplib.MailOptions) error {
 | 
				
			||||||
 | 
						sess.mail.From = from
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (sess *session) Rcpt(to string) error {
 | 
				
			||||||
 | 
						sess.mail.Recipients = append(sess.mail.Recipients, to)
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func (sess *session) Data(r io.Reader) error {
 | 
				
			||||||
 | 
						lr := io.LimitReader(r, 1024*1024)
 | 
				
			||||||
 | 
						var buf bytes.Buffer
 | 
				
			||||||
 | 
						n, err := io.Copy(&buf, lr)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							sess.honeypot.Logger.Debugw("Error reading email data from client.", "error", err, "remote_addr", sess.remoteAddr)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if n == 1024*1024 {
 | 
				
			||||||
 | 
							// There is probably more data, read the rest from the client
 | 
				
			||||||
 | 
							// We don't really care what happens to this, or if it errors
 | 
				
			||||||
 | 
							_, _ = io.Copy(io.Discard, r)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						sess.mail.Data = buf.String()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var toAddr string
 | 
				
			||||||
 | 
						var subject string
 | 
				
			||||||
 | 
						// Parse mail headers
 | 
				
			||||||
 | 
						msg, err := mail.ReadMessage(&buf)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							sess.honeypot.Logger.Infow("Unable to parse mail.", "error", err, "remote_addr", sess.remoteAddr)
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							toAddr = msg.Header.Get("To")
 | 
				
			||||||
 | 
							subject = msg.Header.Get("Subject")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err := sess.honeypot.Store.AddMailData(&sess.mail); err != nil {
 | 
				
			||||||
 | 
							sess.honeypot.Logger.Warnw("Error storing maildata.", "error", err, "remote_addr", sess.remoteAddr)
 | 
				
			||||||
 | 
							return smtplib.ErrDataTooLarge
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						sess.honeypot.Logger.Infow("Mail received", "from", sess.mail.From, "to", toAddr, "subject", subject, "remote_addr", sess.remoteAddr, "size", len(sess.mail.Data))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type SMTPHoneypot struct {
 | 
				
			||||||
 | 
						Addr   string
 | 
				
			||||||
 | 
						Logger *zap.SugaredLogger
 | 
				
			||||||
 | 
						Store  SMTPStore
 | 
				
			||||||
 | 
						server *smtplib.Server
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewSMTPHoneypot() (*SMTPHoneypot, error) {
 | 
				
			||||||
 | 
						honeypot := &SMTPHoneypot{
 | 
				
			||||||
 | 
							Logger: zap.NewNop().Sugar(),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return honeypot, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (sh *SMTPHoneypot) ListenAndServe() error {
 | 
				
			||||||
 | 
						server := smtplib.NewServer(&backend{
 | 
				
			||||||
 | 
							honeypot: sh,
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						server.Addr = sh.Addr
 | 
				
			||||||
 | 
						server.Domain = "apiary.t-juice.club"
 | 
				
			||||||
 | 
						server.AllowInsecureAuth = true
 | 
				
			||||||
 | 
						server.ReadTimeout = 10 * time.Second
 | 
				
			||||||
 | 
						server.WriteTimeout = 10 * time.Second
 | 
				
			||||||
 | 
						sh.server = server
 | 
				
			||||||
 | 
						return server.ListenAndServe()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (sh *SMTPHoneypot) Shutdown() error {
 | 
				
			||||||
 | 
						return sh.server.Close()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										12
									
								
								honeypot/smtp/store.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								honeypot/smtp/store.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					package smtp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type SMTPStore interface {
 | 
				
			||||||
 | 
						AddMailData(mail *MailData) error
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type DiscardStore struct {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *DiscardStore) AddMailData(mail *MailData) error {
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								honeypot/ssh/Geoacumen-Country.mmdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								honeypot/ssh/Geoacumen-Country.mmdb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
package honeypot
 | 
					package ssh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ActionType int
 | 
					type ActionType int
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package honeypot
 | 
					package ssh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"net"
 | 
						"net"
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package honeypot
 | 
					package ssh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	_ "embed"
 | 
						_ "embed"
 | 
				
			||||||
@@ -28,5 +28,8 @@ func (s *HoneypotServer) LookupCountry(ip net.IP) string {
 | 
				
			|||||||
		s.Logger.Warnw("Error doing geoip lookup", "error", err)
 | 
							s.Logger.Warnw("Error doing geoip lookup", "error", err)
 | 
				
			||||||
		return "??"
 | 
							return "??"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if record.Country.ISOCode == "None" {
 | 
				
			||||||
 | 
							return "??"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return record.Country.ISOCode
 | 
						return record.Country.ISOCode
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package honeypot
 | 
					package ssh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"context"
 | 
						"context"
 | 
				
			||||||
@@ -6,22 +6,23 @@ import (
 | 
				
			|||||||
	"net"
 | 
						"net"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
						"unicode/utf8"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gossh "golang.org/x/crypto/ssh"
 | 
						gossh "golang.org/x/crypto/ssh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.uio.no/torjus/apiary/config"
 | 
						"git.t-juice.club/torjus/apiary/config"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/gliderlabs/ssh"
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
 | 
						sshlib "github.com/gliderlabs/ssh"
 | 
				
			||||||
	"github.com/google/uuid"
 | 
						"github.com/google/uuid"
 | 
				
			||||||
	"github.uio.no/torjus/apiary/honeypot/store"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/models"
 | 
					 | 
				
			||||||
	"go.uber.org/zap"
 | 
						"go.uber.org/zap"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type HoneypotServer struct {
 | 
					type HoneypotServer struct {
 | 
				
			||||||
	Logger *zap.SugaredLogger
 | 
						Logger *zap.SugaredLogger
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sshServer *ssh.Server
 | 
						sshServer *sshlib.Server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	attemptStore      store.LoginAttemptStore
 | 
						attemptStore      store.LoginAttemptStore
 | 
				
			||||||
	attemptsCallbacks []func(l models.LoginAttempt)
 | 
						attemptsCallbacks []func(l models.LoginAttempt)
 | 
				
			||||||
@@ -34,7 +35,7 @@ func NewHoneypotServer(cfg config.HoneypotConfig, store store.LoginAttemptStore)
 | 
				
			|||||||
	hs.attemptStore = store
 | 
						hs.attemptStore = store
 | 
				
			||||||
	hs.Logger = zap.NewNop().Sugar()
 | 
						hs.Logger = zap.NewNop().Sugar()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hs.sshServer = &ssh.Server{
 | 
						hs.sshServer = &sshlib.Server{
 | 
				
			||||||
		Addr:            cfg.ListenAddr,
 | 
							Addr:            cfg.ListenAddr,
 | 
				
			||||||
		PasswordHandler: hs.passwordHandler,
 | 
							PasswordHandler: hs.passwordHandler,
 | 
				
			||||||
		ConnCallback:    hs.connCallback,
 | 
							ConnCallback:    hs.connCallback,
 | 
				
			||||||
@@ -74,7 +75,7 @@ func (hs *HoneypotServer) AddLoginCallback(c func(l models.LoginAttempt)) {
 | 
				
			|||||||
	hs.attemptsCallbacks = append(hs.attemptsCallbacks, c)
 | 
						hs.attemptsCallbacks = append(hs.attemptsCallbacks, c)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (hs *HoneypotServer) passwordHandler(ctx ssh.Context, password string) bool {
 | 
					func (hs *HoneypotServer) passwordHandler(ctx sshlib.Context, password string) bool {
 | 
				
			||||||
	sessUUID, ok := ctx.Value("uuid").(uuid.UUID)
 | 
						sessUUID, ok := ctx.Value("uuid").(uuid.UUID)
 | 
				
			||||||
	if !ok {
 | 
						if !ok {
 | 
				
			||||||
		hs.Logger.Warn("Unable to get session UUID")
 | 
							hs.Logger.Warn("Unable to get session UUID")
 | 
				
			||||||
@@ -90,14 +91,20 @@ func (hs *HoneypotServer) passwordHandler(ctx ssh.Context, password string) bool
 | 
				
			|||||||
		ConnectionUUID:   sessUUID,
 | 
							ConnectionUUID:   sessUUID,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	country := hs.LookupCountry(la.RemoteIP)
 | 
						country := hs.LookupCountry(la.RemoteIP)
 | 
				
			||||||
 | 
						if utf8.RuneCountInString(country) > 2 {
 | 
				
			||||||
 | 
							hs.Logger.Warnw("Too many characters in country", "country", country, "runecount", utf8.RuneCountInString(country))
 | 
				
			||||||
 | 
							country = "??"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	la.Country = country
 | 
						la.Country = country
 | 
				
			||||||
	hs.Logger.Infow("Login attempt",
 | 
						hs.Logger.Infow("Login attempt",
 | 
				
			||||||
		"remote_ip", la.RemoteIP.String(),
 | 
							"remote_ip", la.RemoteIP.String(),
 | 
				
			||||||
		"username", la.Username,
 | 
							"username", la.Username,
 | 
				
			||||||
		"password", la.Password)
 | 
							"password", la.Password,
 | 
				
			||||||
 | 
							"country", la.Country)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := hs.attemptStore.AddAttempt(&la); err != nil {
 | 
						if err := hs.attemptStore.AddAttempt(&la); err != nil {
 | 
				
			||||||
		hs.Logger.Warnf("Error adding attempt to store")
 | 
							hs.Logger.Warnw("Error adding attempt to store", "error", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for _, cFunc := range hs.attemptsCallbacks {
 | 
						for _, cFunc := range hs.attemptsCallbacks {
 | 
				
			||||||
@@ -107,7 +114,7 @@ func (hs *HoneypotServer) passwordHandler(ctx ssh.Context, password string) bool
 | 
				
			|||||||
	return false
 | 
						return false
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *HoneypotServer) connCallback(ctx ssh.Context, conn net.Conn) net.Conn {
 | 
					func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Conn {
 | 
				
			||||||
	throttledConn := newThrottledConn(conn)
 | 
						throttledConn := newThrottledConn(conn)
 | 
				
			||||||
	throttledConn.SetSpeed(s.throttleSpeed)
 | 
						throttledConn.SetSpeed(s.throttleSpeed)
 | 
				
			||||||
	ctx.SetValue("uuid", throttledConn.ID)
 | 
						ctx.SetValue("uuid", throttledConn.ID)
 | 
				
			||||||
@@ -115,9 +122,9 @@ func (s *HoneypotServer) connCallback(ctx ssh.Context, conn net.Conn) net.Conn {
 | 
				
			|||||||
	return throttledConn
 | 
						return throttledConn
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func handler(session ssh.Session) {
 | 
					func handler(session sshlib.Session) {
 | 
				
			||||||
	_, _ = io.WriteString(session, "[root@hostname ~]#")
 | 
						_, _ = io.WriteString(session, "[root@hostname ~]#")
 | 
				
			||||||
	session.Exit(1)
 | 
						_ = session.Exit(1)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func ipFromAddr(addr string) net.IP {
 | 
					func ipFromAddr(addr string) net.IP {
 | 
				
			||||||
							
								
								
									
										235
									
								
								honeypot/ssh/store/bbolt.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										235
									
								
								honeypot/ssh/store/bbolt.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,235 @@
 | 
				
			|||||||
 | 
					package store
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"encoding/binary"
 | 
				
			||||||
 | 
						"encoding/json"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"sort"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
 | 
						bolt "go.etcd.io/bbolt"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// var _ LoginAttemptStore = &BBoltStore{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var bktKeyLogins []byte = []byte("logins")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type BBoltStore struct {
 | 
				
			||||||
 | 
						db *bolt.DB
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewBBoltStore(path string) (*BBoltStore, error) {
 | 
				
			||||||
 | 
						db, err := bolt.Open(path, 0o666, nil)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, fmt.Errorf("error opening database: %w", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var store BBoltStore
 | 
				
			||||||
 | 
						store.db = db
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err = db.Update(func(tx *bolt.Tx) error {
 | 
				
			||||||
 | 
							_, err := tx.CreateBucketIfNotExists(bktKeyLogins)
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, fmt.Errorf("error creating database bucket: %w", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return &store, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) Close() error {
 | 
				
			||||||
 | 
						return s.db.Close()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) AddAttempt(l *models.LoginAttempt) error {
 | 
				
			||||||
 | 
						data, err := json.Marshal(l)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return s.db.Update(func(tx *bolt.Tx) error {
 | 
				
			||||||
 | 
							bkt := tx.Bucket(bktKeyLogins)
 | 
				
			||||||
 | 
							seq, err := bkt.NextSequence()
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							key := itob(seq)
 | 
				
			||||||
 | 
							return bkt.Put(key, data)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) All() (<-chan models.LoginAttempt, error) {
 | 
				
			||||||
 | 
						ch := make(chan models.LoginAttempt)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						go func() {
 | 
				
			||||||
 | 
							_ = s.db.View(func(tx *bolt.Tx) error {
 | 
				
			||||||
 | 
								bkt := tx.Bucket(bktKeyLogins)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								c := bkt.Cursor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								for k, v := c.First(); k != nil; k, v = c.Next() {
 | 
				
			||||||
 | 
									var l models.LoginAttempt
 | 
				
			||||||
 | 
									if err := json.Unmarshal(v, &l); err != nil {
 | 
				
			||||||
 | 
										close(ch)
 | 
				
			||||||
 | 
										panic(err)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									ch <- l
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								close(ch)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								return nil
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return ch, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
				
			||||||
 | 
						if statType == LoginStatsTotals {
 | 
				
			||||||
 | 
							return s.statTotals()
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						counts := make(map[string]int)
 | 
				
			||||||
 | 
						err := s.db.View(func(tx *bolt.Tx) error {
 | 
				
			||||||
 | 
							bkt := tx.Bucket(bktKeyLogins)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							c := bkt.Cursor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for k, v := c.First(); k != nil; k, v = c.Next() {
 | 
				
			||||||
 | 
								var l models.LoginAttempt
 | 
				
			||||||
 | 
								if err := json.Unmarshal(v, &l); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								switch statType {
 | 
				
			||||||
 | 
								case LoginStatsPasswords:
 | 
				
			||||||
 | 
									counts[l.Password]++
 | 
				
			||||||
 | 
								case LoginStatsCountry:
 | 
				
			||||||
 | 
									counts[l.Country]++
 | 
				
			||||||
 | 
								case LoginStatsIP:
 | 
				
			||||||
 | 
									counts[l.RemoteIP.String()]++
 | 
				
			||||||
 | 
								case LoginStatsUsername:
 | 
				
			||||||
 | 
									counts[l.Username]++
 | 
				
			||||||
 | 
								default:
 | 
				
			||||||
 | 
									return fmt.Errorf("invalid stat type")
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, fmt.Errorf("error generating stats: %w", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if limit < 1 {
 | 
				
			||||||
 | 
							return toResults(counts), nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if limit >= len(counts) {
 | 
				
			||||||
 | 
							return toResults(counts), nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var si StatItems
 | 
				
			||||||
 | 
						for key := range counts {
 | 
				
			||||||
 | 
							si = append(si, StatItem{Key: key, Count: counts[key]})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						sort.Sort(si)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						output := make(map[string]int)
 | 
				
			||||||
 | 
						for i := len(si) - 1; i > len(si)-limit-1; i-- {
 | 
				
			||||||
 | 
							output[si[i].Key] = si[i].Count
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return toResults(output), nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) statTotals() ([]StatsResult, error) {
 | 
				
			||||||
 | 
						passwords := make(map[string]int)
 | 
				
			||||||
 | 
						usernames := make(map[string]int)
 | 
				
			||||||
 | 
						ips := make(map[string]int)
 | 
				
			||||||
 | 
						countries := make(map[string]int)
 | 
				
			||||||
 | 
						var count int
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err := s.db.View(func(tx *bolt.Tx) error {
 | 
				
			||||||
 | 
							bkt := tx.Bucket(bktKeyLogins)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							c := bkt.Cursor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for k, v := c.First(); k != nil; k, v = c.Next() {
 | 
				
			||||||
 | 
								var l models.LoginAttempt
 | 
				
			||||||
 | 
								if err := json.Unmarshal(v, &l); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								passwords[l.Password] += 1
 | 
				
			||||||
 | 
								usernames[l.Username] += 1
 | 
				
			||||||
 | 
								ips[l.RemoteIP.String()] += 1
 | 
				
			||||||
 | 
								countries[l.Country] += 1
 | 
				
			||||||
 | 
								count++
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						stats := []StatsResult{
 | 
				
			||||||
 | 
							{Name: "UniquePasswords", Count: len(passwords)},
 | 
				
			||||||
 | 
							{Name: "UniqueUsernames", Count: len(usernames)},
 | 
				
			||||||
 | 
							{Name: "UniqueIPs", Count: len(ips)},
 | 
				
			||||||
 | 
							{Name: "UniqueCountries", Count: len(countries)},
 | 
				
			||||||
 | 
							{Name: "TotalLoginAttempts", Count: count},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return stats, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) Query(query AttemptQuery) ([]models.LoginAttempt, error) {
 | 
				
			||||||
 | 
						var results []models.LoginAttempt
 | 
				
			||||||
 | 
						err := s.db.View(func(tx *bolt.Tx) error {
 | 
				
			||||||
 | 
							bkt := tx.Bucket(bktKeyLogins)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							c := bkt.Cursor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for k, v := c.First(); k != nil; k, v = c.Next() {
 | 
				
			||||||
 | 
								var l models.LoginAttempt
 | 
				
			||||||
 | 
								if err := json.Unmarshal(v, &l); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								switch query.QueryType {
 | 
				
			||||||
 | 
								case AttemptQueryTypeIP:
 | 
				
			||||||
 | 
									if l.RemoteIP.String() == query.Query {
 | 
				
			||||||
 | 
										results = append(results, l)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								case AttemptQueryTypePassword:
 | 
				
			||||||
 | 
									if strings.Contains(l.Password, query.Query) {
 | 
				
			||||||
 | 
										results = append(results, l)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								case AttemptQueryTypeUsername:
 | 
				
			||||||
 | 
									if strings.Contains(l.Username, query.Query) {
 | 
				
			||||||
 | 
										results = append(results, l)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return nil, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return results, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *BBoltStore) IsHealthy() error {
 | 
				
			||||||
 | 
						// TODO: Do actual healthcheck
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func itob(v uint64) []byte {
 | 
				
			||||||
 | 
						b := make([]byte, 8)
 | 
				
			||||||
 | 
						binary.BigEndian.PutUint64(b, v)
 | 
				
			||||||
 | 
						return b
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										23
									
								
								honeypot/ssh/store/bbolt_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								honeypot/ssh/store/bbolt_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					package store_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestBBoltStore(t *testing.T) {
 | 
				
			||||||
 | 
						dir := t.TempDir()
 | 
				
			||||||
 | 
						f, err := os.CreateTemp(dir, "apiary-test-bbolt")
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatal(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						fname := f.Name()
 | 
				
			||||||
 | 
						f.Close()
 | 
				
			||||||
 | 
						s, err := store.NewBBoltStore(fname)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatal(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						testLoginAttemptStore(s, t)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										118
									
								
								honeypot/ssh/store/cache.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								honeypot/ssh/store/cache.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,118 @@
 | 
				
			|||||||
 | 
					package store
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var _ LoginAttemptStore = &CachingStore{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type CachingStore struct {
 | 
				
			||||||
 | 
						backend LoginAttemptStore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						totalStatsCache    []StatsResult
 | 
				
			||||||
 | 
						usernameQueryCache map[string][]models.LoginAttempt
 | 
				
			||||||
 | 
						passwordQueryCache map[string][]models.LoginAttempt
 | 
				
			||||||
 | 
						ipQueryCache       map[string][]models.LoginAttempt
 | 
				
			||||||
 | 
						uniqueUsernames    map[string]struct{}
 | 
				
			||||||
 | 
						uniquePasswords    map[string]struct{}
 | 
				
			||||||
 | 
						uniqueIPs          map[string]struct{}
 | 
				
			||||||
 | 
						uniqueCountries    map[string]struct{}
 | 
				
			||||||
 | 
						totalLoginsCount   int
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewCachingStore(backend LoginAttemptStore) *CachingStore {
 | 
				
			||||||
 | 
						cs := &CachingStore{
 | 
				
			||||||
 | 
							backend:            backend,
 | 
				
			||||||
 | 
							usernameQueryCache: make(map[string][]models.LoginAttempt),
 | 
				
			||||||
 | 
							passwordQueryCache: make(map[string][]models.LoginAttempt),
 | 
				
			||||||
 | 
							ipQueryCache:       make(map[string][]models.LoginAttempt),
 | 
				
			||||||
 | 
							uniqueUsernames:    make(map[string]struct{}),
 | 
				
			||||||
 | 
							uniquePasswords:    make(map[string]struct{}),
 | 
				
			||||||
 | 
							uniqueIPs:          make(map[string]struct{}),
 | 
				
			||||||
 | 
							uniqueCountries:    make(map[string]struct{}),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						all, err := backend.All()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							//TODO: Handle better maybe?
 | 
				
			||||||
 | 
							panic(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						var loginCount int
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for attempt := range all {
 | 
				
			||||||
 | 
							cs.uniqueUsernames[attempt.Username] = struct{}{}
 | 
				
			||||||
 | 
							cs.uniquePasswords[attempt.Password] = struct{}{}
 | 
				
			||||||
 | 
							cs.uniqueIPs[attempt.RemoteIP.String()] = struct{}{}
 | 
				
			||||||
 | 
							cs.uniqueCountries[attempt.Country] = struct{}{}
 | 
				
			||||||
 | 
							loginCount++
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cs.totalLoginsCount = loginCount
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return cs
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *CachingStore) AddAttempt(l *models.LoginAttempt) error {
 | 
				
			||||||
 | 
						s.totalStatsCache = nil
 | 
				
			||||||
 | 
						delete(s.ipQueryCache, l.RemoteIP.String())
 | 
				
			||||||
 | 
						delete(s.passwordQueryCache, l.Password)
 | 
				
			||||||
 | 
						delete(s.usernameQueryCache, l.Username)
 | 
				
			||||||
 | 
						s.totalLoginsCount++
 | 
				
			||||||
 | 
						s.uniqueUsernames[l.Username] = struct{}{}
 | 
				
			||||||
 | 
						s.uniquePasswords[l.Password] = struct{}{}
 | 
				
			||||||
 | 
						s.uniqueIPs[l.RemoteIP.String()] = struct{}{}
 | 
				
			||||||
 | 
						s.uniqueCountries[l.Country] = struct{}{}
 | 
				
			||||||
 | 
						return s.backend.AddAttempt(l)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *CachingStore) All() (<-chan models.LoginAttempt, error) {
 | 
				
			||||||
 | 
						return s.backend.All()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *CachingStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
				
			||||||
 | 
						// Only cache totals for now, as they are the most queried
 | 
				
			||||||
 | 
						if statType == LoginStatsTotals {
 | 
				
			||||||
 | 
							return []StatsResult{
 | 
				
			||||||
 | 
								{Name: "UniquePasswords", Count: len(s.uniquePasswords)},
 | 
				
			||||||
 | 
								{Name: "UniqueUsernames", Count: len(s.uniqueUsernames)},
 | 
				
			||||||
 | 
								{Name: "UniqueIPs", Count: len(s.uniqueIPs)},
 | 
				
			||||||
 | 
								{Name: "UniqueCountries", Count: len(s.uniqueCountries)},
 | 
				
			||||||
 | 
								{Name: "TotalLoginAttempts", Count: s.totalLoginsCount},
 | 
				
			||||||
 | 
							}, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return s.backend.Stats(statType, limit)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *CachingStore) Query(query AttemptQuery) ([]models.LoginAttempt, error) {
 | 
				
			||||||
 | 
						switch query.QueryType {
 | 
				
			||||||
 | 
						case AttemptQueryTypeIP:
 | 
				
			||||||
 | 
							if attempts, ok := s.ipQueryCache[query.Query]; ok {
 | 
				
			||||||
 | 
								return attempts, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case AttemptQueryTypePassword:
 | 
				
			||||||
 | 
							if attempts, ok := s.passwordQueryCache[query.Query]; ok {
 | 
				
			||||||
 | 
								return attempts, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						case AttemptQueryTypeUsername:
 | 
				
			||||||
 | 
							if attempts, ok := s.usernameQueryCache[query.Query]; ok {
 | 
				
			||||||
 | 
								return attempts, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						attempts, err := s.backend.Query(query)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return attempts, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						switch query.QueryType {
 | 
				
			||||||
 | 
						case AttemptQueryTypeIP:
 | 
				
			||||||
 | 
							s.ipQueryCache[query.Query] = attempts
 | 
				
			||||||
 | 
						case AttemptQueryTypeUsername:
 | 
				
			||||||
 | 
							s.ipQueryCache[query.Query] = attempts
 | 
				
			||||||
 | 
						case AttemptQueryTypePassword:
 | 
				
			||||||
 | 
							s.ipQueryCache[query.Query] = attempts
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return attempts, err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *CachingStore) IsHealthy() error {
 | 
				
			||||||
 | 
						return s.backend.IsHealthy()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										69
									
								
								honeypot/ssh/store/cache_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								honeypot/ssh/store/cache_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,69 @@
 | 
				
			|||||||
 | 
					package store_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestCacheStore(t *testing.T) {
 | 
				
			||||||
 | 
						backend := &store.MemoryStore{}
 | 
				
			||||||
 | 
						s := store.NewCachingStore(backend)
 | 
				
			||||||
 | 
						testLoginAttemptStore(s, t)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestCacheTotalStats(t *testing.T) {
 | 
				
			||||||
 | 
						backend := &store.MemoryStore{}
 | 
				
			||||||
 | 
						// Add initial attempts, to ensure that the cache is correcly initialized with existing attempts
 | 
				
			||||||
 | 
						attempts := randomAttempts(50000)
 | 
				
			||||||
 | 
						for _, attempt := range attempts {
 | 
				
			||||||
 | 
							err := backend.AddAttempt(attempt)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempts: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						s := store.NewCachingStore(backend)
 | 
				
			||||||
 | 
						cacheTotals, err := s.Stats(store.LoginStatsTotals, 0)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error getting cached stats: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						backendTotals, err := backend.Stats(store.LoginStatsTotals, 0)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error getting cached stats: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for i := range cacheTotals {
 | 
				
			||||||
 | 
							if cacheTotals[i].Count != backendTotals[i].Count || cacheTotals[i].Name != backendTotals[i].Name {
 | 
				
			||||||
 | 
								t.Fatalf("Mismatched totals: Cache: %+v Backend: %+v", cacheTotals[i], backendTotals[i])
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Add the same attempts again, to ensure that duplicates are handled correctly
 | 
				
			||||||
 | 
						for _, attempt := range attempts {
 | 
				
			||||||
 | 
							err := s.AddAttempt(attempt)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempts: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Add some new attempts
 | 
				
			||||||
 | 
						attempts = randomAttempts(10000)
 | 
				
			||||||
 | 
						for _, attempt := range attempts {
 | 
				
			||||||
 | 
							err := s.AddAttempt(attempt)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempts: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						cacheTotals, err = s.Stats(store.LoginStatsTotals, 0)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error getting cached stats: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						backendTotals, err = backend.Stats(store.LoginStatsTotals, 0)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error getting cached stats: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for i := range cacheTotals {
 | 
				
			||||||
 | 
							if cacheTotals[i].Count != backendTotals[i].Count || cacheTotals[i].Name != backendTotals[i].Name {
 | 
				
			||||||
 | 
								t.Fatalf("Mismatched totals: Cache: %+v Backend: %+v", cacheTotals[i], backendTotals[i])
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -6,9 +6,11 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"sync"
 | 
						"sync"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.uio.no/torjus/apiary/models"
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var _ LoginAttemptStore = &MemoryStore{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type MemoryStore struct {
 | 
					type MemoryStore struct {
 | 
				
			||||||
	lock      sync.RWMutex
 | 
						lock      sync.RWMutex
 | 
				
			||||||
	attempts  []models.LoginAttempt
 | 
						attempts  []models.LoginAttempt
 | 
				
			||||||
@@ -32,8 +34,17 @@ func (ms *MemoryStore) AddAttempt(l *models.LoginAttempt) error {
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (ms *MemoryStore) All() ([]models.LoginAttempt, error) {
 | 
					func (ms *MemoryStore) All() (<-chan models.LoginAttempt, error) {
 | 
				
			||||||
	return ms.attempts, nil
 | 
						ch := make(chan models.LoginAttempt)
 | 
				
			||||||
 | 
						go func() {
 | 
				
			||||||
 | 
							ms.lock.RLock()
 | 
				
			||||||
 | 
							defer ms.lock.RUnlock()
 | 
				
			||||||
 | 
							for _, attempt := range ms.attempts {
 | 
				
			||||||
 | 
								ch <- attempt
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							close(ch)
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
						return ch, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (ms *MemoryStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
					func (ms *MemoryStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
				
			||||||
@@ -57,7 +68,7 @@ func (ms *MemoryStore) Stats(statType LoginStats, limit int) ([]StatsResult, err
 | 
				
			|||||||
		case LoginStatsUsername:
 | 
							case LoginStatsUsername:
 | 
				
			||||||
			counts[a.Username]++
 | 
								counts[a.Username]++
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			return nil, fmt.Errorf("Invalid stat type")
 | 
								return nil, fmt.Errorf("invalid stat type")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -142,6 +153,10 @@ func (ms *MemoryStore) Query(query AttemptQuery) ([]models.LoginAttempt, error)
 | 
				
			|||||||
	return results, nil
 | 
						return results, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MemoryStore) IsHealthy() error {
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func toResults(m map[string]int) []StatsResult {
 | 
					func toResults(m map[string]int) []StatsResult {
 | 
				
			||||||
	var results []StatsResult
 | 
						var results []StatsResult
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										24
									
								
								honeypot/ssh/store/memory_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								honeypot/ssh/store/memory_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					package store_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestMemoryStore(t *testing.T) {
 | 
				
			||||||
 | 
						s := &store.MemoryStore{}
 | 
				
			||||||
 | 
						testLoginAttemptStore(s, t)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					func TestMemoryStoreWithCache(t *testing.T) {
 | 
				
			||||||
 | 
						backend := &store.MemoryStore{}
 | 
				
			||||||
 | 
						s := store.NewCachingStore(backend)
 | 
				
			||||||
 | 
						testLoginAttemptStore(s, t)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func BenchmarkMemoryStore(b *testing.B) {
 | 
				
			||||||
 | 
						setupFunc := func() store.LoginAttemptStore {
 | 
				
			||||||
 | 
							return &store.MemoryStore{}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						benchmarkLoginAttemptStore(setupFunc, b)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										127
									
								
								honeypot/ssh/store/metrics.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										127
									
								
								honeypot/ssh/store/metrics.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,127 @@
 | 
				
			|||||||
 | 
					package store
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
 | 
						"github.com/prometheus/client_golang/prometheus"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var _ LoginAttemptStore = &MetricsCollectingStore{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tickDuration = 5 * time.Second
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type MetricsCollectingStore struct {
 | 
				
			||||||
 | 
						store LoginAttemptStore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						attemptsCounter      *prometheus.CounterVec
 | 
				
			||||||
 | 
						uniqueUsernamesCount prometheus.Gauge
 | 
				
			||||||
 | 
						uniquePasswordsCount prometheus.Gauge
 | 
				
			||||||
 | 
						uniqueIPsCount       prometheus.Gauge
 | 
				
			||||||
 | 
						totalAttemptsCount   prometheus.Gauge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						statsTicker *time.Ticker
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewMetricsCollectingStore(ctx context.Context, store LoginAttemptStore) *MetricsCollectingStore {
 | 
				
			||||||
 | 
						mcs := &MetricsCollectingStore{store: store}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mcs.attemptsCounter = prometheus.NewCounterVec(
 | 
				
			||||||
 | 
							prometheus.CounterOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_ssh_attempt_counter",
 | 
				
			||||||
 | 
								Help:        "Total count of login attempts toward SSH",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "honeypot_ssh"},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							[]string{"CountryCode"},
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
						mcs.uniqueUsernamesCount = prometheus.NewGauge(
 | 
				
			||||||
 | 
							prometheus.GaugeOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_ssh_unique_usernames_count",
 | 
				
			||||||
 | 
								Help:        "Counter of unique usernames.",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "honeypot_ssh"},
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mcs.uniquePasswordsCount = prometheus.NewGauge(
 | 
				
			||||||
 | 
							prometheus.GaugeOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_ssh_unique_passwords_count",
 | 
				
			||||||
 | 
								Help:        "Counter of unique passwords.",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "honeypot_ssh"},
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mcs.uniqueIPsCount = prometheus.NewGauge(
 | 
				
			||||||
 | 
							prometheus.GaugeOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_ssh_unique_ips_count",
 | 
				
			||||||
 | 
								Help:        "Counter of unique IPs.",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "honeypot_ssh"},
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mcs.totalAttemptsCount = prometheus.NewGauge(
 | 
				
			||||||
 | 
							prometheus.GaugeOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_ssh_total_login_attempts",
 | 
				
			||||||
 | 
								Help:        "Total amount of login attempts made.",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "honeypot_ssh"},
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						prometheus.MustRegister(mcs.attemptsCounter)
 | 
				
			||||||
 | 
						prometheus.MustRegister(mcs.uniqueUsernamesCount)
 | 
				
			||||||
 | 
						prometheus.MustRegister(mcs.uniquePasswordsCount)
 | 
				
			||||||
 | 
						prometheus.MustRegister(mcs.uniqueIPsCount)
 | 
				
			||||||
 | 
						prometheus.MustRegister(mcs.totalAttemptsCount)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mcs.statsTicker = time.NewTicker(tickDuration)
 | 
				
			||||||
 | 
						go func() {
 | 
				
			||||||
 | 
							defer mcs.statsTicker.Stop()
 | 
				
			||||||
 | 
							for {
 | 
				
			||||||
 | 
								select {
 | 
				
			||||||
 | 
								case <-ctx.Done():
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								case <-mcs.statsTicker.C:
 | 
				
			||||||
 | 
									mcs.Stats(LoginStatsTotals, 0) // nolint: errcheck
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return mcs
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MetricsCollectingStore) AddAttempt(l *models.LoginAttempt) error {
 | 
				
			||||||
 | 
						err := s.store.AddAttempt(l)
 | 
				
			||||||
 | 
						s.attemptsCounter.WithLabelValues(l.Country).Inc()
 | 
				
			||||||
 | 
						return err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MetricsCollectingStore) All() (<-chan models.LoginAttempt, error) {
 | 
				
			||||||
 | 
						return s.store.All()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MetricsCollectingStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
				
			||||||
 | 
						stats, err := s.store.Stats(statType, limit)
 | 
				
			||||||
 | 
						if statType == LoginStatsTotals {
 | 
				
			||||||
 | 
							// Reset ticker to avoid updating twice within the duration
 | 
				
			||||||
 | 
							s.statsTicker.Reset(tickDuration)
 | 
				
			||||||
 | 
							for _, element := range stats {
 | 
				
			||||||
 | 
								switch element.Name {
 | 
				
			||||||
 | 
								case "UniquePasswords":
 | 
				
			||||||
 | 
									s.uniquePasswordsCount.Set(float64(element.Count))
 | 
				
			||||||
 | 
								case "UniqueUsernames":
 | 
				
			||||||
 | 
									s.uniqueUsernamesCount.Set(float64(element.Count))
 | 
				
			||||||
 | 
								case "UniqueIPs":
 | 
				
			||||||
 | 
									s.uniqueIPsCount.Set(float64(element.Count))
 | 
				
			||||||
 | 
								case "TotalLoginAttempts":
 | 
				
			||||||
 | 
									s.totalAttemptsCount.Set(float64(element.Count))
 | 
				
			||||||
 | 
								default:
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return stats, err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MetricsCollectingStore) Query(query AttemptQuery) ([]models.LoginAttempt, error) {
 | 
				
			||||||
 | 
						return s.store.Query(query)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *MetricsCollectingStore) IsHealthy() error {
 | 
				
			||||||
 | 
						return s.store.IsHealthy()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -5,10 +5,12 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net"
 | 
						"net"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
	_ "github.com/jackc/pgx/v4/stdlib"
 | 
						_ "github.com/jackc/pgx/v4/stdlib"
 | 
				
			||||||
	"github.uio.no/torjus/apiary/models"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var _ LoginAttemptStore = &PostgresStore{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const DBSchema = `
 | 
					const DBSchema = `
 | 
				
			||||||
CREATE TABLE IF NOT EXISTS login_attempts(
 | 
					CREATE TABLE IF NOT EXISTS login_attempts(
 | 
				
			||||||
	id serial PRIMARY KEY,
 | 
						id serial PRIMARY KEY,
 | 
				
			||||||
@@ -51,7 +53,7 @@ RETURNING id;`
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	defer tx.Rollback()
 | 
						defer tx.Rollback() // nolint: errcheck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var id int
 | 
						var id int
 | 
				
			||||||
	if err := tx.QueryRow(stmt, l.Date, l.RemoteIP.String(), l.Username, l.Password, l.SSHClientVersion, l.ConnectionUUID, l.Country).Scan(&id); err != nil {
 | 
						if err := tx.QueryRow(stmt, l.Date, l.RemoteIP.String(), l.Username, l.Password, l.SSHClientVersion, l.ConnectionUUID, l.Country).Scan(&id); err != nil {
 | 
				
			||||||
@@ -61,25 +63,30 @@ RETURNING id;`
 | 
				
			|||||||
	return tx.Commit()
 | 
						return tx.Commit()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *PostgresStore) All() ([]models.LoginAttempt, error) {
 | 
					func (s *PostgresStore) All() (<-chan models.LoginAttempt, error) {
 | 
				
			||||||
	stmt := `SELECT date, remote_ip, username, password, client_version, connection_uuid, country FROM login_attempts`
 | 
						stmt := `SELECT date, remote_ip, username, password, client_version, connection_uuid, country FROM login_attempts`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rows, err := s.db.Query(stmt)
 | 
						rows, err := s.db.Query(stmt)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	defer rows.Close()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var attempts []models.LoginAttempt
 | 
						ch := make(chan models.LoginAttempt)
 | 
				
			||||||
	for rows.Next() {
 | 
						go func() {
 | 
				
			||||||
		var a models.LoginAttempt
 | 
							defer rows.Close()
 | 
				
			||||||
		if err := rows.Scan(&a.Date, &a.RemoteIP, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil {
 | 
							for rows.Next() {
 | 
				
			||||||
			return nil, err
 | 
								var a models.LoginAttempt
 | 
				
			||||||
 | 
								var ip string
 | 
				
			||||||
 | 
								if err := rows.Scan(&a.Date, &ip, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil {
 | 
				
			||||||
 | 
									panic(err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								a.RemoteIP = net.ParseIP(ip)
 | 
				
			||||||
 | 
								ch <- a
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		attempts = append(attempts, a)
 | 
							close(ch)
 | 
				
			||||||
	}
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return attempts, nil
 | 
						return ch, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *PostgresStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
					func (s *PostgresStore) Stats(statType LoginStats, limit int) ([]StatsResult, error) {
 | 
				
			||||||
@@ -124,6 +131,13 @@ func (s *PostgresStore) Stats(statType LoginStats, limit int) ([]StatsResult, er
 | 
				
			|||||||
	return results, nil
 | 
						return results, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *PostgresStore) IsHealthy() error {
 | 
				
			||||||
 | 
						if err := s.db.Ping(); err != nil {
 | 
				
			||||||
 | 
							return ErrStoreUnhealthy
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *PostgresStore) statsTotal(limit int) ([]StatsResult, error) {
 | 
					func (s *PostgresStore) statsTotal(limit int) ([]StatsResult, error) {
 | 
				
			||||||
	uniquePasswordStmt := `select count(*) from (select distinct password from login_attempts) as temp`
 | 
						uniquePasswordStmt := `select count(*) from (select distinct password from login_attempts) as temp`
 | 
				
			||||||
	uniqueUsernameStmt := `select count(*) from (select distinct username from login_attempts) as temp`
 | 
						uniqueUsernameStmt := `select count(*) from (select distinct username from login_attempts) as temp`
 | 
				
			||||||
@@ -164,25 +178,25 @@ func (s *PostgresStore) Query(query AttemptQuery) ([]models.LoginAttempt, error)
 | 
				
			|||||||
	var stmt string
 | 
						var stmt string
 | 
				
			||||||
	queryString := query.Query
 | 
						queryString := query.Query
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const limit = 10000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch query.QueryType {
 | 
						switch query.QueryType {
 | 
				
			||||||
	case AttemptQueryTypeIP:
 | 
						case AttemptQueryTypeIP:
 | 
				
			||||||
		stmt = `SELECT id, date, remote_ip, username, password, client_version, connection_uuid, country
 | 
							stmt = `SELECT id, date, remote_ip, username, password, client_version, connection_uuid, country
 | 
				
			||||||
					FROM login_attempts WHERE remote_ip = $1`
 | 
										FROM login_attempts WHERE remote_ip = $1 order by date desc limit $2`
 | 
				
			||||||
	case AttemptQueryTypePassword:
 | 
						case AttemptQueryTypePassword:
 | 
				
			||||||
		stmt = `SELECT id, date, remote_ip, username, password, client_version, connection_uuid, country
 | 
							stmt = `SELECT id, date, remote_ip, username, password, client_version, connection_uuid, country
 | 
				
			||||||
					FROM login_attempts WHERE password like $1`
 | 
										FROM login_attempts WHERE password = $1 order by date desc limit $2`
 | 
				
			||||||
		queryString = fmt.Sprintf("%%%s%%", queryString)
 | 
					 | 
				
			||||||
	case AttemptQueryTypeUsername:
 | 
						case AttemptQueryTypeUsername:
 | 
				
			||||||
		stmt = `SELECT id, date, remote_ip, username, password, client_version, connection_uuid, country
 | 
							stmt = `SELECT id, date, remote_ip, username, password, client_version, connection_uuid, country
 | 
				
			||||||
					FROM login_attempts WHERE username like $1`
 | 
										FROM login_attempts WHERE username = $1 order by date desc limit $2`
 | 
				
			||||||
		queryString = fmt.Sprintf("%%%s%%", queryString)
 | 
					 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return nil, fmt.Errorf("Invalid query type")
 | 
							return nil, fmt.Errorf("invalid query type")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rows, err := s.db.Query(stmt, queryString)
 | 
						rows, err := s.db.Query(stmt, queryString, limit)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, fmt.Errorf("Unable to query database: %w", err)
 | 
							return nil, fmt.Errorf("unable to query database: %w", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	defer rows.Close()
 | 
						defer rows.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -191,11 +205,10 @@ func (s *PostgresStore) Query(query AttemptQuery) ([]models.LoginAttempt, error)
 | 
				
			|||||||
		var la models.LoginAttempt
 | 
							var la models.LoginAttempt
 | 
				
			||||||
		var ipString string
 | 
							var ipString string
 | 
				
			||||||
		if err := rows.Scan(&la.ID, &la.Date, &ipString, &la.Username, &la.Password, &la.SSHClientVersion, &la.ConnectionUUID, &la.Country); err != nil {
 | 
							if err := rows.Scan(&la.ID, &la.Date, &ipString, &la.Username, &la.Password, &la.SSHClientVersion, &la.ConnectionUUID, &la.Country); err != nil {
 | 
				
			||||||
			return nil, fmt.Errorf("Unable to unmarshal data from database: %w", err)
 | 
								return nil, fmt.Errorf("unable to unmarshal data from database: %w", err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		la.RemoteIP = net.ParseIP(ipString)
 | 
							la.RemoteIP = net.ParseIP(ipString)
 | 
				
			||||||
		results = append(results, la)
 | 
							results = append(results, la)
 | 
				
			||||||
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return results, nil
 | 
						return results, nil
 | 
				
			||||||
							
								
								
									
										81
									
								
								honeypot/ssh/store/postgres_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								honeypot/ssh/store/postgres_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,81 @@
 | 
				
			|||||||
 | 
					// nolint: errcheck
 | 
				
			||||||
 | 
					package store_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"database/sql"
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestPostgresStore(t *testing.T) {
 | 
				
			||||||
 | 
						var dsn string
 | 
				
			||||||
 | 
						var found bool
 | 
				
			||||||
 | 
						dsn, found = os.LookupEnv("APIARY_TEST_POSTGRES_DSN")
 | 
				
			||||||
 | 
						if !found {
 | 
				
			||||||
 | 
							t.Skipf("APIARY_TEST_POSTGRES_DSN not set. Skipping.")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						dropPGDatabase(dsn)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						s, err := store.NewPostgresStore(dsn)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error getting store: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						s.InitDB()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						testLoginAttemptStore(s, t)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestPostgresStoreWithCache(t *testing.T) {
 | 
				
			||||||
 | 
						var dsn string
 | 
				
			||||||
 | 
						var found bool
 | 
				
			||||||
 | 
						dsn, found = os.LookupEnv("APIARY_TEST_POSTGRES_DSN")
 | 
				
			||||||
 | 
						if !found {
 | 
				
			||||||
 | 
							t.Skipf("APIARY_TEST_POSTGRES_DSN not set. Skipping.")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						dropPGDatabase(dsn)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pgs, err := store.NewPostgresStore(dsn)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							t.Fatalf("Error getting store: %s", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pgs.InitDB()
 | 
				
			||||||
 | 
						s := store.NewCachingStore(pgs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						testLoginAttemptStore(s, t)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func BenchmarkPostgresStore(b *testing.B) {
 | 
				
			||||||
 | 
						var dsn string
 | 
				
			||||||
 | 
						var found bool
 | 
				
			||||||
 | 
						dsn, found = os.LookupEnv("APIARY_TEST_POSTGRES_DSN")
 | 
				
			||||||
 | 
						if !found {
 | 
				
			||||||
 | 
							b.Skipf("APIARY_TEST_POSTGRES_DSN not set. Skipping.")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						dropPGDatabase(dsn)
 | 
				
			||||||
 | 
						setupFunc := func() store.LoginAttemptStore {
 | 
				
			||||||
 | 
							dropPGDatabase(dsn)
 | 
				
			||||||
 | 
							pgs, err := store.NewPostgresStore(dsn)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								b.Fatalf("Error getting store: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							pgs.InitDB()
 | 
				
			||||||
 | 
							return pgs
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						benchmarkLoginAttemptStore(setupFunc, b)
 | 
				
			||||||
 | 
						dropPGDatabase(dsn)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func dropPGDatabase(dsn string) {
 | 
				
			||||||
 | 
						db, err := sql.Open("pgx", dsn)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							panic(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						_, _ = db.Exec("DROP TABLE login_attempts")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,6 +1,12 @@
 | 
				
			|||||||
package store
 | 
					package store
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "github.uio.no/torjus/apiary/models"
 | 
					import (
 | 
				
			||||||
 | 
						"errors"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var ErrStoreUnhealthy = errors.New("store is unhealthy")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type LoginStats string
 | 
					type LoginStats string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -32,7 +38,12 @@ type AttemptQuery struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
type LoginAttemptStore interface {
 | 
					type LoginAttemptStore interface {
 | 
				
			||||||
	AddAttempt(l *models.LoginAttempt) error
 | 
						AddAttempt(l *models.LoginAttempt) error
 | 
				
			||||||
	All() ([]models.LoginAttempt, error)
 | 
						All() (<-chan models.LoginAttempt, error)
 | 
				
			||||||
	Stats(statType LoginStats, limit int) ([]StatsResult, error)
 | 
						Stats(statType LoginStats, limit int) ([]StatsResult, error)
 | 
				
			||||||
	Query(query AttemptQuery) ([]models.LoginAttempt, error)
 | 
						Query(query AttemptQuery) ([]models.LoginAttempt, error)
 | 
				
			||||||
 | 
						HealthCheker
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type HealthCheker interface {
 | 
				
			||||||
 | 
						IsHealthy() error
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										325
									
								
								honeypot/ssh/store/store_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										325
									
								
								honeypot/ssh/store/store_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,325 @@
 | 
				
			|||||||
 | 
					package store_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"math/rand"
 | 
				
			||||||
 | 
						"net"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
 | 
						"github.com/google/uuid"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func testLoginAttemptStore(s store.LoginAttemptStore, t *testing.T) {
 | 
				
			||||||
 | 
						t.Run("Simple", func(t *testing.T) {
 | 
				
			||||||
 | 
							testAttempts := randomAttempts(10)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for _, attempt := range testAttempts {
 | 
				
			||||||
 | 
								if err := s.AddAttempt(attempt); err != nil {
 | 
				
			||||||
 | 
									t.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							all, err := s.All()
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error getting all attempts: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							var count int
 | 
				
			||||||
 | 
							for range all {
 | 
				
			||||||
 | 
								count++
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if count != len(testAttempts) {
 | 
				
			||||||
 | 
								t.Errorf("All returned wrong amount. Got %d want %d", count, len(testAttempts))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							stats, err := s.Stats(store.LoginStatsTotals, 1)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Errorf("Stats returned error: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							for _, stat := range stats {
 | 
				
			||||||
 | 
								if stat.Name == "TotalLoginAttempts" && stat.Count != len(testAttempts) {
 | 
				
			||||||
 | 
									t.Errorf("Stats for total attempts is wrong. Got %d want %d", stat.Count, len(testAttempts))
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						t.Run("Query", func(t *testing.T) {
 | 
				
			||||||
 | 
							testAttempts := []*models.LoginAttempt{
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Date:     time.Now(),
 | 
				
			||||||
 | 
									RemoteIP: net.ParseIP("127.0.0.1"),
 | 
				
			||||||
 | 
									Username: "corndog",
 | 
				
			||||||
 | 
									Password: "corndog",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Date:     time.Now(),
 | 
				
			||||||
 | 
									RemoteIP: net.ParseIP("127.0.0.1"),
 | 
				
			||||||
 | 
									Username: "corndog",
 | 
				
			||||||
 | 
									Password: "c0rnd0g",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Date:     time.Now(),
 | 
				
			||||||
 | 
									RemoteIP: net.ParseIP("10.0.0.1"),
 | 
				
			||||||
 | 
									Username: "root",
 | 
				
			||||||
 | 
									Password: "password",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Date:     time.Now(),
 | 
				
			||||||
 | 
									RemoteIP: net.ParseIP("10.0.0.2"),
 | 
				
			||||||
 | 
									Username: "ubnt",
 | 
				
			||||||
 | 
									Password: "password",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for _, attempt := range testAttempts {
 | 
				
			||||||
 | 
								err := s.AddAttempt(attempt)
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									t.Fatalf("Unable to add attempt: %s", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							testCases := []struct {
 | 
				
			||||||
 | 
								Name           string
 | 
				
			||||||
 | 
								Query          store.AttemptQuery
 | 
				
			||||||
 | 
								ExpectedResult []models.LoginAttempt
 | 
				
			||||||
 | 
							}{
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Name:  "password one result",
 | 
				
			||||||
 | 
									Query: store.AttemptQuery{QueryType: store.AttemptQueryTypePassword, Query: "corndog"},
 | 
				
			||||||
 | 
									ExpectedResult: []models.LoginAttempt{
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											RemoteIP: net.ParseIP("127.0.0.1"),
 | 
				
			||||||
 | 
											Username: "corndog",
 | 
				
			||||||
 | 
											Password: "corndog",
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Name:  "username one result",
 | 
				
			||||||
 | 
									Query: store.AttemptQuery{QueryType: store.AttemptQueryTypeUsername, Query: "root"},
 | 
				
			||||||
 | 
									ExpectedResult: []models.LoginAttempt{
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											RemoteIP: net.ParseIP("10.0.0.1"),
 | 
				
			||||||
 | 
											Username: "root",
 | 
				
			||||||
 | 
											Password: "password",
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									Name:  "username two results",
 | 
				
			||||||
 | 
									Query: store.AttemptQuery{QueryType: store.AttemptQueryTypeUsername, Query: "corndog"},
 | 
				
			||||||
 | 
									ExpectedResult: []models.LoginAttempt{
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											RemoteIP: net.ParseIP("127.0.0.1"),
 | 
				
			||||||
 | 
											Username: "corndog",
 | 
				
			||||||
 | 
											Password: "c0rnd0g",
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											RemoteIP: net.ParseIP("127.0.0.1"),
 | 
				
			||||||
 | 
											Username: "corndog",
 | 
				
			||||||
 | 
											Password: "corndog",
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for _, tc := range testCases {
 | 
				
			||||||
 | 
								res, err := s.Query(tc.Query)
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									t.Errorf("Error performing query: %s", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if !equalAttempts(res, tc.ExpectedResult) {
 | 
				
			||||||
 | 
									t.Errorf("Query did not return expected results")
 | 
				
			||||||
 | 
									t.Logf("%+v", res)
 | 
				
			||||||
 | 
									t.Logf("%+v", tc.ExpectedResult)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						t.Run("QueryCache", func(t *testing.T) {
 | 
				
			||||||
 | 
							err := s.AddAttempt(&models.LoginAttempt{RemoteIP: net.ParseIP("127.0.0.1"), Username: "test", Password: "test"})
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							res, err := s.Query(store.AttemptQuery{QueryType: store.AttemptQueryTypeUsername, Query: "test"})
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if len(res) != 1 {
 | 
				
			||||||
 | 
								t.Errorf("Wrong amount of results")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							err = s.AddAttempt(&models.LoginAttempt{RemoteIP: net.ParseIP("127.0.0.1"), Username: "test", Password: "best"})
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							res, err = s.Query(store.AttemptQuery{QueryType: store.AttemptQueryTypeUsername, Query: "test"})
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if len(res) != 2 {
 | 
				
			||||||
 | 
								t.Errorf("Wrong amount of results")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						t.Run("QueryStats", func(t *testing.T) {
 | 
				
			||||||
 | 
							firstStats, err := s.Stats(store.LoginStatsTotals, 1)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error getting stats: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							err = s.AddAttempt(&models.LoginAttempt{RemoteIP: net.ParseIP("127.0.0.1"), Username: "test", Password: "best"})
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							secondStats, err := s.Stats(store.LoginStatsTotals, 1)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								t.Fatalf("Error getting stats: %s", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							var firstCount, secondCount int
 | 
				
			||||||
 | 
							for _, stat := range firstStats {
 | 
				
			||||||
 | 
								if stat.Name == "TotalLoginAttempts" {
 | 
				
			||||||
 | 
									firstCount = stat.Count
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							for _, stat := range secondStats {
 | 
				
			||||||
 | 
								if stat.Name == "TotalLoginAttempts" {
 | 
				
			||||||
 | 
									secondCount = stat.Count
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if secondCount != firstCount+1 {
 | 
				
			||||||
 | 
								t.Errorf("TotalLoginAttempts did not increment")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func benchmarkLoginAttemptStore(setupFunc func() store.LoginAttemptStore, b *testing.B) {
 | 
				
			||||||
 | 
						b.Run("BenchmarkAdd", func(b *testing.B) {
 | 
				
			||||||
 | 
							s := setupFunc()
 | 
				
			||||||
 | 
							for i := 0; i < b.N; i++ {
 | 
				
			||||||
 | 
								attempt := randomAttempts(1)
 | 
				
			||||||
 | 
								err := s.AddAttempt(attempt[0])
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									b.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						b.Run("BenchmarkAdd10k", func(b *testing.B) {
 | 
				
			||||||
 | 
							attempts := randomAttempts(10_000)
 | 
				
			||||||
 | 
							for i := 0; i < b.N; i++ {
 | 
				
			||||||
 | 
								b.StopTimer()
 | 
				
			||||||
 | 
								s := setupFunc()
 | 
				
			||||||
 | 
								b.StartTimer()
 | 
				
			||||||
 | 
								for _, attempt := range attempts {
 | 
				
			||||||
 | 
									err := s.AddAttempt(attempt)
 | 
				
			||||||
 | 
									if err != nil {
 | 
				
			||||||
 | 
										b.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						b.Run("BenchmarkAll10k", func(b *testing.B) {
 | 
				
			||||||
 | 
							s := setupFunc()
 | 
				
			||||||
 | 
							attempts := randomAttempts(10_000)
 | 
				
			||||||
 | 
							for _, attempt := range attempts {
 | 
				
			||||||
 | 
								err := s.AddAttempt(attempt)
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									b.Fatalf("Error adding attempt: %s", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							b.ResetTimer()
 | 
				
			||||||
 | 
							for i := 0; i < b.N; i++ {
 | 
				
			||||||
 | 
								all, err := s.All()
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									b.Fatalf("Error fetchin all: %s", err)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								var count int
 | 
				
			||||||
 | 
								for range all {
 | 
				
			||||||
 | 
									count++
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								_ = count
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func randomAttempts(count int) []*models.LoginAttempt {
 | 
				
			||||||
 | 
						var attempts []*models.LoginAttempt
 | 
				
			||||||
 | 
						for i := 0; i < count; i++ {
 | 
				
			||||||
 | 
							attempt := &models.LoginAttempt{
 | 
				
			||||||
 | 
								Date:             time.Now(),
 | 
				
			||||||
 | 
								RemoteIP:         randomIP(),
 | 
				
			||||||
 | 
								Username:         randomString(8),
 | 
				
			||||||
 | 
								Password:         randomString(8),
 | 
				
			||||||
 | 
								Country:          randomCountry(),
 | 
				
			||||||
 | 
								ConnectionUUID:   uuid.Must(uuid.NewRandom()),
 | 
				
			||||||
 | 
								SSHClientVersion: "SSH TEST LOL",
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							attempts = append(attempts, attempt)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return attempts
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func randomIP() net.IP {
 | 
				
			||||||
 | 
						a := byte(rand.Intn(254))
 | 
				
			||||||
 | 
						b := byte(rand.Intn(254))
 | 
				
			||||||
 | 
						c := byte(rand.Intn(254))
 | 
				
			||||||
 | 
						d := byte(rand.Intn(254))
 | 
				
			||||||
 | 
						return net.IPv4(a, b, c, d)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func randomString(n int) string {
 | 
				
			||||||
 | 
						const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						b := make([]byte, n)
 | 
				
			||||||
 | 
						for i := range b {
 | 
				
			||||||
 | 
							b[i] = letterBytes[rand.Intn(len(letterBytes))]
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return string(b)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func randomCountry() string {
 | 
				
			||||||
 | 
						switch rand.Intn(10) {
 | 
				
			||||||
 | 
						case 1:
 | 
				
			||||||
 | 
							return "CN"
 | 
				
			||||||
 | 
						case 2:
 | 
				
			||||||
 | 
							return "US"
 | 
				
			||||||
 | 
						case 3:
 | 
				
			||||||
 | 
							return "NO"
 | 
				
			||||||
 | 
						case 4:
 | 
				
			||||||
 | 
							return "RU"
 | 
				
			||||||
 | 
						case 5:
 | 
				
			||||||
 | 
							return "DE"
 | 
				
			||||||
 | 
						case 6:
 | 
				
			||||||
 | 
							return "FI"
 | 
				
			||||||
 | 
						case 7:
 | 
				
			||||||
 | 
							return "BR"
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							return "SE"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func equalAttempts(a, b []models.LoginAttempt) bool {
 | 
				
			||||||
 | 
						if len(a) != len(b) {
 | 
				
			||||||
 | 
							return false
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						aFound := make([]bool, len(a))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for i, aAttempt := range a {
 | 
				
			||||||
 | 
							for _, bAttempt := range b {
 | 
				
			||||||
 | 
								if aAttempt.Username == bAttempt.Username &&
 | 
				
			||||||
 | 
									aAttempt.Password == bAttempt.Password &&
 | 
				
			||||||
 | 
									aAttempt.RemoteIP.String() == bAttempt.RemoteIP.String() {
 | 
				
			||||||
 | 
									aFound[i] = true
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for _, found := range aFound {
 | 
				
			||||||
 | 
							if !found {
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return true
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,119 +0,0 @@
 | 
				
			|||||||
package store
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
func TestStatItems(t *testing.T) {
 | 
					 | 
				
			||||||
	var tc = []struct {
 | 
					 | 
				
			||||||
		Input          StatItems
 | 
					 | 
				
			||||||
		ExpectedOutput StatItems
 | 
					 | 
				
			||||||
	}{
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			Input: StatItems{
 | 
					 | 
				
			||||||
				{Key: "a", Count: 5},
 | 
					 | 
				
			||||||
				{Key: "b", Count: 100},
 | 
					 | 
				
			||||||
				{Key: "c", Count: 99},
 | 
					 | 
				
			||||||
				{Key: "d", Count: 98},
 | 
					 | 
				
			||||||
				{Key: "f", Count: 18},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			ExpectedOutput: StatItems{
 | 
					 | 
				
			||||||
				{Key: "a", Count: 5},
 | 
					 | 
				
			||||||
				{Key: "f", Count: 18},
 | 
					 | 
				
			||||||
				{Key: "d", Count: 98},
 | 
					 | 
				
			||||||
				{Key: "c", Count: 99},
 | 
					 | 
				
			||||||
				{Key: "b", Count: 100},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, testCase := range tc {
 | 
					 | 
				
			||||||
		sort.Sort(testCase.Input)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		for i := range testCase.Input {
 | 
					 | 
				
			||||||
			if testCase.Input[i] != testCase.ExpectedOutput[i] {
 | 
					 | 
				
			||||||
				t.Fatalf("Not sorted correctly")
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestStats(t *testing.T) {
 | 
					 | 
				
			||||||
	var exampleAttempts = []models.LoginAttempt{
 | 
					 | 
				
			||||||
		{Username: "root", Password: "root", Country: "NO"},
 | 
					 | 
				
			||||||
		{Username: "root", Password: "root", Country: "US"},
 | 
					 | 
				
			||||||
		{Username: "user", Password: "passWord", Country: "US"},
 | 
					 | 
				
			||||||
		{Username: "ibm", Password: "ibm", Country: "US"},
 | 
					 | 
				
			||||||
		{Username: "ubnt", Password: "ubnt", Country: "GB"},
 | 
					 | 
				
			||||||
		{Username: "ubnt", Password: "ubnt", Country: "FI"},
 | 
					 | 
				
			||||||
		{Username: "root", Password: "root", Country: "CH"},
 | 
					 | 
				
			||||||
		{Username: "ubnt", Password: "12345", Country: "DE"},
 | 
					 | 
				
			||||||
		{Username: "oracle", Password: "oracle", Country: "FI"},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	var tc = []struct {
 | 
					 | 
				
			||||||
		Attempts       []models.LoginAttempt
 | 
					 | 
				
			||||||
		StatType       LoginStats
 | 
					 | 
				
			||||||
		Limit          int
 | 
					 | 
				
			||||||
		ExpectedOutput map[string]int
 | 
					 | 
				
			||||||
	}{
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			Attempts: exampleAttempts,
 | 
					 | 
				
			||||||
			StatType: LoginStatsPasswords,
 | 
					 | 
				
			||||||
			Limit:    2,
 | 
					 | 
				
			||||||
			ExpectedOutput: map[string]int{
 | 
					 | 
				
			||||||
				"root": 3,
 | 
					 | 
				
			||||||
				"ubnt": 2,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			Attempts: exampleAttempts,
 | 
					 | 
				
			||||||
			StatType: LoginStatsPasswords,
 | 
					 | 
				
			||||||
			Limit:    1,
 | 
					 | 
				
			||||||
			ExpectedOutput: map[string]int{
 | 
					 | 
				
			||||||
				"root": 3,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			Attempts: exampleAttempts,
 | 
					 | 
				
			||||||
			StatType: LoginStatsCountry,
 | 
					 | 
				
			||||||
			Limit:    2,
 | 
					 | 
				
			||||||
			ExpectedOutput: map[string]int{
 | 
					 | 
				
			||||||
				"US": 3,
 | 
					 | 
				
			||||||
				"FI": 2,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			Attempts: exampleAttempts,
 | 
					 | 
				
			||||||
			StatType: LoginStatsCountry,
 | 
					 | 
				
			||||||
			Limit:    0,
 | 
					 | 
				
			||||||
			ExpectedOutput: map[string]int{
 | 
					 | 
				
			||||||
				"US": 3,
 | 
					 | 
				
			||||||
				"FI": 2,
 | 
					 | 
				
			||||||
				"NO": 1,
 | 
					 | 
				
			||||||
				"GB": 1,
 | 
					 | 
				
			||||||
				"CH": 1,
 | 
					 | 
				
			||||||
				"DE": 1,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, c := range tc {
 | 
					 | 
				
			||||||
		ms := MemoryStore{}
 | 
					 | 
				
			||||||
		for _, a := range c.Attempts {
 | 
					 | 
				
			||||||
			if err := ms.AddAttempt(a); err != nil {
 | 
					 | 
				
			||||||
				t.Fatalf("Unable to add attempt: %s", err)
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		stats, err := ms.Stats(c.StatType, c.Limit)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			t.Fatalf("Error getting stats: %s", err)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if len(stats) != len(c.ExpectedOutput) {
 | 
					 | 
				
			||||||
			t.Fatalf("Stats have wrong length")
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		for key := range stats {
 | 
					 | 
				
			||||||
			if c.ExpectedOutput[key] != stats[key] {
 | 
					 | 
				
			||||||
				t.Fatalf("Stats does not match expected output")
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
@@ -5,8 +5,10 @@ import (
 | 
				
			|||||||
	"runtime"
 | 
						"runtime"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var Version = "v0.1.3"
 | 
					var (
 | 
				
			||||||
var Build string
 | 
						Version = "v0.1.31"
 | 
				
			||||||
 | 
						Build   string
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func FullVersion() string {
 | 
					func FullVersion() string {
 | 
				
			||||||
	if Build != "" {
 | 
						if Build != "" {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					//go:build !embed
 | 
				
			||||||
// +build !embed
 | 
					// +build !embed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package web
 | 
					package web
 | 
				
			||||||
@@ -21,7 +22,7 @@ func (s *Server) IndexHandler(frontendDir string) http.HandlerFunc {
 | 
				
			|||||||
		fname := filepath.Join(frontendDir, r.URL.Path)
 | 
							fname := filepath.Join(frontendDir, r.URL.Path)
 | 
				
			||||||
		_, err := os.Stat(fname)
 | 
							_, err := os.Stat(fname)
 | 
				
			||||||
		if os.IsNotExist(err) {
 | 
							if os.IsNotExist(err) {
 | 
				
			||||||
			serveIndex(frontendDir).ServeHTTP(w, r)
 | 
								s.serveIndex(frontendDir).ServeHTTP(w, r)
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		fs.ServeHTTP(w, r)
 | 
							fs.ServeHTTP(w, r)
 | 
				
			||||||
@@ -29,7 +30,7 @@ func (s *Server) IndexHandler(frontendDir string) http.HandlerFunc {
 | 
				
			|||||||
	return http.HandlerFunc(fn)
 | 
						return http.HandlerFunc(fn)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func serveIndex(frontendDir string) http.HandlerFunc {
 | 
					func (s *Server) serveIndex(frontendDir string) http.HandlerFunc {
 | 
				
			||||||
	fn := func(w http.ResponseWriter, r *http.Request) {
 | 
						fn := func(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
		fname := filepath.Join(frontendDir, "index.html")
 | 
							fname := filepath.Join(frontendDir, "index.html")
 | 
				
			||||||
		f, err := os.Open(fname)
 | 
							f, err := os.Open(fname)
 | 
				
			||||||
@@ -38,7 +39,9 @@ func serveIndex(frontendDir string) http.HandlerFunc {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		defer f.Close()
 | 
							defer f.Close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		io.Copy(w, f)
 | 
							if _, err := io.Copy(w, f); err != nil {
 | 
				
			||||||
 | 
								s.ServerLogger.Warnw("Error writing frontend to client.", "err", err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return fn
 | 
						return fn
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/go-chi/chi/v5/middleware"
 | 
						"github.com/go-chi/chi/v5/middleware"
 | 
				
			||||||
 | 
						"github.com/prometheus/client_golang/prometheus"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// LoggingMiddleware is used for logging info about requests to the servers configured accesslogger.
 | 
					// LoggingMiddleware is used for logging info about requests to the servers configured accesslogger.
 | 
				
			||||||
@@ -16,12 +17,10 @@ func (s *Server) LoggingMiddleware(next http.Handler) http.Handler {
 | 
				
			|||||||
		reqID := middleware.GetReqID(r.Context())
 | 
							reqID := middleware.GetReqID(r.Context())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		defer func() {
 | 
							defer func() {
 | 
				
			||||||
			/*s.AccessLogger.Debugw(r.Method,
 | 
								// If AccessLogIgnoreMetrics is true, do not log successful requests to metrics endpoint
 | 
				
			||||||
				"path", r.URL.Path,
 | 
								if s.cfg.AccessLogIgnoreMetrics && r.URL.Path == "/metrics" && ww.Status() == http.StatusOK {
 | 
				
			||||||
				"request-headers", r.Header,
 | 
									return
 | 
				
			||||||
				"response-headers", ww.Header(),
 | 
								}
 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
			*/
 | 
					 | 
				
			||||||
			s.AccessLogger.Infow(r.Method,
 | 
								s.AccessLogger.Infow(r.Method,
 | 
				
			||||||
				"path", r.URL.Path,
 | 
									"path", r.URL.Path,
 | 
				
			||||||
				"status", ww.Status(),
 | 
									"status", ww.Status(),
 | 
				
			||||||
@@ -35,3 +34,46 @@ func (s *Server) LoggingMiddleware(next http.Handler) http.Handler {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	return http.HandlerFunc(fn)
 | 
						return http.HandlerFunc(fn)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type MetricsMiddleware struct {
 | 
				
			||||||
 | 
						requests *prometheus.CounterVec
 | 
				
			||||||
 | 
						latency  *prometheus.HistogramVec
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (mm *MetricsMiddleware) handler(next http.Handler) http.Handler {
 | 
				
			||||||
 | 
						fn := func(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
 | 
							ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor)
 | 
				
			||||||
 | 
							start := time.Now()
 | 
				
			||||||
 | 
							defer func() {
 | 
				
			||||||
 | 
								mm.requests.WithLabelValues(http.StatusText(ww.Status()), r.Method, r.URL.Path).Inc()
 | 
				
			||||||
 | 
								mm.latency.WithLabelValues(http.StatusText(ww.Status()), r.Method, r.URL.Path).Observe(float64(time.Since(start).Milliseconds()))
 | 
				
			||||||
 | 
							}()
 | 
				
			||||||
 | 
							next.ServeHTTP(ww, r)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return http.HandlerFunc(fn)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewMetricsMiddleware() func(next http.Handler) http.Handler {
 | 
				
			||||||
 | 
						mm := &MetricsMiddleware{}
 | 
				
			||||||
 | 
						mm.requests = prometheus.NewCounterVec(prometheus.CounterOpts{
 | 
				
			||||||
 | 
							Name:        "apiary_http_requests_total",
 | 
				
			||||||
 | 
							Help:        "Total requests processed.",
 | 
				
			||||||
 | 
							ConstLabels: prometheus.Labels{"service": "http"},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
							[]string{"code", "method", "path"},
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						mm.latency = prometheus.NewHistogramVec(
 | 
				
			||||||
 | 
							prometheus.HistogramOpts{
 | 
				
			||||||
 | 
								Name:        "apiary_http_request_duration_milliseconds",
 | 
				
			||||||
 | 
								Help:        "Request processing time.",
 | 
				
			||||||
 | 
								ConstLabels: prometheus.Labels{"service": "http"},
 | 
				
			||||||
 | 
								Buckets:     []float64{100, 500, 1500},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							[]string{"code", "method", "path"},
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
						prometheus.MustRegister(mm.requests)
 | 
				
			||||||
 | 
						prometheus.MustRegister(mm.latency)
 | 
				
			||||||
 | 
						return mm.handler
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,13 +11,15 @@ import (
 | 
				
			|||||||
	"sync"
 | 
						"sync"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/config"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/honeypot/ssh/store"
 | 
				
			||||||
 | 
						"git.t-juice.club/torjus/apiary/models"
 | 
				
			||||||
	"github.com/go-chi/chi/v5"
 | 
						"github.com/go-chi/chi/v5"
 | 
				
			||||||
	"github.com/go-chi/chi/v5/middleware"
 | 
						"github.com/go-chi/chi/v5/middleware"
 | 
				
			||||||
	"github.com/google/uuid"
 | 
						"github.com/google/uuid"
 | 
				
			||||||
	"github.uio.no/torjus/apiary/config"
 | 
						"github.com/prometheus/client_golang/prometheus/promhttp"
 | 
				
			||||||
	"github.uio.no/torjus/apiary/honeypot"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/honeypot/store"
 | 
					 | 
				
			||||||
	"github.uio.no/torjus/apiary/models"
 | 
					 | 
				
			||||||
	"go.uber.org/zap"
 | 
						"go.uber.org/zap"
 | 
				
			||||||
	"golang.org/x/crypto/acme/autocert"
 | 
						"golang.org/x/crypto/acme/autocert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -30,7 +32,7 @@ type Server struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	cfg config.FrontendConfig
 | 
						cfg config.FrontendConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	honeypotServer *honeypot.HoneypotServer
 | 
						honeypotServer *ssh.HoneypotServer
 | 
				
			||||||
	store          store.LoginAttemptStore
 | 
						store          store.LoginAttemptStore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ServerLogger *zap.SugaredLogger
 | 
						ServerLogger *zap.SugaredLogger
 | 
				
			||||||
@@ -41,7 +43,7 @@ type Server struct {
 | 
				
			|||||||
	streamContext        context.Context
 | 
						streamContext        context.Context
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewServer(cfg config.FrontendConfig, hs *honeypot.HoneypotServer, store store.LoginAttemptStore) *Server {
 | 
					func NewServer(cfg config.FrontendConfig, hs *ssh.HoneypotServer, store store.LoginAttemptStore) *Server {
 | 
				
			||||||
	s := &Server{
 | 
						s := &Server{
 | 
				
			||||||
		ServerLogger: zap.NewNop().Sugar(),
 | 
							ServerLogger: zap.NewNop().Sugar(),
 | 
				
			||||||
		AccessLogger: zap.NewNop().Sugar(),
 | 
							AccessLogger: zap.NewNop().Sugar(),
 | 
				
			||||||
@@ -65,7 +67,7 @@ func NewServer(cfg config.FrontendConfig, hs *honeypot.HoneypotServer, store sto
 | 
				
			|||||||
		s.RegisterOnShutdown(func() {
 | 
							s.RegisterOnShutdown(func() {
 | 
				
			||||||
			timeoutCtx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
 | 
								timeoutCtx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
 | 
				
			||||||
			defer cancel()
 | 
								defer cancel()
 | 
				
			||||||
			s.httpRedirectServer.Shutdown(timeoutCtx)
 | 
								s.httpRedirectServer.Shutdown(timeoutCtx) // nolint: errcheck
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
		s.Addr = ":443"
 | 
							s.Addr = ":443"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -83,15 +85,18 @@ func NewServer(cfg config.FrontendConfig, hs *honeypot.HoneypotServer, store sto
 | 
				
			|||||||
	r.Use(middleware.RealIP)
 | 
						r.Use(middleware.RealIP)
 | 
				
			||||||
	r.Use(middleware.RequestID)
 | 
						r.Use(middleware.RequestID)
 | 
				
			||||||
	r.Use(s.LoggingMiddleware)
 | 
						r.Use(s.LoggingMiddleware)
 | 
				
			||||||
 | 
						r.Use(NewMetricsMiddleware())
 | 
				
			||||||
 | 
						r.Use(middleware.SetHeader("Server", fmt.Sprintf("apiary/%s", apiary.FullVersion())))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						r.Handle("/metrics", promhttp.Handler())
 | 
				
			||||||
	r.Route("/", func(r chi.Router) {
 | 
						r.Route("/", func(r chi.Router) {
 | 
				
			||||||
		r.Get("/*", s.IndexHandler("web/vue-frontend/dist"))
 | 
							r.Get("/*", s.IndexHandler("web/vue-frontend/dist"))
 | 
				
			||||||
		r.Get("/stream", s.HandlerAttemptStream)
 | 
							r.Get("/stream", s.HandlerAttemptStream)
 | 
				
			||||||
		r.Route("/api", func(r chi.Router) {
 | 
							r.Route("/api", func(r chi.Router) {
 | 
				
			||||||
			r.Use(middleware.SetHeader("Content-Type", "application/json"))
 | 
					 | 
				
			||||||
			r.Get("/stats", s.HandlerStats)
 | 
								r.Get("/stats", s.HandlerStats)
 | 
				
			||||||
			r.Get("/stream", s.HandlerAttemptStream)
 | 
								r.Get("/stream", s.HandlerAttemptStream)
 | 
				
			||||||
			r.Get("/query", s.HandlerQuery)
 | 
								r.Get("/query", s.HandlerQuery)
 | 
				
			||||||
 | 
								r.Get("/health", s.HandlerHealth)
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	s.Handler = r
 | 
						s.Handler = r
 | 
				
			||||||
@@ -146,6 +151,7 @@ func (s *Server) closeAttemptListener(id string) {
 | 
				
			|||||||
	close(ch)
 | 
						close(ch)
 | 
				
			||||||
	delete(s.attemptListeners, id)
 | 
						delete(s.attemptListeners, id)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *Server) HandlerAttemptStream(w http.ResponseWriter, r *http.Request) {
 | 
					func (s *Server) HandlerAttemptStream(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
	w.Header().Set("Content-Type", "text/event-stream")
 | 
						w.Header().Set("Content-Type", "text/event-stream")
 | 
				
			||||||
	w.Header().Set("Cache-Control", "no-cache")
 | 
						w.Header().Set("Cache-Control", "no-cache")
 | 
				
			||||||
@@ -211,6 +217,7 @@ func (s *Server) HandlerStats(w http.ResponseWriter, r *http.Request) {
 | 
				
			|||||||
		s.ServerLogger.Debugf("Error encoding or writing response", "remote_ip", r.RemoteAddr, "error", err)
 | 
							s.ServerLogger.Debugf("Error encoding or writing response", "remote_ip", r.RemoteAddr, "error", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *Server) HandlerQuery(w http.ResponseWriter, r *http.Request) {
 | 
					func (s *Server) HandlerQuery(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
	w.Header().Add("Content-Type", "application/json")
 | 
						w.Header().Add("Content-Type", "application/json")
 | 
				
			||||||
	queryType := r.URL.Query().Get("type")
 | 
						queryType := r.URL.Query().Get("type")
 | 
				
			||||||
@@ -269,6 +276,15 @@ func (s *Server) HandlerQuery(w http.ResponseWriter, r *http.Request) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (s *Server) HandlerHealth(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
 | 
						err := s.store.IsHealthy()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							s.WriteAPIError(w, r, http.StatusInternalServerError, fmt.Sprintf("Health error: %s", err))
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						w.Write([]byte(`{}`)) // nolint: errcheck
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type APIErrorResponse struct {
 | 
					type APIErrorResponse struct {
 | 
				
			||||||
	Error string `json:"error"`
 | 
						Error string `json:"error"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user