├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── cmd ├── agent │ └── siphon_agent.go ├── generator │ ├── generator │ │ ├── generator.go │ │ └── wrapper.go │ └── siphon_gen.go └── siphon │ └── siphon.go ├── configs ├── siphon.yaml ├── siphon_agent.yaml └── siphon_gen.yaml ├── docs └── DOCS.md ├── go.mod ├── go.sum ├── internal ├── agent │ ├── agent.go │ ├── controllers │ │ ├── controllers.go │ │ └── models.go │ ├── monitor │ │ └── monitor.go │ └── utils │ │ └── utils.go ├── commands │ ├── agents │ │ ├── agents.go │ │ └── set │ │ │ └── set.go │ ├── commands.go │ ├── exit │ │ └── exit.go │ ├── get │ │ └── get.go │ ├── info │ │ └── info.go │ ├── samples │ │ └── samples.go │ └── sources │ │ ├── new │ │ └── new.go │ │ └── sources.go ├── console │ └── console.go ├── db │ ├── db.go │ └── models.go ├── integrations │ ├── agent │ │ └── agent.go │ ├── integrations.go │ └── malwarebazaar │ │ ├── malwarebazaar.go │ │ └── models.go ├── logger │ └── logger.go ├── siphon │ └── siphon.go └── version │ └── version.go └── scripts ├── install.sh ├── keygen.sh └── setup_agent.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Py 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build build-agent build-gen 2 | build: 3 | go build cmd/siphon/siphon.go 4 | 5 | build-agent: 6 | go build cmd/agent/siphon_agent.go 7 | 8 | build-gen: 9 | go build cmd/generator/siphon_gen.go -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Siphon 2 | 3 | Siphon is a cross-platform malware feed designed to enrich 4 | the threat intelligence process. It pulls the latest identified strains from 5 | verified CTI sources into one portal. 6 | I personally use it to keep up to date with the latest threats, and get a head-start 7 | on analysing malicious samples! 8 | 9 | A database of basic sample information is built up as often as an un-indexed sample 10 | is found by querying threat intelligence APIs. You can view the most recent samples, 11 | sorted by time, and download them from their source. 12 | 13 | ## Support 14 | 15 | Siphon is designed with only Unix host support in mind, however, it is possible to set it up on Windows 16 | using Git Bash, WSL or similar applications. 17 | 18 | ## Installation 19 | 20 | You can download Siphon source code from the [releases](https://github.com/pygrum/siphon/releases/latest) page, or clone it from this URL. 21 | Then, after entering the containing folder, run `bash scripts/install.sh`. 22 | 23 | ### Supported Integrations 24 | 25 | | Name | Setup instructions | 26 | |---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 27 | | MalwareBazaar | MalwareBazaar integration is used to fetch the latest samples seen in the wild. Create an account at https://bazaar.abuse.ch/ and retrieve api key from your account settings. | 28 | 29 | For each integration, add an entry into your configuration file using the 30 | `sources new` command. It should look something like this: 31 | 32 | ```shell 33 | sources new --name MalwareBazaar --api-key --endpoint https://mb-api.abuse.ch/api/v1/ 34 | ``` 35 | 36 | ```yaml 37 | refreshrate: 1 38 | sources: 39 | - name: MalwareBazaar 40 | apikey: 41 | endpoint: https://mb-api.abuse.ch/api/v1/ 42 | ``` 43 | 44 | ### Changelog 45 | 46 | #### v2.0.0 47 | 48 | Siphon has introduced honeypot integration! Agents can now be configured and used on decoy hosts to log 49 | information about and cache samples that are used by attackers in real time. These agents provide the same 50 | interface as other integrations - with the ability to query and download recent samples. 51 | 52 | See the [docs](https://github.com/pygrum/siphon/blob/main/docs/DOCS.md) for how to build and configure 53 | agents. 54 | -------------------------------------------------------------------------------- /cmd/agent/siphon_agent.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/agent" 5 | "github.com/pygrum/siphon/internal/logger" 6 | "github.com/spf13/cobra" 7 | "github.com/spf13/viper" 8 | ) 9 | 10 | var ( 11 | AgentID string 12 | Interface string 13 | Port string 14 | ClientCertData string // Base64 Encoded certificate data 15 | cfgFile string 16 | 17 | rootCmd = &cobra.Command{ 18 | Use: "siphon_agent", 19 | Short: "A Honeypot-Resident Sample Curator", 20 | Long: ``, 21 | Run: func(cmd *cobra.Command, args []string) { 22 | viper.SetConfigFile(cfgFile) 23 | if err := viper.ReadInConfig(); err != nil { 24 | logger.Fatalf("reading configuration file failed: %v", err) 25 | } 26 | agent.Initialize(AgentID, Interface, Port, ClientCertData) 27 | }, 28 | } 29 | ) 30 | 31 | func init() { 32 | rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "agent configuration file") 33 | _ = cobra.MarkFlagRequired(rootCmd.PersistentFlags(), "config") 34 | } 35 | 36 | func main() { 37 | if err := rootCmd.Execute(); err != nil { 38 | logger.Fatal(err) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cmd/generator/generator/generator.go: -------------------------------------------------------------------------------- 1 | package generator 2 | 3 | import ( 4 | "crypto/rand" 5 | "encoding/base64" 6 | "fmt" 7 | "github.com/pygrum/siphon/internal/db" 8 | "github.com/pygrum/siphon/internal/logger" 9 | "github.com/spf13/viper" 10 | "math/big" 11 | "net" 12 | "os" 13 | ) 14 | 15 | const ( 16 | AgentIDLength = 16 17 | AgentIDPrefix = "AA" 18 | ) 19 | 20 | var charSet = []byte("0123456789ABCDEF") 21 | 22 | func RandID() string { 23 | ret := make([]byte, AgentIDLength-len(AgentIDPrefix)) 24 | for i := 0; i < AgentIDLength-len(AgentIDPrefix); i++ { 25 | num, _ := rand.Int(rand.Reader, big.NewInt(int64(len(charSet)))) 26 | ret[i] = charSet[num.Int64()] 27 | } 28 | return AgentIDPrefix + string(ret) 29 | } 30 | 31 | func IsAgentID(s string) bool { 32 | return len(s) == AgentIDLength && s[:2] == "AA" 33 | } 34 | 35 | func Generate() error { 36 | name := viper.GetString("name") 37 | goos := viper.GetString("os") 38 | arch := viper.GetString("arch") 39 | iFace := viper.GetString("host") 40 | port := viper.GetString("port") 41 | outFile := viper.GetString("outfile") 42 | siphonCert := viper.GetString("cert_file") 43 | 44 | certData, err := os.ReadFile(siphonCert) 45 | if err != nil { 46 | logger.Fatalf("could not read siphon certificate from %s: %v", siphonCert, err) 47 | } 48 | agentID := RandID() 49 | if len(name) == 0 { 50 | name = agentID 51 | } 52 | mainPath := viper.GetString("src_path") 53 | 54 | builder := NewBuilder("go", goos, arch) 55 | builder.AddSrcPath(mainPath) 56 | builder.SetFlags( 57 | Flag{"main.AgentID", agentID}, 58 | Flag{"main.Interface", iFace}, 59 | Flag{"main.Port", port}, 60 | // Add certificate data base64 encoded to agent, so it is added to its rootCAs 61 | Flag{"main.ClientCertData", base64.StdEncoding.EncodeToString(certData)}, 62 | ) 63 | builder.SetOutFile(outFile) 64 | // Exits if unsuccessful 65 | builder.Build() 66 | 67 | conn := db.Initialize() 68 | agent := &db.Agent{ 69 | AgentID: agentID, 70 | Name: name, 71 | Endpoint: fmt.Sprintf("https://%s/api", net.JoinHostPort(iFace, port)), 72 | } 73 | return conn.Add(agent) 74 | } 75 | -------------------------------------------------------------------------------- /cmd/generator/generator/wrapper.go: -------------------------------------------------------------------------------- 1 | package generator 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "github.com/pygrum/siphon/internal/logger" 7 | "os" 8 | "os/exec" 9 | "strings" 10 | ) 11 | 12 | type Builder struct { 13 | CC string 14 | GOOS string 15 | GOARCH string 16 | SrcPaths []string 17 | outFile string 18 | flags []Flag 19 | } 20 | 21 | type Flag struct { 22 | Name string 23 | Value string 24 | } 25 | 26 | const ( 27 | outFileOption = "-o" 28 | flagsOption = "-ldflags" 29 | flagPrefix = "-X" 30 | ) 31 | 32 | func NewBuilder(cc, goos, goarch string) *Builder { 33 | return &Builder{ 34 | CC: cc, 35 | GOOS: goos, 36 | GOARCH: goarch, 37 | } 38 | } 39 | 40 | func (b *Builder) AddSrcPath(path string) { 41 | b.SrcPaths = append(b.SrcPaths, path) 42 | } 43 | 44 | func (b *Builder) SetFlags(flags ...Flag) { 45 | b.flags = flags 46 | } 47 | 48 | func (b *Builder) SetOutFile(name string) { 49 | b.outFile = name 50 | } 51 | 52 | func (b *Builder) Build() { 53 | var buildCmd []string 54 | buildCmd = append(buildCmd, "build") 55 | buildCmd = append(buildCmd, outFileOption) 56 | buildCmd = append(buildCmd, b.outFile) 57 | buildCmd = append(buildCmd, flagsOption) 58 | var flags []string 59 | for _, f := range b.flags { 60 | flags = append(flags, flagPrefix) 61 | formatString := "'%s=%s'" 62 | flags = append(flags, fmt.Sprintf(formatString, f.Name, f.Value)) 63 | } 64 | buildCmd = append(buildCmd, strings.Join(flags, " ")) 65 | for _, s := range b.SrcPaths { 66 | buildCmd = append(buildCmd, s) 67 | } 68 | fmt.Println(b.CC, strings.Join(buildCmd, " ")) 69 | var cerr bytes.Buffer 70 | cmd := exec.Command(b.CC, buildCmd...) 71 | // Set arch and os environment vars 72 | cmd.Env = os.Environ() 73 | cmd.Env = append(cmd.Env, fmt.Sprintf("GOOS=%s", b.GOOS), fmt.Sprintf("GOARCH=%s", b.GOARCH)) // go-sqlite3 requires cgo 74 | cmd.Stderr = &cerr 75 | if err := cmd.Run(); err != nil { 76 | logger.Fatalf("%v: %s", err, cerr.String()) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /cmd/generator/siphon_gen.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/pygrum/siphon/cmd/generator/generator" 6 | "github.com/pygrum/siphon/internal/logger" 7 | "github.com/pygrum/siphon/internal/version" 8 | "github.com/spf13/cobra" 9 | "github.com/spf13/viper" 10 | ) 11 | 12 | func init() { 13 | fmt.Printf("{_/¬ SIPHON GENERATOR %s ¬\\_}\n\n}", version.VersionString()) 14 | } 15 | 16 | var ( 17 | cfgFile string 18 | 19 | rootCmd = &cobra.Command{ 20 | Use: "generator", 21 | Short: "A utility for Siphon agent generation", 22 | Long: ``, 23 | Run: func(cmd *cobra.Command, args []string) { 24 | viper.SetConfigFile(cfgFile) 25 | if err := viper.ReadInConfig(); err != nil { 26 | logger.Fatalf("reading configuration file failed: %v", err) 27 | } 28 | if err := generator.Generate(); err != nil { 29 | logger.Fatal(err) 30 | } 31 | logger.Notifyf("agent has successfully been built. For installation instructions, see the docs: %s", 32 | "https://github.com/pygrum/siphon/blob/main/docs/DOCS.md", 33 | ) 34 | }, 35 | } 36 | ) 37 | 38 | func init() { 39 | rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "generator configuration file - see https://github.com/pygrum/siphon/blob/main/docs/DOCS.md for help") 40 | _ = cobra.MarkFlagRequired(rootCmd.PersistentFlags(), "config") 41 | } 42 | 43 | func main() { 44 | if err := rootCmd.Execute(); err != nil { 45 | logger.Fatal(err) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /cmd/siphon/siphon.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "github.com/pygrum/siphon/internal/console" 7 | "github.com/pygrum/siphon/internal/db" 8 | "github.com/pygrum/siphon/internal/logger" 9 | "github.com/pygrum/siphon/internal/version" 10 | "github.com/spf13/cobra" 11 | "github.com/spf13/viper" 12 | "os" 13 | "path/filepath" 14 | "strings" 15 | ) 16 | 17 | var ( 18 | cfgFile string 19 | 20 | rootCmd = &cobra.Command{ 21 | Use: "siphon", 22 | Short: "Siphon - A CLI-based Threat Intelligence and Asset Feed", 23 | Long: ``, 24 | Run: func(cmd *cobra.Command, args []string) { 25 | // Clear screen 26 | fmt.Println("\033[2J") 27 | 28 | fmt.Println(strings.ReplaceAll( 29 | title(), 30 | "{VER}", 31 | version.VersionString())) 32 | console.Start() 33 | }, 34 | } 35 | ) 36 | 37 | func init() { 38 | initCfg() 39 | 40 | rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "siphon configuration file") 41 | } 42 | 43 | func initCfg() { 44 | if len(cfgFile) != 0 { 45 | viper.SetConfigFile(cfgFile) 46 | } else { 47 | home, err := os.UserHomeDir() 48 | cobra.CheckErr(err) 49 | cfgDir := filepath.Join(home, ".siphon") 50 | err = os.Mkdir(cfgDir, 0700) 51 | if !errors.Is(err, os.ErrExist) { 52 | cobra.CheckErr(err) 53 | } 54 | if _, err := os.Stat(filepath.Join(cfgDir, ".siphon.yaml")); os.IsNotExist(err) { 55 | err = os.WriteFile(filepath.Join(cfgDir, ".siphon.yaml"), cfgBoilerplate(), 0666) 56 | cobra.CheckErr(err) 57 | } 58 | 59 | viper.AddConfigPath(cfgDir) 60 | viper.SetConfigType("yaml") 61 | viper.SetConfigName(".siphon") 62 | } 63 | 64 | if err := viper.ReadInConfig(); err != nil { 65 | logger.Errorf("reading configuration file failed: %v", err) 66 | } 67 | db.Initialize() 68 | } 69 | 70 | func title() string { 71 | return ` 72 | ⠀⠀⠀⠀⣀⣤⠶⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣴⠛⢦ 73 | ⠀⣠⣴⠟⠋⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠿⠋⠁⠙⠒⠋ 74 | ⣰⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⠁⠀⠀⠀⠀⠀⠀ 75 | ⣿⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡾⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀ 76 | ⠸⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 77 | ⠀ ⠙⢷⣤⡀⠀⠀⠀⠀⠀⠀⠀⣀⣤⡾⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 78 | ⠀ ⠀⠀⠉⠻⠷⢶⣶⣶⣶⠶⠟⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 79 | 80 | SIPHON - MALWARE FEED {VER} 81 | https://github.com/pygrum/siphon 82 | ` 83 | } 84 | 85 | func main() { 86 | if err := rootCmd.Execute(); err != nil { 87 | logger.Fatal(err) 88 | } 89 | } 90 | 91 | func cfgBoilerplate() []byte { 92 | return []byte(`refreshrate: 5 # Refresh sample list every 5 minutes 93 | Sources: 94 | - name: MalwareBazaar 95 | endpoint: null 96 | apikey: null 97 | `) 98 | } 99 | -------------------------------------------------------------------------------- /configs/siphon.yaml: -------------------------------------------------------------------------------- 1 | # Example configuration file for Siphon 2 | 3 | refreshrate: 5 # Refresh sample list every 5 minutes 4 | cert_file: "/path/to/cert/file.crt" 5 | key_file: "/path/to/key/file.crt" 6 | sources: 7 | - name: "malwarebazaar" 8 | endpoint: 9 | apikey: -------------------------------------------------------------------------------- /configs/siphon_agent.yaml: -------------------------------------------------------------------------------- 1 | # Example configuration file for Siphon agent 2 | 3 | cache: true 4 | cert_file: "/path/to/certificate/file" 5 | key_file: "/path/to/key/file" 6 | monitor_folders: 7 | - path: "/path/to/folder_1" 8 | recursive: true 9 | - path: "/path/to/folder_2" 10 | recursive: false -------------------------------------------------------------------------------- /configs/siphon_gen.yaml: -------------------------------------------------------------------------------- 1 | # Example configuration file for Siphon's agent generator 2 | 3 | cert_file: "/path/to/siphon/client/certificate" 4 | src_path: "/path/to/siphon/agent/source/file" # This would be ${SRC}/cmd/agent/siphon_agent.go 5 | name: "agent" 6 | os: "windows" 7 | arch: "amd64" 8 | host: "0.0.0.0" 9 | port: "8080" 10 | outfile: "agent.exe" -------------------------------------------------------------------------------- /docs/DOCS.md: -------------------------------------------------------------------------------- 1 | # Configuration 2 | 3 | ## Siphon 4 | Here is a full example configuration for Siphon: 5 | 6 | ```yaml 7 | RefreshRate: 5 # Refresh sample list every 5 minutes 8 | cert_file: "/path/to/cert/file.crt" 9 | key_file: "/path/to/key/file.crt" 10 | Sources: 11 | - name: "VirusTotal" 12 | endpoint: 13 | APIKey: 14 | - name: "MalwareBazaar" 15 | endpoint: 16 | APIKey: 17 | - name: "HybridAnalysis" 18 | endpoint: 19 | APIKey: 20 | ``` 21 | 22 | Each entry in `source` correlates to a supported threat intelligence feed integration. 23 | All that is needed is an endpoint and API key. 24 | 25 | ## Siphon agent 26 | The siphon agent monitors folders located in a honeypot. 27 | Here is an example configuration for the Siphon agent: 28 | 29 | ```yaml 30 | cache: true 31 | cert_file: "/path/to/certificate/file" 32 | key_file: "/path/to/key/file" 33 | monitor_folders: 34 | - path: "/path/to/folder_1" 35 | recursive: true 36 | - path: "/path/to/folder_2" 37 | recursive: false 38 | ``` 39 | 40 | If `cache` is set to true, then files written to disk in the monitored folders 41 | will be saved to a protected folder, in case they get deleted or moved later on. 42 | 43 | The `recursive` monitoring option means that that specific folder and all subfolders will 44 | be monitored for file changes, otherwise, only the top level folder will be monitored. 45 | 46 | ## Agent generator 47 | Here is an example agent generator file. These fields are used to build a new agent. 48 | ```yaml 49 | cert_file: "/path/to/siphon/client/certificate" 50 | src_path: "/path/to/siphon/source/folder" 51 | name: "agent" 52 | os: "windows" 53 | arch: "amd64" 54 | host: "0.0.0.0" 55 | port: "8080" 56 | outfile: "agent.exe" 57 | ``` 58 | 59 | ### Agent build steps 60 | 61 | After generating an agent with `siphon_gen`, run the `setup_agent.sh` script (under /scripts) to 62 | create a folder with the agent, tls key pair and default configuration file, which you should tweak as you wish. 63 | 64 | You'll need to update the configuration file with: 65 | 1. The path to your key pair when _it's on the target machine_ (this is set to `/root/agent.` by default) 66 | 2. Folders to monitor on the host, following the same format as shown under 'Siphon agent' above -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/pygrum/siphon 2 | 3 | go 1.21 4 | 5 | require ( 6 | github.com/reeflective/console v0.1.10 7 | github.com/spf13/cobra v1.7.0 8 | github.com/spf13/viper v1.16.0 9 | ) 10 | 11 | require ( 12 | github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0 // indirect 13 | github.com/bytedance/sonic v1.10.1 // indirect 14 | github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect 15 | github.com/chenzhuoyu/iasm v0.9.0 // indirect 16 | github.com/fsnotify/fsnotify v1.6.0 // indirect 17 | github.com/gabriel-vasile/mimetype v1.4.2 // indirect 18 | github.com/gin-contrib/sse v0.1.0 // indirect 19 | github.com/gin-gonic/gin v1.9.1 // indirect 20 | github.com/go-fsnotify/fsnotify v0.0.0-20180321022601-755488143dae // indirect 21 | github.com/go-playground/locales v0.14.1 // indirect 22 | github.com/go-playground/universal-translator v0.18.1 // indirect 23 | github.com/go-playground/validator/v10 v10.15.4 // indirect 24 | github.com/goccy/go-json v0.10.2 // indirect 25 | github.com/hashicorp/hcl v1.0.0 // indirect 26 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 27 | github.com/jedib0t/go-pretty/v6 v6.4.7 // indirect 28 | github.com/jinzhu/inflection v1.0.0 // indirect 29 | github.com/jinzhu/now v1.1.5 // indirect 30 | github.com/json-iterator/go v1.1.12 // indirect 31 | github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect 32 | github.com/klauspost/cpuid/v2 v2.2.5 // indirect 33 | github.com/leodido/go-urn v1.2.4 // indirect 34 | github.com/magiconair/properties v1.8.7 // indirect 35 | github.com/mattn/go-isatty v0.0.19 // indirect 36 | github.com/mattn/go-runewidth v0.0.13 // indirect 37 | github.com/mattn/go-sqlite3 v1.14.17 // indirect 38 | github.com/mitchellh/mapstructure v1.5.0 // indirect 39 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 40 | github.com/modern-go/reflect2 v1.0.2 // indirect 41 | github.com/pelletier/go-toml/v2 v2.1.0 // indirect 42 | github.com/reeflective/readline v1.0.10 // indirect 43 | github.com/rivo/uniseg v0.4.4 // indirect 44 | github.com/rsteube/carapace v0.43.5 // indirect 45 | github.com/spf13/afero v1.10.0 // indirect 46 | github.com/spf13/cast v1.5.1 // indirect 47 | github.com/spf13/jwalterweatherman v1.1.0 // indirect 48 | github.com/spf13/pflag v1.0.5 // indirect 49 | github.com/subosito/gotenv v1.6.0 // indirect 50 | github.com/twitchyliquid64/golang-asm v0.15.1 // indirect 51 | github.com/ugorji/go/codec v1.2.11 // indirect 52 | golang.org/x/arch v0.5.0 // indirect 53 | golang.org/x/crypto v0.13.0 // indirect 54 | golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect 55 | golang.org/x/net v0.15.0 // indirect 56 | golang.org/x/sys v0.12.0 // indirect 57 | golang.org/x/term v0.12.0 // indirect 58 | golang.org/x/text v0.13.0 // indirect 59 | google.golang.org/protobuf v1.31.0 // indirect 60 | gopkg.in/ini.v1 v1.67.0 // indirect 61 | gopkg.in/yaml.v3 v3.0.1 // indirect 62 | gorm.io/driver/sqlite v1.5.3 // indirect 63 | gorm.io/gorm v1.25.4 // indirect 64 | ) 65 | 66 | replace github.com/rsteube/carapace v0.43.5 => github.com/reeflective/carapace v0.25.2-0.20230816093630-a30f5184fa0d 67 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 7 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 8 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 9 | cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= 10 | cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= 11 | cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= 12 | cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= 13 | cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= 14 | cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= 15 | cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= 16 | cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= 17 | cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= 18 | cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= 19 | cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= 20 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 21 | cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= 22 | cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= 23 | cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= 24 | cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= 25 | cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= 26 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 27 | cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= 28 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 29 | cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= 30 | cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= 31 | cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= 32 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 33 | cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= 34 | cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= 35 | cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= 36 | cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= 37 | cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= 38 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 39 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 40 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 41 | github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0 h1:BVts5dexXf4i+JX8tXlKT0aKoi38JwTXSe+3WUneX0k= 42 | github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0/go.mod h1:FDIQmoMNJJl5/k7upZEnGvgWVZfFeE6qHeN7iCMbCsA= 43 | github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= 44 | github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= 45 | github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= 46 | github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= 47 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 48 | github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= 49 | github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= 50 | github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= 51 | github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= 52 | github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= 53 | github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= 54 | github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= 55 | github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 56 | github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 57 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 58 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= 59 | github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 60 | github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 61 | github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 62 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 63 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 64 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 65 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 66 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 67 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= 68 | github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= 69 | github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 70 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 71 | github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= 72 | github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 73 | github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= 74 | github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= 75 | github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= 76 | github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= 77 | github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= 78 | github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 79 | github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= 80 | github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= 81 | github.com/go-fsnotify/fsnotify v0.0.0-20180321022601-755488143dae h1:PeVNzgTRtWGm6fVic5i21t+n5ptPGCZuMcSPVMyTWjs= 82 | github.com/go-fsnotify/fsnotify v0.0.0-20180321022601-755488143dae/go.mod h1:BbhqyaehKPCLD83cqfRYdm177Ylm1cdGHu3txjbQSQI= 83 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 84 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 85 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 86 | github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= 87 | github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= 88 | github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= 89 | github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= 90 | github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= 91 | github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= 92 | github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= 93 | github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= 94 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 95 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 96 | github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 97 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 98 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 99 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 100 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 101 | github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 102 | github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 103 | github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= 104 | github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 105 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 106 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 107 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 108 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 109 | github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= 110 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 111 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 112 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 113 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 114 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 115 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 116 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 117 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 118 | github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 119 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 120 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 121 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 122 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 123 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 124 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 125 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 126 | github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 127 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 128 | github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 129 | github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 130 | github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 131 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 132 | github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= 133 | github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 134 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 135 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 136 | github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 137 | github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= 138 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 139 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 140 | github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 141 | github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 142 | github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 143 | github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 144 | github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 145 | github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 146 | github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 147 | github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 148 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 149 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 150 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 151 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 152 | github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= 153 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 154 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 155 | github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= 156 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 157 | github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 158 | github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= 159 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 160 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 161 | github.com/jedib0t/go-pretty/v6 v6.4.7 h1:lwiTJr1DEkAgzljsUsORmWsVn5MQjt1BPJdPCtJ6KXE= 162 | github.com/jedib0t/go-pretty/v6 v6.4.7/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= 163 | github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= 164 | github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= 165 | github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= 166 | github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= 167 | github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= 168 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 169 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 170 | github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= 171 | github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= 172 | github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= 173 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 174 | github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= 175 | github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= 176 | github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= 177 | github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= 178 | github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= 179 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 180 | github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= 181 | github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 182 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 183 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 184 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 185 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 186 | github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= 187 | github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= 188 | github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= 189 | github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= 190 | github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 191 | github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 192 | github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= 193 | github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= 194 | github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= 195 | github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= 196 | github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= 197 | github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 198 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 199 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 200 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 201 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= 202 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 203 | github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= 204 | github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= 205 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 206 | github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 207 | github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 208 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 209 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 210 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 211 | github.com/reeflective/carapace v0.25.2-0.20230816093630-a30f5184fa0d h1:RK0OaQs+3CMJnfXc5SNEg+Kbu4A2AVljPuG5/HcaUdM= 212 | github.com/reeflective/carapace v0.25.2-0.20230816093630-a30f5184fa0d/go.mod h1:jkLt41Ne2TD2xPuMdX/2O05Smhy8vMgG7O2TYvC0yOc= 213 | github.com/reeflective/console v0.1.10 h1:dZupNrfLNkFUkrwgaMVIxzhdKOoH58F1R126z8UuoJo= 214 | github.com/reeflective/console v0.1.10/go.mod h1:duk21qTQHR4JZx4t5WtJvOZ7/uTYAyHFBZw50WHQL1Y= 215 | github.com/reeflective/readline v1.0.10 h1:neAdbArjB1f5LZ2JBh/9TZ9ibFUrjjvBS8xuhLbx5do= 216 | github.com/reeflective/readline v1.0.10/go.mod h1:mcD0HxNVJVteVwDm9caXKg52nQACVyfh8EyuBmgVlzY= 217 | github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 218 | github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= 219 | github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= 220 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 221 | github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= 222 | github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= 223 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 224 | github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= 225 | github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= 226 | github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= 227 | github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= 228 | github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= 229 | github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= 230 | github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= 231 | github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= 232 | github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= 233 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 234 | github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= 235 | github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= 236 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 237 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 238 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 239 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 240 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 241 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 242 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 243 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 244 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 245 | github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 246 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 247 | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 248 | github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 249 | github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= 250 | github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 251 | github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= 252 | github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= 253 | github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= 254 | github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= 255 | github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= 256 | github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= 257 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 258 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 259 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 260 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 261 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 262 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 263 | go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 264 | go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 265 | go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 266 | go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= 267 | golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= 268 | golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= 269 | golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= 270 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 271 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 272 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 273 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 274 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 275 | golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= 276 | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 277 | golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= 278 | golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= 279 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 280 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 281 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 282 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 283 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 284 | golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 285 | golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 286 | golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= 287 | golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 288 | golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= 289 | golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= 290 | golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= 291 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 292 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 293 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 294 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 295 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 296 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 297 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 298 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 299 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 300 | golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 301 | golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 302 | golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 303 | golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 304 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 305 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 306 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 307 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 308 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 309 | golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 310 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 311 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 312 | golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 313 | golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 314 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 315 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 316 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 317 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 318 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 319 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 320 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 321 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 322 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 323 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 324 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 325 | golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 326 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 327 | golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 328 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 329 | golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 330 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 331 | golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 332 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 333 | golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 334 | golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 335 | golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 336 | golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 337 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 338 | golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 339 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 340 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 341 | golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 342 | golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 343 | golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 344 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 345 | golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 346 | golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= 347 | golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= 348 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 349 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 350 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 351 | golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 352 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 353 | golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 354 | golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 355 | golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 356 | golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 357 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 358 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 359 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 360 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 361 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 362 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 363 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 364 | golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 365 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 366 | golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 367 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 368 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 369 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 370 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 371 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 372 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 373 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 374 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 375 | golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 376 | golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 377 | golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 378 | golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 379 | golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 380 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 381 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 382 | golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 383 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 384 | golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 385 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 386 | golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 387 | golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 388 | golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 389 | golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 390 | golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 391 | golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 392 | golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 393 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 394 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 395 | golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 396 | golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 397 | golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 398 | golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 399 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 400 | golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 401 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 402 | golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 403 | golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 404 | golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 405 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 406 | golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= 407 | golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 408 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 409 | golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= 410 | golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= 411 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 412 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 413 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 414 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 415 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 416 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 417 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 418 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 419 | golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= 420 | golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 421 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 422 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 423 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 424 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 425 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 426 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 427 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 428 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 429 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 430 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 431 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 432 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 433 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 434 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 435 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 436 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 437 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 438 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 439 | golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 440 | golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 441 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 442 | golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 443 | golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 444 | golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 445 | golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 446 | golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 447 | golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 448 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 449 | golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 450 | golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 451 | golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 452 | golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 453 | golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 454 | golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 455 | golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= 456 | golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= 457 | golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 458 | golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 459 | golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 460 | golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 461 | golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 462 | golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 463 | golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 464 | golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= 465 | golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 466 | golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 467 | golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 468 | golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 469 | golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 470 | golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= 471 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 472 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 473 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 474 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 475 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 476 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 477 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 478 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 479 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 480 | google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 481 | google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 482 | google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 483 | google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 484 | google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 485 | google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 486 | google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= 487 | google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 488 | google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= 489 | google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= 490 | google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 491 | google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= 492 | google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= 493 | google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= 494 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 495 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 496 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 497 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 498 | google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 499 | google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 500 | google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 501 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 502 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 503 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 504 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 505 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 506 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 507 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 508 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 509 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 510 | google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 511 | google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 512 | google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 513 | google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 514 | google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 515 | google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= 516 | google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 517 | google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 518 | google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 519 | google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 520 | google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 521 | google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 522 | google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 523 | google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= 524 | google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= 525 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 526 | google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= 527 | google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 528 | google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 529 | google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 530 | google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 531 | google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 532 | google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 533 | google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 534 | google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 535 | google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 536 | google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 537 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 538 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 539 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 540 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 541 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 542 | google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 543 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 544 | google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 545 | google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= 546 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= 547 | google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 548 | google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 549 | google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 550 | google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= 551 | google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= 552 | google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= 553 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 554 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 555 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 556 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 557 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 558 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 559 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 560 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 561 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 562 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 563 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 564 | google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= 565 | google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 566 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 567 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 568 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 569 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 570 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 571 | gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= 572 | gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 573 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 574 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 575 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 576 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 577 | gorm.io/driver/sqlite v1.5.3 h1:7/0dUgX28KAcopdfbRWWl68Rflh6osa4rDh+m51KL2g= 578 | gorm.io/driver/sqlite v1.5.3/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= 579 | gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= 580 | gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= 581 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 582 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 583 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 584 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 585 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 586 | honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 587 | honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= 588 | nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= 589 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 590 | rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 591 | rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= 592 | rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= 593 | -------------------------------------------------------------------------------- /internal/agent/agent.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/agent/controllers" 5 | "github.com/pygrum/siphon/internal/agent/monitor" 6 | "github.com/pygrum/siphon/internal/logger" 7 | ) 8 | 9 | func Initialize(id, iFace, port, clientCertData string) { 10 | agent := controllers.NewAgent(id, iFace, port, clientCertData) 11 | // person who compiled the agent is the only one who can add and remove users - their username 'root' is special 12 | setupControllers(agent) 13 | scout, err := monitor.NewScout(agent) 14 | if err != nil { 15 | logger.Fatalf("failed to create a new scout: %v", err) 16 | } 17 | if err := scout.Start(); err != nil { 18 | logger.Fatalf("failed to start scout: %v", err) 19 | } 20 | logger.Fatal(scout.RunTLS()) 21 | } 22 | 23 | func setupControllers(agent *controllers.Agent) { 24 | apiRouter := agent.Router.Group("/api") 25 | { 26 | apiRouter.GET("samples", agent.GetSamples) 27 | apiRouter.GET("download", agent.GetSampleByHash) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /internal/agent/controllers/controllers.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "crypto/tls" 5 | "encoding/base64" 6 | "github.com/gin-gonic/gin" 7 | "github.com/pygrum/siphon/internal/agent/utils" 8 | "github.com/pygrum/siphon/internal/db" 9 | "github.com/pygrum/siphon/internal/logger" 10 | "net" 11 | "net/http" 12 | "os" 13 | "time" 14 | ) 15 | 16 | // TODO: Use gin to setup API endpoints, that will be used to (DONE) info about recent samples, and (DONE) samples by hash. 17 | 18 | const ( 19 | StatusOk = "ok" 20 | StatusNotFound = "not_found" 21 | ) 22 | 23 | func NewAgent(id, iFace, port, clientCertData string) *Agent { 24 | certData, err := base64.StdEncoding.DecodeString(clientCertData) 25 | if err != nil { 26 | logger.Fatalf("could not decode client certificate: %v", err) 27 | } 28 | a := &Agent{ 29 | Router: gin.Default(), 30 | ID: id, 31 | ClientCertData: certData, 32 | BindAddress: net.JoinHostPort(iFace, port), 33 | Conn: db.AgentInitialize(), 34 | } 35 | return a 36 | } 37 | 38 | func (a *Agent) RunTLS(tlsConfig *tls.Config) error { 39 | server := &http.Server{ 40 | Addr: a.BindAddress, 41 | Handler: a.Router, 42 | TLSConfig: tlsConfig, 43 | } 44 | return server.ListenAndServeTLS(a.CertFile, a.KeyFile) 45 | } 46 | 47 | func (a *Agent) GetSamples(c *gin.Context) { 48 | // Return samples discovered within the last hour 49 | samples, err := a.Conn.SamplesByTime(time.Now().Add(-1 * time.Hour)) 50 | if err != nil { 51 | c.JSON(http.StatusInternalServerError, SampleResponse{ 52 | Status: err.Error(), 53 | }) 54 | } 55 | c.JSON(http.StatusOK, SampleResponse{ 56 | Status: StatusOk, 57 | Data: samples, 58 | }) 59 | } 60 | 61 | func (a *Agent) GetSampleByHash(c *gin.Context) { 62 | hash := c.Query("sha256_hash") 63 | // Return samples discovered within the last hour 64 | sample, err := a.Conn.SampleByHash(hash) 65 | if err != nil { 66 | c.JSON(http.StatusInternalServerError, SampleResponse{ 67 | Status: err.Error(), 68 | }) 69 | return 70 | } 71 | if sample == nil { 72 | c.JSON(http.StatusOK, SampleResponse{ 73 | Status: StatusNotFound, 74 | }) 75 | return 76 | } 77 | file, err := utils.ZipFile(sample, "infected") 78 | if err != nil { 79 | c.JSON(http.StatusOK, SampleResponse{ 80 | Status: StatusNotFound, 81 | }) 82 | return 83 | } 84 | bytes, err := os.ReadFile(file) 85 | if err != nil { 86 | c.JSON(http.StatusInternalServerError, SampleResponse{ 87 | Status: err.Error(), 88 | }) 89 | return 90 | } 91 | c.Data(http.StatusOK, "application/zip", bytes) 92 | _ = os.Remove(file) 93 | } 94 | -------------------------------------------------------------------------------- /internal/agent/controllers/models.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "github.com/pygrum/siphon/internal/db" 6 | ) 7 | 8 | type Agent struct { 9 | Router *gin.Engine 10 | ID string 11 | BindAddress string 12 | CertFile string 13 | KeyFile string 14 | ClientCertData []byte // Get this at compile time 15 | Conn *db.AgentConn 16 | } 17 | 18 | type SampleResponse struct { 19 | Status string `json:"status"` 20 | Data []db.Sample `json:"data"` 21 | } 22 | -------------------------------------------------------------------------------- /internal/agent/monitor/monitor.go: -------------------------------------------------------------------------------- 1 | package monitor 2 | 3 | import ( 4 | "crypto/sha256" 5 | "crypto/tls" 6 | "crypto/x509" 7 | "fmt" 8 | "github.com/fsnotify/fsnotify" 9 | "github.com/pygrum/siphon/internal/agent/controllers" 10 | "github.com/pygrum/siphon/internal/db" 11 | "github.com/pygrum/siphon/internal/logger" 12 | "github.com/spf13/viper" 13 | "gorm.io/gorm" 14 | "io" 15 | "log" 16 | "os" 17 | "path/filepath" 18 | "time" 19 | ) 20 | 21 | type Scout struct { 22 | Agent *controllers.Agent 23 | Logger *logger.Logger 24 | MonitorPaths []monitorPath 25 | } 26 | 27 | type monitorPath struct { 28 | Path string 29 | Recursive bool 30 | } 31 | 32 | var watcher *fsnotify.Watcher 33 | 34 | func NewScout(agent *controllers.Agent) (*Scout, error) { 35 | var err error 36 | watcher, err = fsnotify.NewWatcher() 37 | if err != nil { 38 | return nil, err 39 | } 40 | var folders []monitorPath 41 | if err := viper.UnmarshalKey("monitor_folders", &folders); err != nil { 42 | return nil, err 43 | } 44 | l, err := logger.NewLogger("./agent_monitor.log") 45 | if err != nil { 46 | return nil, err 47 | } 48 | return &Scout{ 49 | Agent: agent, 50 | MonitorPaths: folders, 51 | Logger: l, 52 | }, nil 53 | } 54 | 55 | func (s *Scout) Start() error { 56 | for _, d := range s.MonitorPaths { 57 | if err := addDirectory(&d); err != nil { 58 | return err 59 | } 60 | } 61 | go s.start() 62 | return nil 63 | } 64 | 65 | func (s *Scout) RunTLS() error { 66 | s.Agent.CertFile = viper.GetString("cert_file") 67 | s.Agent.KeyFile = viper.GetString("key_file") 68 | 69 | cert := s.Agent.ClientCertData 70 | 71 | certPool := x509.NewCertPool() 72 | certPool.AppendCertsFromPEM(cert) 73 | tlsConfig := &tls.Config{ 74 | ClientCAs: certPool, 75 | InsecureSkipVerify: true, 76 | VerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { 77 | certs := make([]*x509.Certificate, len(rawCerts)) 78 | for i, asn1Data := range rawCerts { 79 | cert, err := x509.ParseCertificate(asn1Data) 80 | if err != nil { 81 | return fmt.Errorf("failed to parse certificate: %v", err) 82 | } 83 | certs[i] = cert 84 | } 85 | opts := x509.VerifyOptions{ 86 | Roots: certPool, 87 | CurrentTime: time.Now(), 88 | DNSName: "", // Skip hostname verification 89 | Intermediates: x509.NewCertPool(), 90 | } 91 | 92 | for i, cert := range certs { 93 | if i == 0 { 94 | continue 95 | } 96 | opts.Intermediates.AddCert(cert) 97 | } 98 | _, err := certs[0].Verify(opts) 99 | return err 100 | }, 101 | } 102 | return s.Agent.RunTLS(tlsConfig) 103 | } 104 | 105 | func (s *Scout) start() { 106 | for { 107 | select { 108 | case event := <-watcher.Events: 109 | if event.Has(fsnotify.Create) { 110 | s.Logger.Write(logger.Sinfof("file created: %s", event.Name)) 111 | if err := s.Add(event.Name); err != nil { 112 | s.Logger.Write(logger.Serrorf("failed to add %s to database: %v", event.Name, err)) 113 | } 114 | } else if event.Has(fsnotify.Write) { 115 | s.Logger.Write(logger.Sinfof("file written: %s", event.Name)) 116 | if err := s.Add(event.Name); err != nil { 117 | s.Logger.Write(logger.Serrorf("failed to add %s to database: %v", event.Name, err)) 118 | } 119 | } else if event.Has(fsnotify.Rename) { 120 | s.Logger.Write(logger.Sinfof("file renamed: %s", event.Name)) 121 | } else if event.Has(fsnotify.Remove) { 122 | s.Logger.Write(logger.Sinfof("file removed: %s", event.Name)) 123 | } else { 124 | s.Logger.Write(logger.Sinfof("file mode changed: %s", event.Name)) 125 | } 126 | break 127 | case event := <-watcher.Errors: 128 | s.Logger.Write(logger.Serrorf("error: %s", event.Error())) 129 | break 130 | } 131 | } 132 | } 133 | 134 | func (s *Scout) Add(file string) error { 135 | conn := s.Agent.Conn 136 | fi, err := os.Stat(file) 137 | if err != nil { 138 | return err 139 | } 140 | // Don't save empty files 141 | if fi.Size() == 0 { 142 | return nil 143 | } 144 | // If file caching is on, save copy of file to agent folder (protected) 145 | if viper.GetBool("cache") { 146 | b, _ := os.ReadFile(file) 147 | cwd, _ := os.Getwd() 148 | newFileName := filepath.Join(cwd, filepath.Base(file)) 149 | _ = os.WriteFile(newFileName, b, 0600) 150 | file = newFileName 151 | } 152 | 153 | sample := &db.Sample{ 154 | // Set creation time manually 155 | Model: gorm.Model{ 156 | CreatedAt: fi.ModTime(), 157 | }, 158 | Name: filepath.Base(file), 159 | Path: file, 160 | FileType: filepath.Ext(file)[1:], // Skip the leading '.' 161 | FileSize: uint(fi.Size()), 162 | Source: s.Agent.ID, 163 | Hash: fileHash(file), 164 | UploadTime: fi.ModTime(), 165 | } 166 | return conn.Add(sample) 167 | } 168 | 169 | func fileHash(file string) string { 170 | f, _ := os.Open(file) 171 | defer f.Close() 172 | 173 | h := sha256.New() 174 | if _, err := io.Copy(h, f); err != nil { 175 | log.Fatal(err) 176 | } 177 | return fmt.Sprintf("%x", h.Sum(nil)) 178 | } 179 | 180 | func addDirectory(mp *monitorPath) error { 181 | if !mp.Recursive { 182 | return watcher.Add(mp.Path) 183 | } 184 | // Add folders to watch recursively 185 | return filepath.Walk(mp.Path, func(path string, fi os.FileInfo, err error) error { 186 | if fi.IsDir() { 187 | return watcher.Add(path) 188 | } 189 | return nil 190 | }) 191 | } 192 | -------------------------------------------------------------------------------- /internal/agent/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "bytes" 5 | "github.com/alexmullins/zip" 6 | "github.com/pygrum/siphon/internal/db" 7 | "io" 8 | "os" 9 | ) 10 | 11 | func ZipFile(sample *db.Sample, pass string) (string, error) { 12 | contents, err := os.ReadFile(sample.Path) 13 | if err != nil { 14 | return "", err 15 | } 16 | zipName := sample.Hash + ".zip" 17 | zipFile, err := os.Create(zipName) 18 | if err != nil { 19 | return "", err 20 | } 21 | defer zipFile.Close() 22 | zipWriter := zip.NewWriter(zipFile) 23 | defer zipWriter.Close() 24 | w, err := zipWriter.Encrypt(sample.Name, pass) 25 | if err != nil { 26 | return "", err 27 | } 28 | _, err = io.Copy(w, bytes.NewReader(contents)) 29 | if err != nil { 30 | return "", err 31 | } 32 | return zipName, nil 33 | } 34 | -------------------------------------------------------------------------------- /internal/commands/agents/agents.go: -------------------------------------------------------------------------------- 1 | package agents 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jedib0t/go-pretty/v6/table" 6 | "github.com/pygrum/siphon/internal/db" 7 | "github.com/pygrum/siphon/internal/logger" 8 | ) 9 | 10 | var conn *db.Conn 11 | 12 | func init() { 13 | conn = db.Initialize() 14 | } 15 | 16 | func AgentsCmd() { 17 | // Do nothing if zero sample count 18 | agents := conn.Agents() 19 | if len(agents) == 0 { 20 | logger.Info("no samples loaded - check your internet connection or API configuration") 21 | } else { 22 | RenderTable(agents) 23 | } 24 | } 25 | 26 | func RenderTable(agents []db.Agent) { 27 | t := table.NewWriter() 28 | tmp := table.Table{} 29 | tmp.Render() 30 | 31 | t.SetStyle(table.StyleBold) 32 | 33 | header := table.Row{"ID", "NAME", "ENDPOINT", "CERTIFICATE", "CREATION TIME"} 34 | for _, a := range agents { 35 | row := table.Row{ 36 | a.AgentID, 37 | a.Name, 38 | a.Endpoint, 39 | a.CertPath, 40 | a.CreatedAt, 41 | } 42 | t.AppendRow(row) 43 | } 44 | t.AppendHeader(header) 45 | t.SetAutoIndex(false) 46 | fmt.Println(t.Render()) 47 | } 48 | -------------------------------------------------------------------------------- /internal/commands/agents/set/set.go: -------------------------------------------------------------------------------- 1 | package set 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/db" 5 | "github.com/pygrum/siphon/internal/logger" 6 | ) 7 | 8 | func SetCmd(name, endpoint, certPath string) { 9 | conn := db.Initialize() 10 | a := conn.AgentByName(name) 11 | if a == nil { 12 | a = conn.AgentByID(name) 13 | if a == nil { 14 | logger.Errorf("agent with name/id %s does not exist", name) 15 | return 16 | } 17 | } 18 | if len(endpoint) != 0 { 19 | a.Endpoint = endpoint 20 | } 21 | if len(certPath) != 0 { 22 | a.CertPath = certPath 23 | } 24 | err := conn.Add(a) 25 | if err != nil { 26 | logger.Errorf("failed to update agent fields: %v", err) 27 | return 28 | } 29 | logger.Notify("agent successfully updated") 30 | } 31 | -------------------------------------------------------------------------------- /internal/commands/commands.go: -------------------------------------------------------------------------------- 1 | package commands 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/commands/agents" 5 | "github.com/pygrum/siphon/internal/commands/agents/set" 6 | "github.com/pygrum/siphon/internal/commands/exit" 7 | "github.com/pygrum/siphon/internal/commands/get" 8 | "github.com/pygrum/siphon/internal/commands/info" 9 | "github.com/pygrum/siphon/internal/commands/samples" 10 | "github.com/pygrum/siphon/internal/commands/sources" 11 | "github.com/pygrum/siphon/internal/commands/sources/new" 12 | "github.com/spf13/cobra" 13 | ) 14 | 15 | func Commands() *cobra.Command { 16 | cmd := &cobra.Command{} 17 | 18 | sourcesCmd := &cobra.Command{ 19 | Use: "sources", 20 | Short: "List currently configured threat intelligence sources", 21 | Run: func(cmd *cobra.Command, args []string) { 22 | sources.SourcesCmd() 23 | }, 24 | } 25 | 26 | var newName, newApiKey, newEndpoint string 27 | newCmd := &cobra.Command{ 28 | Use: "new", 29 | Short: "configure a new integration", 30 | Run: func(cmd *cobra.Command, args []string) { 31 | new.NewCmd(newName, newApiKey, newEndpoint) 32 | }, 33 | } 34 | newCmd.Flags().StringVarP(&newName, "name", "n", "", "name of new source") 35 | newCmd.Flags().StringVarP(&newApiKey, "api-key", "k", "", "api key for source") 36 | newCmd.Flags().StringVarP(&newEndpoint, "endpoint", "e", "", "source API endpoint") 37 | _ = cobra.MarkFlagRequired(newCmd.Flags(), "name") 38 | sourcesCmd.AddCommand(newCmd) 39 | 40 | var sampleCount string 41 | var sampleNoTruncate bool 42 | samplesCmd := &cobra.Command{ 43 | Use: "samples", 44 | Short: "List the latest samples found by Siphon - default 5", 45 | Run: func(cmd *cobra.Command, args []string) { 46 | samples.SamplesCmd(sampleCount, sampleNoTruncate) 47 | }, 48 | } 49 | samplesCmd.Flags().StringVarP(&sampleCount, "count", "c", "5", "number of samples to retrieve (use 'all' to retrieve all samples)") 50 | samplesCmd.Flags().BoolVarP(&sampleNoTruncate, "no-truncate", "v", false, "don't truncate sample names") 51 | 52 | var getOut string 53 | var getPersist bool 54 | getCmd := &cobra.Command{ 55 | Use: "get [id|name]", 56 | Short: "Download an indexed sample from its original source", 57 | Args: cobra.ExactArgs(1), 58 | Run: func(cmd *cobra.Command, args []string) { 59 | get.GetCmd(args[0], getOut, getPersist) 60 | }, 61 | } 62 | getCmd.Flags().StringVarP(&getOut, "outfile", "o", "", "the save name of the sample") 63 | getCmd.Flags().BoolVarP(&getPersist, "persist", "p", false, "save the sample to a permanent location") 64 | _ = cobra.MarkFlagRequired(getCmd.Flags(), "id") 65 | 66 | var infoNoTruncate bool 67 | infoCmd := &cobra.Command{ 68 | Use: "info [id...]", 69 | Short: "Get information about 1 or more samples (querying by name or id)", 70 | Args: cobra.MinimumNArgs(1), 71 | Run: func(cmd *cobra.Command, args []string) { 72 | info.InfoCmd(infoNoTruncate, args...) 73 | }, 74 | } 75 | infoCmd.Flags().BoolVarP(&infoNoTruncate, "no-truncate", "v", false, "don't truncate sample names") 76 | 77 | exitCmd := &cobra.Command{ 78 | Use: "exit", 79 | Short: "Exit the application", 80 | Args: cobra.NoArgs, 81 | Run: func(cmd *cobra.Command, args []string) { 82 | exit.ExitCmd() 83 | }, 84 | } 85 | 86 | agentsCmd := &cobra.Command{ 87 | Use: "agents", 88 | Short: "View known agents", 89 | Args: cobra.NoArgs, 90 | Run: func(cmd *cobra.Command, args []string) { 91 | agents.AgentsCmd() 92 | }, 93 | } 94 | 95 | var endpoint, certFile string 96 | setCmd := &cobra.Command{ 97 | Use: "set [id]", 98 | Short: "Configure agent integration parameters", 99 | Args: cobra.ExactArgs(1), 100 | Run: func(cmd *cobra.Command, args []string) { 101 | set.SetCmd(args[0], endpoint, certFile) 102 | }, 103 | } 104 | setCmd.Flags().StringVarP(&endpoint, "endpoint", "e", "", "API endpoint for the agent") 105 | setCmd.Flags().StringVarP(&certFile, "cert-file", "c", "", "path to agent certificate file") 106 | agentsCmd.AddCommand(setCmd) 107 | 108 | cmd.AddCommand(infoCmd) 109 | cmd.AddCommand(getCmd) 110 | cmd.AddCommand(sourcesCmd) 111 | cmd.AddCommand(agentsCmd) 112 | cmd.AddCommand(samplesCmd) 113 | cmd.AddCommand(exitCmd) 114 | 115 | cmd.CompletionOptions.HiddenDefaultCmd = true 116 | 117 | return cmd 118 | } 119 | -------------------------------------------------------------------------------- /internal/commands/exit/exit.go: -------------------------------------------------------------------------------- 1 | package exit 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/logger" 5 | "github.com/spf13/viper" 6 | "os" 7 | ) 8 | 9 | func ExitCmd() { 10 | logger.Notify("Goodbye!") 11 | _ = viper.WriteConfig() 12 | os.Exit(0) 13 | } 14 | -------------------------------------------------------------------------------- /internal/commands/get/get.go: -------------------------------------------------------------------------------- 1 | package get 2 | 3 | import ( 4 | "github.com/pygrum/siphon/cmd/generator/generator" 5 | "github.com/pygrum/siphon/internal/db" 6 | "github.com/pygrum/siphon/internal/integrations/agent" 7 | "github.com/pygrum/siphon/internal/integrations/malwarebazaar" 8 | "github.com/pygrum/siphon/internal/logger" 9 | "github.com/pygrum/siphon/internal/siphon" 10 | "io" 11 | "strconv" 12 | "strings" 13 | ) 14 | 15 | func GetCmd(id, out string, persist bool) { 16 | conn := db.Initialize() 17 | uid, err := strconv.Atoi(id) 18 | spl := &db.Sample{} 19 | if err != nil { 20 | spl = conn.SampleByName(id) 21 | } else { 22 | spl = conn.SampleByID(uint(uid)) 23 | } 24 | if spl == nil { 25 | logger.Errorf("sample '%s': not found", id) 26 | return 27 | } 28 | var fileBytes []byte 29 | if strings.ToLower(spl.Source) == malwarebazaar.Source || generator.IsAgentID(spl.Source) { 30 | if strings.ToLower(spl.Source) == malwarebazaar.Source { 31 | fileBytes = getFromMB(spl) 32 | } else if generator.IsAgentID(spl.Source) { 33 | agt := conn.AgentByID(spl.Source) 34 | if agt == nil { 35 | logger.Errorf("agent AgentID '%s' is not present in database", spl.Source) 36 | return 37 | } 38 | fileBytes = getFromAgent(agt, spl) 39 | } 40 | if fileBytes != nil { 41 | if len(out) == 0 { 42 | out = spl.Hash + "." + spl.FileType + ".zip" // MalwareBazaar returns as zip 43 | } else { 44 | out += ".zip" 45 | } 46 | f, err := siphon.AddFile(out, fileBytes, 0700, persist) 47 | if err != nil { 48 | logger.Errorf("failed to save file to %s: %v", out, err) 49 | return 50 | } 51 | logger.Notifyf("saved as archive to registry (%s)", f) 52 | logger.Notifyf("password: 'infected'") 53 | } 54 | } 55 | } 56 | 57 | func getFromMB(spl *db.Sample) []byte { 58 | f := malwarebazaar.NewFetcher() 59 | if f == nil { 60 | logger.Error("cannot fetch from MalwareBazaar: not configured correctly") 61 | return nil 62 | } 63 | readCloser, err := f.Download(spl.Hash) 64 | if err != nil { 65 | logger.Errorf("download failed: %v", err) 66 | return nil 67 | } 68 | bytes, err := io.ReadAll(readCloser) 69 | if err != nil { 70 | logger.Errorf("cannot read response body: %v", err) 71 | } 72 | return bytes 73 | } 74 | 75 | func getFromAgent(agt *db.Agent, spl *db.Sample) []byte { 76 | f := agent.NewFetcher() 77 | readCloser, err := f.Download(agt, spl.Hash) 78 | if err != nil { 79 | logger.Errorf("download failed: %v", err) 80 | return nil 81 | } 82 | defer readCloser.Close() 83 | bytes, err := io.ReadAll(readCloser) 84 | if err != nil { 85 | logger.Errorf("cannot read response body: %v", err) 86 | } 87 | return bytes 88 | } 89 | -------------------------------------------------------------------------------- /internal/commands/info/info.go: -------------------------------------------------------------------------------- 1 | package info 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/commands/samples" 5 | "github.com/pygrum/siphon/internal/db" 6 | "github.com/pygrum/siphon/internal/logger" 7 | "strconv" 8 | ) 9 | 10 | var conn *db.Conn 11 | 12 | func init() { 13 | conn = db.Initialize() 14 | } 15 | 16 | func InfoCmd(noTrunc bool, ids ...string) { 17 | var sampleList []db.Sample 18 | for _, id := range ids { 19 | uid, err := strconv.Atoi(id) 20 | spl := &db.Sample{} 21 | if err != nil { 22 | spl = conn.SampleByName(id) 23 | } else { 24 | spl = conn.SampleByID(uint(uid)) 25 | } 26 | if spl == nil { 27 | logger.Errorf("sample '%s': not found", id) 28 | return 29 | } 30 | sampleList = append(sampleList, *spl) 31 | } 32 | sampleList = clean(sampleList) 33 | samples.RenderTable(sampleList, noTrunc) 34 | } 35 | 36 | func clean(spls []db.Sample) []db.Sample { 37 | m := make(map[uint]db.Sample) 38 | for _, x := range spls { 39 | m[x.ID] = x 40 | } 41 | var cleaned []db.Sample 42 | for _, v := range m { 43 | cleaned = append(cleaned, v) 44 | } 45 | return cleaned 46 | } 47 | -------------------------------------------------------------------------------- /internal/commands/samples/samples.go: -------------------------------------------------------------------------------- 1 | package samples 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jedib0t/go-pretty/v6/table" 6 | "github.com/pygrum/siphon/internal/db" 7 | "github.com/pygrum/siphon/internal/logger" 8 | "strconv" 9 | "strings" 10 | "time" 11 | ) 12 | 13 | const ( 14 | truncLimit = 40 15 | ) 16 | 17 | var conn *db.Conn 18 | 19 | func init() { 20 | conn = db.Initialize() 21 | } 22 | 23 | func SamplesCmd(sampleCount string, noTrunc bool) { 24 | sc := 0 25 | i, err := strconv.Atoi(sampleCount) 26 | if err != nil { 27 | if strings.ToLower(sampleCount) == "all" { 28 | sc = conn.Count() 29 | } else { 30 | logger.Errorf("valid integer argument required") 31 | return 32 | } 33 | } else { 34 | if i < 0 { 35 | logger.Errorf("valid integer argument required") 36 | return 37 | } 38 | sc = i 39 | } 40 | // Do nothing if zero sample count 41 | if sc > 0 { 42 | samples := conn.Samples(sc) 43 | if len(samples) == 0 { 44 | logger.Info("no samples loaded - check your internet connection or API configuration") 45 | } else { 46 | RenderTable(samples, noTrunc) 47 | } 48 | } 49 | } 50 | 51 | func RenderTable(samples []db.Sample, v bool) { 52 | t := table.NewWriter() 53 | tmp := table.Table{} 54 | tmp.Render() 55 | 56 | t.SetStyle(table.StyleBold) 57 | 58 | header := table.Row{"ID", "NAME", "TYPE", "SIGNATURE", "HASH", "SIZE", "SOURCE", "UPLOADED AT"} 59 | for _, s := range samples { 60 | name := s.Name 61 | if !v { 62 | if len(s.Name) > truncLimit { 63 | name = s.Name[:truncLimit] 64 | name += "..." 65 | } 66 | } 67 | row := table.Row{ 68 | s.ID, 69 | name, 70 | s.FileType, 71 | s.Signature, 72 | s.Hash, 73 | s.FileSize, 74 | s.Source, 75 | s.UploadTime.Format(time.DateTime), 76 | } 77 | t.AppendRow(row) 78 | } 79 | t.AppendHeader(header) 80 | t.SetAutoIndex(false) 81 | fmt.Println(t.Render()) 82 | } 83 | -------------------------------------------------------------------------------- /internal/commands/sources/new/new.go: -------------------------------------------------------------------------------- 1 | package new 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/commands/sources" 5 | "github.com/pygrum/siphon/internal/logger" 6 | "github.com/spf13/viper" 7 | "slices" 8 | "strings" 9 | ) 10 | 11 | func NewCmd(name, apikey, endpoint string) { 12 | name = strings.ToLower(name) 13 | srcs := sources.Sources() 14 | if !slices.Contains(sources.SupportedSources, name) { 15 | logger.Errorf("'%s' integration is not supported", name) 16 | return 17 | } 18 | var update bool 19 | for i, src := range srcs { 20 | if strings.ToLower(src.Name) == name { 21 | update = true 22 | if len(endpoint) != 0 { 23 | src.Endpoint = endpoint 24 | } 25 | if len(apikey) != 0 { 26 | src.ApiKey = apikey 27 | } 28 | srcs[i] = src 29 | break 30 | } 31 | } 32 | if !update { 33 | srcs = append(srcs, sources.Source{ 34 | Name: name, 35 | ApiKey: apikey, 36 | Endpoint: endpoint, 37 | }) 38 | } 39 | viper.Set("sources", srcs) 40 | if err := viper.WriteConfig(); err != nil { 41 | logger.Errorf("failed to save new configuration: %v", err) 42 | } 43 | logger.Notifyf("configuration for %s successfully updated", name) 44 | } 45 | -------------------------------------------------------------------------------- /internal/commands/sources/sources.go: -------------------------------------------------------------------------------- 1 | package sources 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/logger" 5 | "github.com/spf13/viper" 6 | "slices" 7 | "strings" 8 | ) 9 | 10 | var ( 11 | SupportedSources = []string{ 12 | //"virustotal", 13 | "malwarebazaar", 14 | //"hybridanalysis", 15 | //"virusshare", 16 | } 17 | ) 18 | 19 | type Source struct { 20 | Name string `yaml:"name"` 21 | Endpoint string `yaml:"endpoint"` 22 | ApiKey string `yaml:"apikey"` 23 | } 24 | 25 | func Sources() []Source { 26 | var sources []Source 27 | _ = viper.UnmarshalKey("sources", &sources) 28 | return sources 29 | } 30 | 31 | func FindSource(sourceName string) *Source { 32 | var sources []Source 33 | _ = viper.UnmarshalKey("sources", &sources) 34 | if len(sources) == 0 { 35 | return nil 36 | } 37 | for _, s := range sources { 38 | if strings.ToLower(s.Name) == strings.ToLower(sourceName) { 39 | return &s 40 | } 41 | } 42 | return nil 43 | } 44 | 45 | func SourcesCmd() { 46 | var sources []Source 47 | if err := viper.UnmarshalKey("sources", &sources); err != nil { 48 | logger.Errorf("failed to parse configuration file %s: %v\n", viper.ConfigFileUsed(), err) 49 | return 50 | } 51 | if len(sources) == 0 { 52 | logger.Info("no sources configured.") 53 | return 54 | } 55 | for _, s := range sources { 56 | if !slices.Contains(SupportedSources, strings.ToLower(s.Name)) { 57 | logger.Errorf("'%s' is not a supported integration", s.Name) 58 | continue 59 | } 60 | if len(s.ApiKey) == 0 { 61 | logger.Warnf("the API key for %s has not been set", s.Name) 62 | continue 63 | } 64 | if len(s.Endpoint) == 0 { 65 | logger.Warnf("the API endpoint for %s has not been set", s.Name) 66 | continue 67 | } 68 | logger.Notifyf("%s - fully configured", s.Name) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /internal/console/console.go: -------------------------------------------------------------------------------- 1 | package console 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/commands" 5 | "github.com/pygrum/siphon/internal/integrations" 6 | "github.com/reeflective/console" 7 | ) 8 | 9 | type Siphon struct { 10 | Console *console.Console 11 | } 12 | 13 | func Start() { 14 | var s = &Siphon{ 15 | Console: console.New("siphon"), 16 | } 17 | s.setup() 18 | go s.refresh() 19 | _ = s.Console.Start() 20 | } 21 | 22 | func (s *Siphon) setup() { 23 | mainMenu := s.Console.ActiveMenu() 24 | mainMenu.SetCommands(commands.Commands) 25 | prompt := mainMenu.Prompt() 26 | prompt.Primary = func() string { 27 | return "[siphon] " 28 | } 29 | } 30 | 31 | // refresh refreshes sample database every interval 32 | func (s *Siphon) refresh() { 33 | integrations.Refresh() 34 | return 35 | } 36 | -------------------------------------------------------------------------------- /internal/db/db.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/pygrum/siphon/internal/logger" 6 | "github.com/spf13/cobra" 7 | "gorm.io/driver/sqlite" 8 | "gorm.io/gorm" 9 | l "gorm.io/gorm/logger" 10 | "runtime" 11 | "strings" 12 | "sync" 13 | "time" 14 | 15 | "os" 16 | "path/filepath" 17 | ) 18 | 19 | type Conn struct { 20 | File string 21 | DB *gorm.DB 22 | } 23 | 24 | type AgentConn struct { 25 | File string 26 | } 27 | 28 | var m sync.Mutex 29 | 30 | func Initialize() *Conn { 31 | conn := Conn{} 32 | home, err := os.UserHomeDir() 33 | cobra.CheckErr(err) 34 | dbFile := filepath.Join(home, ".siphon", "siphon.db") 35 | if _, err = os.Stat(dbFile); os.IsNotExist(err) { 36 | err := os.WriteFile(dbFile, nil, 0666) 37 | if err != nil { 38 | logger.Fatalf("could not initialize database: %v", err) 39 | } 40 | } 41 | 42 | conn.File = dbFile 43 | db, err := gorm.Open(sqlite.Open(dbFile), &gorm.Config{ 44 | Logger: l.Default.LogMode(l.Silent), 45 | }) 46 | if err != nil { 47 | logger.Fatalf("failed to open database at %s: %v", dbFile, err) 48 | } 49 | _ = db.AutoMigrate(Sample{}, Agent{}) 50 | conn.DB = db 51 | return &conn 52 | } 53 | 54 | func AgentInitialize() *AgentConn { 55 | conn := AgentConn{} 56 | // Safe path to store siphon data based on OS 57 | var RestrictedPath string 58 | switch runtime.GOOS { 59 | case "windows": 60 | RestrictedPath = "C:\\Windows\\System32\\config" 61 | default: 62 | RestrictedPath = "/root" 63 | } 64 | if err := os.Mkdir(filepath.Join(RestrictedPath, ".siphon_agent"), 0700); err != nil && !os.IsExist(err) { 65 | logger.Fatalf("could not create a protected folder in %s: %v", RestrictedPath, err) 66 | } 67 | jsonFile := filepath.Join(RestrictedPath, ".siphon_agent", "agent.json") 68 | if err := os.WriteFile(jsonFile, []byte("[]"), 0600); err != nil { 69 | logger.Fatalf("could not initialise json database: %v", err) 70 | } 71 | conn.File = jsonFile 72 | return &conn 73 | } 74 | 75 | func (conn *Conn) SamplesByTime(dateTime time.Time) []Sample { 76 | var samples []Sample 77 | conn.DB.Where("created_at > ?", dateTime.Format(time.DateTime)).Find(&samples) 78 | return samples 79 | } 80 | func (conn *Conn) Samples(count int) []Sample { 81 | var samples []Sample 82 | conn.DB.Order("upload_time DESC, created_at DESC").Limit(count).Find(&samples) 83 | return samples 84 | } 85 | 86 | func (conn *Conn) Agents() []Agent { 87 | var agents []Agent 88 | conn.DB.Order("created_at DESC").Find(&agents) 89 | return agents 90 | } 91 | 92 | func (conn *Conn) Count() int { 93 | var samples []Sample 94 | var count int64 95 | conn.DB.Find(&samples).Count(&count) 96 | return int(count) 97 | } 98 | 99 | func (conn *Conn) SampleByHash(sha256hash string) *Sample { 100 | sample := &Sample{} 101 | m.Lock() 102 | defer m.Unlock() 103 | conn.DB.Where("hash = ?", sha256hash).First(&sample) 104 | // Return if empty sample received 105 | if (Sample{}) == *sample { 106 | return nil 107 | } 108 | return sample 109 | } 110 | 111 | func (conn *Conn) SampleByName(name string) *Sample { 112 | sample := &Sample{} 113 | m.Lock() 114 | defer m.Unlock() 115 | conn.DB.Where("name = ?", name).First(&sample) 116 | // Return if empty sample received 117 | if (Sample{}) == *sample { 118 | return nil 119 | } 120 | return sample 121 | } 122 | 123 | func (conn *Conn) AgentByID(id string) *Agent { 124 | agent := &Agent{} 125 | m.Lock() 126 | defer m.Unlock() 127 | conn.DB.Where("agent_id = ?", id).First(&agent) 128 | // Return if empty agent received 129 | if (Agent{}) == *agent { 130 | return nil 131 | } 132 | return agent 133 | } 134 | 135 | func (conn *Conn) AgentByName(name string) *Agent { 136 | agent := &Agent{} 137 | m.Lock() 138 | defer m.Unlock() 139 | conn.DB.Where("name = ?", name).First(&agent) 140 | // Return if empty agent received 141 | if (Agent{}) == *agent { 142 | return nil 143 | } 144 | return agent 145 | } 146 | 147 | func (conn *Conn) SampleByID(id uint) *Sample { 148 | sample := &Sample{} 149 | m.Lock() 150 | defer m.Unlock() 151 | conn.DB.Where("id = ?", id).First(sample) 152 | // Return if empty sample received 153 | if (Sample{}) == *sample { 154 | return nil 155 | } 156 | return sample 157 | } 158 | 159 | func (conn *Conn) Add(v interface{}) error { 160 | m.Lock() 161 | defer m.Unlock() 162 | result := conn.DB.Save(v) 163 | return result.Error 164 | } 165 | 166 | func (aConn *AgentConn) Add(s *Sample) error { 167 | samples, err := aConn.Samples() 168 | if err != nil { 169 | return err 170 | } 171 | samples = append(samples, *s) 172 | return aConn.Save(samples) 173 | } 174 | 175 | func (aConn *AgentConn) Save(samples []Sample) error { 176 | bytes, err := json.Marshal(samples) 177 | if err != nil { 178 | return err 179 | } 180 | return os.WriteFile(aConn.File, bytes, 0600) 181 | } 182 | 183 | func (aConn *AgentConn) Samples() ([]Sample, error) { 184 | bytes, err := os.ReadFile(aConn.File) 185 | if err != nil { 186 | return nil, err 187 | } 188 | var samples []Sample 189 | if err = json.Unmarshal(bytes, &samples); err != nil { 190 | return nil, err 191 | } 192 | return samples, nil 193 | } 194 | 195 | func (aConn *AgentConn) SamplesByTime(dateTime time.Time) ([]Sample, error) { 196 | samples, err := aConn.Samples() 197 | if err != nil { 198 | return nil, err 199 | } 200 | var recentSamples []Sample 201 | for _, sample := range samples { 202 | // If it was created after an hour ago 203 | if sample.CreatedAt.After(dateTime) { 204 | recentSamples = append(recentSamples, sample) 205 | } 206 | } 207 | return recentSamples, nil 208 | } 209 | 210 | func (aConn *AgentConn) SampleByHash(sha256hash string) (*Sample, error) { 211 | samples, err := aConn.Samples() 212 | if err != nil { 213 | return nil, err 214 | } 215 | for _, sample := range samples { 216 | if strings.EqualFold(sample.Hash, sha256hash) { 217 | return &sample, nil 218 | } 219 | } 220 | return nil, nil 221 | } 222 | -------------------------------------------------------------------------------- /internal/db/models.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | "time" 6 | ) 7 | 8 | type Sample struct { 9 | gorm.Model 10 | Name string `json:"name"` 11 | Path string `json:"path"` 12 | FileType string `json:"file_type"` 13 | FileSize uint `json:"file_size"` 14 | Signature string `json:"signature"` 15 | Source string `json:"source"` 16 | 17 | Hash string `json:"hash"` 18 | UploadTime time.Time `json:"upload_time"` 19 | } 20 | 21 | type Agent struct { 22 | gorm.Model 23 | AgentID string `yaml:"agent_id"` 24 | Name string `yaml:"name"` 25 | Endpoint string `yaml:"endpoint"` 26 | CertPath string `yaml:"certificate_path"` 27 | } 28 | -------------------------------------------------------------------------------- /internal/integrations/agent/agent.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | import ( 4 | "crypto/tls" 5 | "crypto/x509" 6 | "encoding/json" 7 | "fmt" 8 | "github.com/pygrum/siphon/internal/agent/controllers" 9 | "github.com/pygrum/siphon/internal/db" 10 | "github.com/pygrum/siphon/internal/logger" 11 | "github.com/spf13/viper" 12 | "io" 13 | "net/http" 14 | "net/url" 15 | "os" 16 | "strings" 17 | "time" 18 | ) 19 | 20 | type Fetcher struct { 21 | Agents []db.Agent 22 | Conn *db.Conn 23 | } 24 | 25 | func NewFetcher() *Fetcher { 26 | f := &Fetcher{ 27 | Conn: db.Initialize(), 28 | } 29 | f.Agents = f.Conn.Agents() 30 | return f 31 | } 32 | 33 | func (f *Fetcher) GetRecent() { 34 | for _, agent := range f.Agents { 35 | a := agent 36 | go func(agent *db.Agent) { 37 | resp, _ := f.BasicRequest(agent, "/samples", "", "") 38 | if resp == nil { 39 | return 40 | } 41 | body, _ := io.ReadAll(resp.Body) 42 | respObject := &controllers.SampleResponse{} 43 | if err := json.Unmarshal(body, respObject); err != nil { 44 | logger.Silentf("%v", err) 45 | return 46 | } 47 | if respObject.Status != controllers.StatusOk { 48 | logger.Silentf("request to (%s:%s) returned error %s", agent.Name, agent.AgentID, respObject.Status) 49 | return 50 | } 51 | if err := f.addSamples(respObject); err != nil { 52 | logger.Silentf("failed to add new samples: %v", err) 53 | } 54 | }(&a) 55 | } 56 | } 57 | 58 | func (f *Fetcher) addSamples(r *controllers.SampleResponse) error { 59 | for _, data := range r.Data { 60 | d := data 61 | d.ID = 0 // Unset ID (primary key) to let gorm create normal record 62 | go func(data db.Sample) { 63 | if f.Conn.SampleByHash(data.Hash) == nil { 64 | if err := f.Conn.Add(&data); err != nil { 65 | logger.Silentf("%v", err) 66 | } 67 | } 68 | }(d) 69 | } 70 | return nil 71 | } 72 | 73 | func (f *Fetcher) BasicRequest(a *db.Agent, endpoint, query, form string) (*http.Response, error) { 74 | r, err := http.NewRequest(http.MethodGet, a.Endpoint+endpoint, strings.NewReader(form)) 75 | if err != nil { 76 | logger.Silentf("unable to create new request for (%s:%s): %v", a.Name, a.AgentID, err) 77 | return nil, err 78 | } 79 | r.URL.RawQuery = query 80 | client, err := f.mTLSClient(a) 81 | if err != nil { 82 | logger.Silentf("failed to create mTLS client: %v", err) 83 | return nil, err 84 | } 85 | resp, err := client.Do(r) 86 | if err != nil { 87 | logger.Silentf("request failed: %v", err) 88 | return nil, err 89 | } 90 | return resp, nil 91 | } 92 | 93 | func (f *Fetcher) mTLSClient(agent *db.Agent) (*http.Client, error) { 94 | serverCertFile := agent.CertPath 95 | // Refresh viper configuration 96 | if err := viper.ReadInConfig(); err != nil { 97 | return nil, err 98 | } 99 | certFile, keyFile := viper.GetString("cert_file"), viper.GetString("key_file") 100 | // Read server certificate file and add it to trusted certificate store (certPool). Right now I'm reading my cert instead of the servers 101 | caCert, err := os.ReadFile(serverCertFile) 102 | if err != nil { 103 | return nil, err 104 | } 105 | certPool := x509.NewCertPool() 106 | certPool.AppendCertsFromPEM(caCert) 107 | cert, err := tls.LoadX509KeyPair(certFile, keyFile) 108 | if err != nil { 109 | return nil, err 110 | } 111 | return &http.Client{ 112 | Transport: &http.Transport{ 113 | TLSClientConfig: &tls.Config{ 114 | RootCAs: certPool, 115 | Certificates: []tls.Certificate{cert}, 116 | InsecureSkipVerify: true, 117 | // function from github.com/digitalbitbox/bitbox-wallet-app/backend/coins/btc/electrum/electrum.go#L76-L111 118 | VerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { 119 | certs := make([]*x509.Certificate, len(rawCerts)) 120 | for i, asn1Data := range rawCerts { 121 | cert, err := x509.ParseCertificate(asn1Data) 122 | if err != nil { 123 | return fmt.Errorf("failed to parse certificate: %v", err) 124 | } 125 | certs[i] = cert 126 | } 127 | opts := x509.VerifyOptions{ 128 | Roots: certPool, 129 | CurrentTime: time.Now(), 130 | DNSName: "", // Skip hostname verification 131 | Intermediates: x509.NewCertPool(), 132 | } 133 | 134 | for i, cert := range certs { 135 | if i == 0 { 136 | continue 137 | } 138 | opts.Intermediates.AddCert(cert) 139 | } 140 | _, err := certs[0].Verify(opts) 141 | return err 142 | }, 143 | }, 144 | }, 145 | }, nil 146 | } 147 | 148 | func (f *Fetcher) Download(agent *db.Agent, sha256Hash string) (io.ReadCloser, error) { 149 | q := url.Values{ 150 | "sha256_hash": {sha256Hash}, 151 | } 152 | resp, err := f.BasicRequest(agent, "/download", q.Encode(), "") 153 | if err != nil { 154 | return nil, err 155 | } 156 | // if not application/zip, then its json, meaning request failed 157 | if !strings.EqualFold(resp.Header.Get("content-type"), "application/zip") { 158 | body, err := io.ReadAll(resp.Body) 159 | if err != nil { 160 | return nil, err 161 | } 162 | respObject := &controllers.SampleResponse{} 163 | if err := json.Unmarshal(body, respObject); err != nil { 164 | return nil, err 165 | } 166 | return nil, fmt.Errorf("request to (%s:%s) returned error %s", agent.Name, agent.AgentID, respObject.Status) 167 | } 168 | return resp.Body, nil 169 | } 170 | -------------------------------------------------------------------------------- /internal/integrations/integrations.go: -------------------------------------------------------------------------------- 1 | package integrations 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/integrations/agent" 5 | "github.com/pygrum/siphon/internal/integrations/malwarebazaar" 6 | "github.com/pygrum/siphon/internal/logger" 7 | "github.com/spf13/viper" 8 | "time" 9 | ) 10 | 11 | func Refresh() { 12 | r := viper.GetInt("RefreshRate") 13 | if r < 1 { 14 | logger.Silentf("invalid configuration: refresh rate must be 1 minute or more") 15 | } 16 | ticker := time.NewTicker(time.Duration(r) * time.Minute) 17 | for range ticker.C { 18 | mbFetcher := malwarebazaar.NewFetcher() 19 | if mbFetcher != nil { 20 | go mbFetcher.GetRecent() 21 | } 22 | agFetcher := agent.NewFetcher() 23 | go agFetcher.GetRecent() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/integrations/malwarebazaar/malwarebazaar.go: -------------------------------------------------------------------------------- 1 | package malwarebazaar 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "github.com/gin-gonic/gin/binding" 7 | "github.com/pygrum/siphon/internal/commands/sources" 8 | "github.com/pygrum/siphon/internal/db" 9 | "github.com/pygrum/siphon/internal/logger" 10 | "io" 11 | "net/http" 12 | "net/url" 13 | "strings" 14 | "time" 15 | ) 16 | 17 | const ( 18 | Source = "malwarebazaar" 19 | ) 20 | 21 | func NewFetcher() *Fetcher { 22 | f := &Fetcher{ 23 | Conn: db.Initialize(), 24 | } 25 | mbData := sources.FindSource(Source) 26 | if mbData == nil { 27 | return nil 28 | } 29 | f.Endpoint = mbData.Endpoint 30 | f.ApiKey = mbData.ApiKey 31 | return f 32 | } 33 | 34 | func (f *Fetcher) GetRecent() { 35 | form := url.Values{ 36 | "query": {"get_recent"}, 37 | "selector": {"time"}, 38 | } 39 | resp, _ := f.BasicRequest(form) 40 | if resp == nil { 41 | return 42 | } 43 | body, _ := io.ReadAll(resp.Body) 44 | respObject := &Response{} 45 | if err := json.Unmarshal(body, respObject); err != nil { 46 | logger.Silentf("%v", err) 47 | return 48 | } 49 | if respObject.QueryStatus != "ok" { 50 | logger.Silentf("request to %s returned error %s", Source, respObject.QueryStatus) 51 | return 52 | } 53 | if err := f.addSamples(respObject); err != nil { 54 | logger.Silentf("failed to add new samples: %v", err) 55 | } 56 | } 57 | 58 | func (f *Fetcher) addSamples(r *Response) error { 59 | for _, data := range r.Data { 60 | go func(data Item) { 61 | if f.Conn.SampleByHash(data.Sha256Hash) == nil { 62 | t, err := time.Parse(time.DateTime+" MST", data.FirstSeen+" UTC") 63 | if err != nil { 64 | logger.Silentf("could not parse time %s: %v", data.FirstSeen, err) 65 | t = time.Time{} 66 | } 67 | sample := db.Sample{ 68 | Name: data.FileName, 69 | FileType: data.FileType, 70 | FileSize: data.FileSize, 71 | Signature: data.Signature, 72 | Source: Source, 73 | Hash: data.Sha256Hash, 74 | UploadTime: t, // All times for Bazaar are UTC 75 | } 76 | 77 | if err := f.Conn.Add(&sample); err != nil { 78 | logger.Silentf("%v", err) 79 | } 80 | } 81 | }(data) 82 | } 83 | return nil 84 | } 85 | 86 | func (f *Fetcher) BasicRequest(form url.Values) (*http.Response, error) { 87 | r, err := http.NewRequest(http.MethodPost, f.Endpoint, strings.NewReader(form.Encode())) 88 | if err != nil { 89 | logger.Silentf("unable to create new request for %s: %v", Source, err) 90 | return nil, err 91 | } 92 | r.Header.Add("API-KEY", f.ApiKey) 93 | r.Header.Add("Content-Type", binding.MIMEPOSTForm) 94 | client := &http.Client{} 95 | resp, err := client.Do(r) 96 | 97 | if err != nil { 98 | logger.Silentf("request failed: %v", err) 99 | return nil, err 100 | } 101 | return resp, nil 102 | } 103 | 104 | // Download downloads a sample via the API. It is triggered by the `get` command and returns an 105 | // error on failure 106 | func (f *Fetcher) Download(sha256Hash string) (io.ReadCloser, error) { 107 | form := url.Values{ 108 | "query": {"get_file"}, 109 | "sha256_hash": {sha256Hash}, 110 | } 111 | resp, err := f.BasicRequest(form) 112 | if err != nil { 113 | return nil, err 114 | } 115 | if resp.Header.Get("Content-Type") == "application/json" { 116 | body, err := io.ReadAll(resp.Body) 117 | if err != nil { 118 | return nil, err 119 | } 120 | respObject := &Response{} 121 | if err := json.Unmarshal(body, respObject); err != nil { 122 | return nil, err 123 | } 124 | return nil, fmt.Errorf("request to %s returned error %s", Source, respObject.QueryStatus) 125 | } 126 | return resp.Body, nil 127 | } 128 | -------------------------------------------------------------------------------- /internal/integrations/malwarebazaar/models.go: -------------------------------------------------------------------------------- 1 | package malwarebazaar 2 | 3 | import "github.com/pygrum/siphon/internal/db" 4 | 5 | type Response struct { 6 | QueryStatus string `json:"query_status"` 7 | Data []Item `json:"data"` 8 | } 9 | 10 | type Item struct { 11 | FileName string `json:"file_name"` 12 | FileType string `json:"file_type"` 13 | FileSize uint `json:"file_size"` 14 | Signature string `json:"signature"` 15 | FirstSeen string `json:"first_seen"` 16 | Sha256Hash string `json:"sha256_hash"` 17 | } 18 | 19 | type Fetcher struct { 20 | Endpoint string 21 | ApiKey string 22 | Conn *db.Conn 23 | } 24 | -------------------------------------------------------------------------------- /internal/logger/logger.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | "fmt" 5 | "github.com/spf13/viper" 6 | "os" 7 | "path/filepath" 8 | "time" 9 | ) 10 | 11 | const ( 12 | Reset = "\033[0m" 13 | Red = "\033[31m" 14 | Green = "\033[32m" 15 | Yellow = "\033[33m" 16 | Blue = "\033[34m" 17 | Purple = "\033[35m" 18 | Cyan = "\033[36m" 19 | Gray = "\033[37m" 20 | White = "\033[97m" 21 | ) 22 | 23 | type Logger struct { 24 | LogFile *os.File 25 | } 26 | 27 | func NewLogger(path string) (*Logger, error) { 28 | f, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600) 29 | if err != nil { 30 | return nil, err 31 | } 32 | defer f.Close() 33 | return &Logger{LogFile: f}, nil 34 | } 35 | 36 | func (l *Logger) Write(s string) { 37 | _, _ = l.LogFile.WriteString(time.Now().Format(time.DateTime) + " " + s + "\n") 38 | } 39 | 40 | func Infof(format string, v ...interface{}) { 41 | fmt.Printf(Blue+"[-] "+format+"\n"+Reset, v...) 42 | } 43 | 44 | func Sinfof(format string, v ...interface{}) string { 45 | return fmt.Sprintf(Blue+"[-] "+format+"\n"+Reset, v...) 46 | } 47 | 48 | func Info(v interface{}) { 49 | fmt.Println(Blue+"[-]", v, Reset) 50 | } 51 | 52 | func Fatal(v interface{}) { 53 | fmt.Println(Purple+"[x]", v, Reset) 54 | os.Exit(1) 55 | } 56 | 57 | func Fatalf(format string, v ...interface{}) { 58 | fmt.Printf(Purple+"[x] "+format+"\n"+Reset, v...) 59 | os.Exit(1) 60 | } 61 | 62 | func Notify(v interface{}) { 63 | fmt.Println(Green+"[+]", v, Reset) 64 | } 65 | 66 | func Notifyf(format string, v ...interface{}) { 67 | fmt.Printf(Green+"[+] "+format+"\n"+Reset, v...) 68 | } 69 | 70 | func Warn(v interface{}) { 71 | fmt.Println(Yellow+"[?]", v, Reset) 72 | } 73 | 74 | func Warnf(format string, v ...interface{}) { 75 | fmt.Printf(Yellow+"[?] "+format+"\n"+Reset, v...) 76 | } 77 | 78 | func Error(v interface{}) { 79 | fmt.Println(Red+"[!]", v, Reset) 80 | } 81 | 82 | func Errorf(format string, v ...interface{}) { 83 | fmt.Printf(Red+"[!] "+format+"\n"+Reset, v...) 84 | } 85 | 86 | func Serrorf(format string, v ...interface{}) string { 87 | return fmt.Sprintf(Red+"[!] "+format+"\n"+Reset, v...) 88 | } 89 | 90 | func Silentf(format string, v ...interface{}) { 91 | logFile := filepath.Join( 92 | filepath.Dir(viper.ConfigFileUsed()), 93 | "siphon.log", 94 | ) 95 | f, err := os.OpenFile(logFile, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600) 96 | if err != nil { 97 | return 98 | } 99 | defer f.Close() 100 | _, err = f.WriteString(time.Now().Format(time.DateTime) + " " + fmt.Sprintf(format, v...) + "\n") 101 | if err != nil { 102 | return 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /internal/siphon/siphon.go: -------------------------------------------------------------------------------- 1 | package siphon 2 | 3 | import ( 4 | "github.com/pygrum/siphon/internal/logger" 5 | "os" 6 | "path/filepath" 7 | ) 8 | 9 | var siphon struct { 10 | rootDir string 11 | sampleDir string 12 | tmpDir string 13 | } 14 | 15 | func root() string { 16 | home, err := os.UserHomeDir() 17 | if err != nil { 18 | return "" 19 | } 20 | return filepath.Join(home, ".siphon") 21 | } 22 | 23 | func init() { 24 | siphon.rootDir = root() 25 | siphon.sampleDir = filepath.Join(siphon.rootDir, "samples") 26 | siphon.tmpDir = filepath.Join(os.TempDir(), "samples") 27 | } 28 | 29 | func fullPath(samplePath string) string { 30 | return filepath.Join(siphon.sampleDir, samplePath) 31 | } 32 | 33 | func fullTmpPath(samplePath string) string { 34 | return filepath.Join(siphon.tmpDir, samplePath) 35 | } 36 | 37 | func AddFile(path string, data []byte, perm os.FileMode, persist bool) (string, error) { 38 | full := fullTmpPath(path) 39 | if persist { 40 | full = fullPath(path) 41 | } 42 | if _, err := os.Stat(filepath.Dir(full)); os.IsNotExist(err) { 43 | err := os.MkdirAll(filepath.Dir(full), 0700) 44 | if err != nil { 45 | logger.Silentf("failed to create parent folders: %v", err) 46 | return "", err 47 | } 48 | } 49 | return full, os.WriteFile(full, data, perm) 50 | } 51 | -------------------------------------------------------------------------------- /internal/version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import "strings" 4 | 5 | const ( 6 | versionMajor = "2" 7 | versionMinor = "0" 8 | versionPatch = "0" 9 | ) 10 | 11 | func VersionString() string { 12 | return "v" + strings.Join([]string{versionMajor, versionMinor, versionPatch}, ".") 13 | } 14 | -------------------------------------------------------------------------------- /scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | read -p "both Go & Make must be installed before proceeding. Have you installed both? y/N " yn 6 | 7 | case $yn in 8 | y | Y) 9 | echo "proceeding with installation" 10 | ;; 11 | *) 12 | echo "please install golang and make first, as they are requirements." 13 | exit 1 14 | ;; 15 | esac 16 | 17 | BASEDIR=$(dirname "$0") 18 | NAME="siphon" 19 | HOMEPATH=${HOME}/.siphon 20 | 21 | if [ ! -d "${HOMEPATH}" ]; then 22 | echo "creating home folder..." 23 | mkdir "${HOMEPATH}" 24 | echo "created home folder at ${HOMEPATH}" 25 | else 26 | echo "home folder ${HOMEPATH} already exists - exiting" 27 | exit 1 28 | fi 29 | 30 | echo "generating x509 key pair..." 31 | bash "${BASEDIR}/keygen.sh" "$NAME" 32 | 33 | OLDPATH=${PWD} 34 | SRCPATH=$(cd "${BASEDIR}/.." && pwd) 35 | 36 | echo "moving key pair to home folder..." 37 | mv "${NAME}.crt" "${HOMEPATH}/${NAME}.crt" 38 | mv "${NAME}.key" "${HOMEPATH}/${NAME}.key" 39 | echo "done" 40 | 41 | echo "copying source to siphon home folder..." 42 | cp -r "${SRCPATH}" "${HOMEPATH}" 43 | echo "copied" 44 | echo "generating configuration file..." 45 | 46 | CONFIG="${HOMEPATH}/.siphon.yaml" 47 | echo "refreshrate: 1" >> "$CONFIG" 48 | echo "cert_file: ${HOMEPATH}/${NAME}.crt" >> "$CONFIG" 49 | echo "key_file: ${HOMEPATH}/${NAME}.key" >> "$CONFIG" 50 | 51 | echo "building the binary - please wait..." 52 | make build 53 | mv siphon ${HOME}/.local/bin 54 | if ! command -v siphon &> /dev/null; then 55 | mkdir -p "${HOME}/.local/bin" 2>/dev/null 56 | echo 'export PATH=$PATH:$HOME/.local/bin' >> "${HOME}/.profile" 57 | fi 58 | echo "done" 59 | echo "installation complete" 60 | echo "logout and log back in for changes to take effect" 61 | cd "${OLDPATH}" 62 | -------------------------------------------------------------------------------- /scripts/keygen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | NAME="$1" 6 | 7 | # Set cert names to siphon if name not provided 8 | if [ $# -lt 1 ]; then 9 | NAME="siphon" 10 | fi 11 | 12 | openssl req -newkey rsa:4096 \ 13 | -x509 \ 14 | -sha256 \ 15 | -days 3650 \ 16 | -nodes \ 17 | -out "${NAME}.crt" \ 18 | -keyout "${NAME}.key" \ 19 | -subj "/C=US/ST=New York/L=New York City/O=${NAME}/OU=${NAME}/CN=www.${NAME}.com" 20 | 21 | echo "key pair saved at ${NAME}.crt (certificate) and ${NAME}.key (key)" 22 | -------------------------------------------------------------------------------- /scripts/setup_agent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | BASEDIR=$(dirname "$0") 6 | BINFILE="$1" 7 | HOMEDIR="${HOME}/.siphon" 8 | NAME="agent" 9 | 10 | if [ $# -ne 1 ]; then 11 | echo "invalid usage" 12 | echo "usage: ${0} " 13 | exit 1 14 | fi 15 | 16 | OLDDIR=${PWD} 17 | cd "${BASEDIR}/.." 18 | 19 | mkdir "agent_files" 20 | cp "$BINFILE" "agent_files" 21 | cd "agent_files" 22 | 23 | echo "generating agent keys..." 24 | bash ../scripts/keygen.sh "$NAME" 25 | 26 | echo "done" 27 | 28 | AGENT_FOLDER="$(md5sum "$BINFILE" | cut -f1 -d' ')" 29 | mkdir "${HOMEDIR}/${AGENT_FOLDER}" 30 | echo "created agent folder: ${HOMEDIR}/${AGENT_FOLDER} - saving agent certificate to folder..." 31 | cp "${NAME}.crt" "${HOMEDIR}/${AGENT_FOLDER}" 32 | echo "done. configure Siphon to use this certificate for this agent (agents set --cert-file=${HOMEDIR}/${AGENT_FOLDER}/${NAME}.crt)" 33 | 34 | echo "generating default configuration file..." 35 | echo 'cache: true' >> config.yaml 36 | echo "cert_file: /root/${NAME}.crt" >> config.yaml 37 | echo "key_file: /root/${NAME}.key" >> config.yaml 38 | echo "monitor_folders:" >> config.yaml 39 | echo ' - path: "/tmp"' >> config.yaml 40 | echo ' recursive: true' >> config.yaml 41 | echo "saved as config.yaml" 42 | 43 | echo "agent files saved to directory 'agent_files'" 44 | echo "follow the guide at https://github.com/pygrum/siphon/blob/main/docs/DOCS.md to finish configuring the agent." 45 | cd ${OLDDIR} 46 | --------------------------------------------------------------------------------