Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d241c0356e | ||
|
|
a2e6e48c46 | ||
|
|
a5b4f13300 | ||
|
|
16462eeace | ||
|
|
e7e7f05e66 | ||
|
|
af75a06f9e | ||
|
|
7670e2bfe8 | ||
|
|
a42a15d6d6 | ||
|
|
915faf6210 | ||
|
|
3193de8d17 | ||
|
|
b08dc73390 | ||
|
|
f6e45d7212 | ||
|
|
945e9f99f3 | ||
|
|
c5394b9793 | ||
|
|
7138f0c855 | ||
|
|
8c49ae85ed | ||
|
|
7c01299e53 | ||
|
|
533f2da29a | ||
|
|
c267b1ae6e | ||
|
|
84f639a9d3 | ||
|
|
12f420400f | ||
|
|
043ecd7672 | ||
|
|
befbd51522 | ||
|
|
418c4e757f | ||
|
|
69319f0d2b | ||
|
|
0005f1ac0c | ||
|
|
ff2922cf1e | ||
|
|
5dbd07dc03 | ||
|
|
599fa22429 | ||
|
|
24a6522d57 | ||
|
|
da38973037 | ||
|
|
8f74edd7c8 | ||
|
|
e264da7a9f | ||
|
|
8889dce37c | ||
|
|
2cb3a54d2c | ||
|
|
d80ff0f277 | ||
|
|
7672655c5d | ||
|
|
4bd6226cc5 | ||
|
|
ed11390873 | ||
|
|
0a23b8ef0f | ||
|
|
61f240317a | ||
|
|
f30d60adb1 | ||
|
|
bc5555706d | ||
|
|
7e9513f98b | ||
|
|
091ad54010 | ||
|
|
9bd5050ca8 | ||
|
|
eea70f22e6 | ||
|
|
852b1813d9 | ||
|
|
df259e3f78 | ||
|
|
d4d7c679aa | ||
|
|
c10d83d24a | ||
|
|
f8859d17d0 | ||
|
|
4f0254ac1d | ||
|
|
baf495e62a | ||
|
|
e469ba1bc7 | ||
|
|
501123df34 | ||
|
|
3eeb933231 | ||
|
|
b65cda4099 | ||
|
|
4e6477f213 | ||
|
|
690e9d6f44 | ||
|
|
01bed4d730 | ||
|
|
51f6ed4c70 | ||
|
|
63735cde1d | ||
|
|
7949886c25 | ||
|
|
19dac734af | ||
|
|
9f76de2a11 | ||
|
|
838c576e99 | ||
|
|
71435c1d67 | ||
|
|
5f219e9f0d | ||
|
|
cf23b95af1 | ||
|
|
8b8815d2f2 | ||
|
|
1a3458ebdd | ||
|
|
93071eef5b | ||
|
|
887f166f30 | ||
|
|
19c02ef270 | ||
|
|
b0c9d73755 | ||
|
|
ec6e1f5f43 | ||
|
|
2893166bde | ||
|
|
6186eb2786 | ||
|
|
245686ec71 | ||
|
|
91fed9c763 | ||
|
|
e5587f043a | ||
|
|
d1558438cf | ||
|
|
6155ebf062 | ||
|
|
1f794377e5 | ||
|
|
f32d9a80b0 | ||
|
|
fcafab05d1 | ||
|
|
c8d028fcd4 | ||
|
|
3543ded23e | ||
|
|
c9751c9d51 | ||
|
|
8e205bb9fd | ||
|
|
4a779eef9f | ||
|
|
a54239f971 | ||
|
|
9078060e65 |
No files matched your search
@@ -1,3 +1,5 @@
|
||||
### v3.4.0
|
||||
* Добавлена команда `config audit` — отчёт по legacy: SECRET-переменные, referenced в UI-экспонируемых полях активных конфигураций (тег `x-ui-exposed` в схеме); код выхода `1` при нарушениях
|
||||
### v3.3.1
|
||||
* увеличены таймауты обращения к `isp-config-service`
|
||||
### v3.3.0
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
- [ispctl schema](#ispctl-schema)
|
||||
- [ispctl merge](#ispctl-merge)
|
||||
- [ispctl gitget](#ispctl-gitget)
|
||||
- [ispctl config audit](#ispctl-config-audit)
|
||||
- [ispctl vars](#ispctl-vars)
|
||||
- [ispctl vars get](#ispctl-vars-get)
|
||||
- [ispctl vars list](#ispctl-vars-list)
|
||||
@@ -37,6 +38,7 @@ ispctl [flag...] get module_name property_path [local_flag]
|
||||
ispctl [flag...] set module_name property_path [new_object]
|
||||
ispctl [flag...] delete module_name property_path
|
||||
ispctl [flag...] schema module_name [local_flag]
|
||||
ispctl [flag...] config audit [local_flag]
|
||||
ispctl [flag...] vars get variable_name
|
||||
ispctl [flag...] vars list
|
||||
ispctl [flag...] vars set [local_flag] variable_name variable_value
|
||||
@@ -55,6 +57,7 @@ ispctl [flag...] vars upload csv_filepath
|
||||
| `merge` | поблочно производит слияние конфигурации модуля с json конфигом через stdin |
|
||||
| `gitget` | скачивает из репозитория указанный файлы с указанного комита |
|
||||
| `schema` | возвращает схему конфигурации указанного модуля |
|
||||
| `config audit` | находит в активных конфигурациях SECRET-переменные, referenced в UI-экспонируемых полях (теги `x-ui-exposed` в схеме); код выхода `1`, если нарушения найдены |
|
||||
| `vars get` | выводит информацию о переменной в json формате |
|
||||
| `vars list` | выводит список переменных в виде ASCII-таблицы |
|
||||
| `vars set` | изменяет значение переменной |
|
||||
@@ -81,6 +84,7 @@ ispctl [flag...] vars upload csv_filepath
|
||||
| Локальные флаги | Параметры | Команды | Описание |
|
||||
| --------------- | --------- | -------- |------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `-o` | string | schema | определяет формат вывода схемы в stdout; по умолчанию `json`; возможные значения `json`, `html` |
|
||||
| `-o` | string | config audit | определяет формат вывода аудита в stdout; возможные значения `json` |
|
||||
| `-full` | bool | get | осуществляет взаимодействие с объектами конфигурации модуля с учетом объектом общих конфигураций, которые имеют связь с модулем |
|
||||
| `-secret` | bool | vars set | устанавливает тип переменной в SECRET |
|
||||
| | | | |
|
||||
@@ -389,6 +393,52 @@ ispctl merge example < example.json
|
||||
ispctl gitget git@github.com:integration-system/ispctl.git main.go d4d7c679aad47ae204c2b3a4587b032a723fe315
|
||||
```
|
||||
|
||||
### ispctl config audit
|
||||
|
||||
`ispctl [flag...] config audit [local_flag]`
|
||||
|
||||
Проверяет активные конфигурации всех модулей: находит UI-экспонируемые поля (тег `x-ui-exposed` в схеме модуля), в которых активная конфигурация ссылается на SECRET-переменные. Такие значения уже рендерились в браузеры модулей, поэтому найденные переменные нужно ротировать.
|
||||
|
||||
`[local_flag]` - локальный флаг `-o` определяет формат вывода. Доступные значения: `json`.
|
||||
По умолчанию вывод осуществляется в виде таблицы.
|
||||
|
||||
Если нарушения найдены, код выхода `1`, иначе `0`.
|
||||
|
||||
Запрос
|
||||
```bash
|
||||
ispctl config audit
|
||||
```
|
||||
Ответ
|
||||
```bash
|
||||
MODULE | PATH | VARIABLES
|
||||
isp-admin-service | $.oauth.clients[].clientSecret | oauth_secret
|
||||
isp-admin-service | $.secrets | legacy_token
|
||||
found 2 violation(s); affected values were already rendered into module browsers, rotate the variables
|
||||
```
|
||||
Запрос
|
||||
```bash
|
||||
ispctl config audit -o json
|
||||
```
|
||||
Ответ
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Module": "isp-admin-service",
|
||||
"Path": "$.oauth.clients[].clientSecret",
|
||||
"Variables": [
|
||||
"oauth_secret"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Module": "isp-admin-service",
|
||||
"Path": "$.secrets",
|
||||
"Variables": [
|
||||
"legacy_token"
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### ispctl vars
|
||||
#### ispctl vars get
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"ispctl/command/utils"
|
||||
"ispctl/model"
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
const (
|
||||
tableHeaderAuditModule = "MODULE"
|
||||
tableHeaderAuditPath = "PATH"
|
||||
tableHeaderAuditVariables = "VARIABLES"
|
||||
tableHeaderAuditReason = "REASON"
|
||||
|
||||
auditExitCode = 1
|
||||
)
|
||||
|
||||
var outPrintAuditUsage = fmt.Sprintf("out print for audit; %s", OutPrintJsonValue)
|
||||
|
||||
type AuditService interface {
|
||||
Audit() ([]model.AuditViolation, error)
|
||||
}
|
||||
|
||||
type Audit struct {
|
||||
service AuditService
|
||||
}
|
||||
|
||||
func NewAudit(service AuditService) Audit {
|
||||
return Audit{service: service}
|
||||
}
|
||||
|
||||
func (c Audit) Command() *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "config",
|
||||
Usage: "config commands",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "audit",
|
||||
Usage: "report secret policy violations in active configs: SECRET references in ui-exposed fields and plain or non-SECRET values in sensitive fields",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{Name: OutPrintFlagName, Usage: outPrintAuditUsage},
|
||||
},
|
||||
Action: c.audit,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (c Audit) audit(ctx *cli.Context) error {
|
||||
violations, err := c.service.Audit()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch ctx.String(OutPrintFlagName) {
|
||||
case OutPrintJsonValue:
|
||||
err = utils.PrintAnswer(violations)
|
||||
default:
|
||||
table := tablewriter.NewWriter(os.Stdout)
|
||||
table.SetBorders(tablewriter.Border{Left: false, Top: false, Right: false, Bottom: false})
|
||||
table.SetHeader([]string{tableHeaderAuditModule, tableHeaderAuditPath, tableHeaderAuditVariables, tableHeaderAuditReason})
|
||||
for _, violation := range violations {
|
||||
table.Append([]string{violation.Module, violation.Path, strings.Join(violation.Variables, ", "), violation.Reason})
|
||||
}
|
||||
table.Render()
|
||||
fmt.Printf("found %d violation(s); rotate the affected SECRET variables and move sensitive values to SECRET variable references\n", len(violations))
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(violations) > 0 {
|
||||
return cli.Exit("secret policy violations found in active configs", auditExitCode)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -13,6 +13,7 @@ type AutoComplete interface {
|
||||
}
|
||||
|
||||
type ConfigService interface {
|
||||
Audit() ([]model.AuditViolation, error)
|
||||
CreateUpdateConfig(stringToChange string, configuration *model.Config) (map[string]any, error)
|
||||
CreateUpdateConfigV2(configuration *model.Config) (map[string]any, error)
|
||||
DeleteVariable(variableName string) error
|
||||
@@ -37,6 +38,7 @@ func AllCommands(configService ConfigService, autoComplete AutoComplete) []*cli.
|
||||
merge := NewMerge(configService, autoComplete)
|
||||
gitGet := NewGitGet()
|
||||
variables := NewVariables(configService, autoComplete)
|
||||
audit := NewAudit(configService)
|
||||
return []*cli.Command{
|
||||
status.Command(),
|
||||
get.Command(),
|
||||
@@ -46,6 +48,7 @@ func AllCommands(configService ConfigService, autoComplete AutoComplete) []*cli.
|
||||
merge.Command(),
|
||||
gitGet.Command(),
|
||||
variables.Command(),
|
||||
audit.Command(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module ispctl
|
||||
|
||||
go 1.24
|
||||
go 1.27
|
||||
|
||||
require (
|
||||
github.com/go-git/go-billy/v5 v5.6.0
|
||||
@@ -10,10 +10,10 @@ require (
|
||||
github.com/tidwall/gjson v1.17.3
|
||||
github.com/tidwall/sjson v1.2.5
|
||||
github.com/txix-open/bellows v1.2.0
|
||||
github.com/txix-open/isp-kit v1.44.0
|
||||
github.com/txix-open/isp-kit v1.31.5-0.20261127095759-c39408f3bd58
|
||||
github.com/urfave/cli/v2 v2.27.5
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422
|
||||
google.golang.org/grpc v1.69.4
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f
|
||||
google.golang.org/grpc v1.85.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -22,63 +22,65 @@ require (
|
||||
github.com/ProtonMail/go-crypto v1.0.0 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/buger/jsonparser v1.6.1 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/coder/websocket v1.8.12 // indirect
|
||||
github.com/coder/websocket v1.8.15 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.5 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.4.4 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/mailru/easyjson v0.9.0 // indirect
|
||||
github.com/klauspost/compress v1.20.4 // indirect
|
||||
github.com/mailru/easyjson v0.9.2 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/pandatix/go-abnf v0.5.5 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/prometheus/client_golang v1.20.5 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.60.1 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/prometheus/client_golang v1.25.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.3 // indirect
|
||||
github.com/prometheus/common v0.74.0 // indirect
|
||||
github.com/prometheus/procfs v0.23.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/skeema/knownhosts v1.2.2 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/txix-open/etp/v4 v4.0.1 // indirect
|
||||
github.com/txix-open/jsonschema v1.2.0 // indirect
|
||||
github.com/txix-open/etp/v4 v4.1.3 // indirect
|
||||
github.com/txix-open/jsonschema v1.3.0 // indirect
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.33.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/otel v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/log v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.47.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/crypto v0.32.0 // indirect
|
||||
golang.org/x/mod v0.17.0 // indirect
|
||||
golang.org/x/net v0.34.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/sys v0.29.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
|
||||
google.golang.org/protobuf v1.36.2 // indirect
|
||||
go.uber.org/zap v1.28.0 // indirect
|
||||
golang.org/x/crypto v0.59.0 // indirect
|
||||
golang.org/x/mod v0.42.0 // indirect
|
||||
golang.org/x/net v0.63.0 // indirect
|
||||
golang.org/x/sync v0.25.0 // indirect
|
||||
golang.org/x/sys v0.50.0 // indirect
|
||||
golang.org/x/text v0.44.0 // indirect
|
||||
golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f // indirect
|
||||
google.golang.org/protobuf v1.36.12 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
@@ -13,35 +13,36 @@ github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPn
|
||||
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
github.com/buger/jsonparser v1.6.1 h1:I0phFv0PlbLHnM7TZAVjZ2MJ2/eWRTDyuO7GLR98IEs=
|
||||
github.com/buger/jsonparser v1.6.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
|
||||
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
|
||||
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
|
||||
github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
|
||||
github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
|
||||
github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNUA=
|
||||
github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo=
|
||||
github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
|
||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
|
||||
github.com/getsentry/sentry-go v0.31.1 h1:ELVc0h7gwyhnXHDouXkhqTFSO5oslsRDk0++eyE0KJ4=
|
||||
github.com/getsentry/sentry-go v0.31.1/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY=
|
||||
github.com/gabriel-vasile/mimetype v1.4.16 h1:5izNFuvA37st1dDRAcA7TtmngBmRgiIPDmTtiEvjx1E=
|
||||
github.com/gabriel-vasile/mimetype v1.4.16/go.mod h1:3oFFwxX8kTklZwzIl2aQEDZT0lKY8xH92ST88bAwba4=
|
||||
github.com/getsentry/sentry-go v0.50.0 h1:gkO59rn/i0RCAXUUTflC5QVbTQGPXbaFabs2olVzc9g=
|
||||
github.com/getsentry/sentry-go v0.50.0/go.mod h1:+xsDuN+SoRN/xfs1hdq78wnrE3omIZf+FCuh9FOW1C8=
|
||||
github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE=
|
||||
github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
|
||||
github.com/go-faker/faker/v4 v4.12.0 h1:yZXxuoQjxN+C2PVgYoDSHGiD9wj6dX1/Ful4p7QQV0k=
|
||||
github.com/go-faker/faker/v4 v4.12.0/go.mod h1:VFIEwWDd16EdYDLF6NJ5gAAzEp7vz5LgKgJ2iZ17Tdg=
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
|
||||
github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8=
|
||||
@@ -51,33 +52,35 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod
|
||||
github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
|
||||
github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8=
|
||||
github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/locales v0.14.2 h1:d8UmcrM6Nip0hfGZKLGpAvZH37XB4TS0xzK9B56YNCY=
|
||||
github.com/go-playground/locales v0.14.2/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.2 h1:LCsMLC9RzmbUMNUPVYD15dmcjwYAJhmX8mPZRW4rAVU=
|
||||
github.com/go-playground/universal-translator v0.18.2/go.mod h1:67VZIMp5lQpDWlnStOct22q1bkdJGJqHghbOtmkawxk=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 h1:vzlTzzi4tHLa/JQdIE5LeXw6SEX5EVVhq/VPqKHnKOk=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0/go.mod h1:FHXQZnW5pA0txiMr3jApv9uNJzZ+7mYZd+u+PPenCFU=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
|
||||
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI=
|
||||
github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
@@ -87,12 +90,14 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
|
||||
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
github.com/leodido/go-urn v1.5.0 h1:pLqT2kq1zpHW/1D18QMjMpdtX7cekxqtJJjg5ANyWw0=
|
||||
github.com/leodido/go-urn v1.5.0/go.mod h1:9BORnCDhdPBJNDEX+w1bJisa8yOKYi116VeO96s4ifE=
|
||||
github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M=
|
||||
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
@@ -104,22 +109,23 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
|
||||
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
|
||||
github.com/pandatix/go-abnf v0.5.5 h1:EXex5KkRQx4Dm6GnpAcQnIMBs9KiK0uf8p/wq+4t9PM=
|
||||
github.com/pandatix/go-abnf v0.5.5/go.mod h1:AE0KD3/VNoCjGzc1gqetRKshbI4SYErXQ/8kPenR5mc=
|
||||
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
|
||||
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
|
||||
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
|
||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
||||
github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
|
||||
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
|
||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/prometheus/client_golang v1.25.0 h1:cDtW1TcFsMi1RJc8khwCKB4VhzwV04aKqbYtNOXuiK0=
|
||||
github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1T317VpCIQEml8LTKk=
|
||||
github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo=
|
||||
github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM=
|
||||
github.com/prometheus/common v0.74.0 h1:6iYW8MsYvmEnXFD9zLGgF0qmReaRhs3OMONu1c/nrLI=
|
||||
github.com/prometheus/common v0.74.0/go.mod h1:i/02C+FCst5B1etKgWesNrD49n+onplJCqUCtUKkOeA=
|
||||
github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4=
|
||||
github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
||||
@@ -138,8 +144,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
|
||||
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
|
||||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94=
|
||||
github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
@@ -151,14 +157,14 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
|
||||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
|
||||
github.com/txix-open/bellows v1.2.0 h1:CXv8nQaZtB/micraeRilYyj/gtfv+bqBgP5aPYQgjeY=
|
||||
github.com/txix-open/bellows v1.2.0/go.mod h1:qbKCy+RTgD30Qpw1fyb3y3jp5Y9mGhLLxgae1l0W92o=
|
||||
github.com/txix-open/etp/v4 v4.0.1 h1:5VSYgGsvnMz0tvUHsjVWFETI0qWBTCF1O3ARCHaCIgA=
|
||||
github.com/txix-open/etp/v4 v4.0.1/go.mod h1:FIu7TUDdwcgmtmF6tFTV1bGA2fRY/iVaPQdsGzvqYc8=
|
||||
github.com/txix-open/isp-kit v1.44.0 h1:ao16vgZ/cdbO4sZWYXD4VcJQ+984IQvb/A80mEjU504=
|
||||
github.com/txix-open/isp-kit v1.44.0/go.mod h1:BHRF3AYRcQtEtNvoQZXxTVj/CYOVMKhOcCD3n8CdsxE=
|
||||
github.com/txix-open/jsonschema v1.2.0 h1:B8TrdSsPhDvYv67oi/LVqf7/+PuqFlMsNwUzGeHfl1s=
|
||||
github.com/txix-open/jsonschema v1.2.0/go.mod h1:l8YDZ1nvJrw6uxWowSVOxCV/ebiMJyapffW87ZEqH00=
|
||||
github.com/txix-open/validator/v10 v10.0.0-20240401163703-e83541b40f99 h1:Z0Sqf+U+Sc6hfIXtRCIZlbJprkCjwMFbS4ZbEPQ44To=
|
||||
github.com/txix-open/validator/v10 v10.0.0-20240401163703-e83541b40f99/go.mod h1:pA0NYmhL0uEkkxj55S+S7MZU4e2QIt46x9XSrzrWc3c=
|
||||
github.com/txix-open/etp/v4 v4.1.3 h1:u9ZyU2yKGgoQ1/DSaElhazWm8xASdqGEdWjoJ2xQlfo=
|
||||
github.com/txix-open/etp/v4 v4.1.3/go.mod h1:9GK+Aje8BmLFq8Hk4j6Qb976LdU9WECCWAuLK1vAKgM=
|
||||
github.com/txix-open/isp-kit v1.31.5-0.20261127095759-c39408f3bd58 h1:huhPwzaU5BBwfhXD0vkBNBNv1xhjvAvplEZ/dOK1osQ=
|
||||
github.com/txix-open/isp-kit v1.31.5-0.20261127095759-c39408f3bd58/go.mod h1:hR9iAlh3x9gEg5GfALrrkN/2SbGkgZQCmwO2GZWjC1M=
|
||||
github.com/txix-open/jsonschema v1.3.0 h1:XGuOTg22G7PdqfKypjajM20/i5FyGfFYsJKmheebKi4=
|
||||
github.com/txix-open/jsonschema v1.3.0/go.mod h1:l8YDZ1nvJrw6uxWowSVOxCV/ebiMJyapffW87ZEqH00=
|
||||
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3 h1:1jE11HLmMHDYYAcE+UmQ5VHgz4stzz0+daJbDWS+sEs=
|
||||
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3/go.mod h1:Yf41v210LFyYAj+tGmDh7PHdGsTaZjdBzHG0ptUvihw=
|
||||
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
|
||||
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
|
||||
@@ -168,43 +174,51 @@ github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw=
|
||||
go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 h1:wpMfgF8E1rkrT1Z6meFh1NDtownE9Ii3n3X2GJYjsaU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0/go.mod h1:wAy0T/dUbs468uOlkT31xjvqQgEVXv58BRFWEgn5v/0=
|
||||
go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ=
|
||||
go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M=
|
||||
go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM=
|
||||
go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
|
||||
go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=
|
||||
go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
|
||||
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
|
||||
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0 h1:jva1c3z2ZFEQ5sTvnLG2tBALNehO+QvdXKQii6eKRoo=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0/go.mod h1:3pjFS5EnOVfjvYO6/NMdtJFHFQR+8uiGtrZ965nZP4w=
|
||||
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
|
||||
go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38=
|
||||
go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI=
|
||||
go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw=
|
||||
go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY=
|
||||
go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU=
|
||||
go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I=
|
||||
go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw=
|
||||
go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM=
|
||||
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 h1:SCrPqH9NE5CmBrOqpjNCiT0X5mGwMyGERXdogfR7Yjw=
|
||||
go.opentelemetry.io/proto/otlp v1.11.1/go.mod h1:wq8W4aSf6bOy8RZyESOeQFr9Pu7wydWX/TY4sgvrTPg=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
|
||||
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
|
||||
go.yaml.in/yaml/v2 v2.4.5 h1:a5nxWvYi94DRl6QSLlTbLpVmutgx2qg8EVjnJtuFpwI=
|
||||
go.yaml.in/yaml/v2 v2.4.5/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
|
||||
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
|
||||
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
|
||||
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
|
||||
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
|
||||
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
|
||||
golang.org/x/exp v0.0.0-20261113113407-e3970619a1a4 h1:lfvjMWyv5q5oJgIhGfBDf7Szvu8POtgSpMy2XbXlEFs=
|
||||
golang.org/x/exp v0.0.0-20261113113407-e3970619a1a4/go.mod h1:J3U+E8RzytcGvwz+uJuAP4zULJ2TkAQBnmPZMexpdXs=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg=
|
||||
golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
@@ -212,13 +226,13 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
||||
golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0=
|
||||
golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
|
||||
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -232,15 +246,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
|
||||
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
|
||||
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
|
||||
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
|
||||
golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk=
|
||||
golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
@@ -248,23 +262,25 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
|
||||
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a h1:Yqozs0FNPRoPGS4hNGlrNwRENWr5H5nVG9sN/f+5640=
|
||||
golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1:GVIKPyP/kLIyVOgOnTwFOrvQaQUzOzGMCxgFUOEmm24=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4=
|
||||
google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
|
||||
google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
|
||||
google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
|
||||
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
|
||||
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f h1:7CbYDSDM5xqpq8v2tNm+Q057COf1lvA0gorVk+304tY=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f/go.mod h1:CPxXEEQ1S9iJmInAF/8MNc8tKWnya8I8Kni9Zh2hV0M=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f h1:aDW6Vb2T1K0xbAgW+ED8iz39WlgjjX/OKiNh6tXv/+g=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
|
||||
google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw=
|
||||
google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ=
|
||||
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
|
||||
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// AuditModule is a module with its raw config schema; the raw form keeps the
|
||||
// x-ui-exposed keyword that a typed unmarshal may drop.
|
||||
type AuditModule struct {
|
||||
Id string
|
||||
Name string
|
||||
ConfigSchema json.RawMessage
|
||||
}
|
||||
|
||||
// AuditViolation names a config field that violates the secret policy in the
|
||||
// module's active config: a UI-exposed field referencing a SECRET variable,
|
||||
// or a sensitive field holding a plain value or a non-SECRET reference.
|
||||
type AuditViolation struct {
|
||||
Module string
|
||||
Path string
|
||||
Variables []string
|
||||
Reason string
|
||||
}
|
||||
@@ -11,6 +11,8 @@ const (
|
||||
SecretVariableType = "SECRET"
|
||||
TextVariableType = "TEXT"
|
||||
|
||||
ErrCodeModuleNotFound = 2001
|
||||
ErrCodeConfigNotFound = 2002
|
||||
ErrCodeVariableNotFound = 2006
|
||||
)
|
||||
|
||||
|
||||
+21
-9
@@ -50,6 +50,17 @@ func (c Config) GetAvailableConfigs() ([]model.ModuleInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (c Config) GetAuditModules() ([]model.AuditModule, error) {
|
||||
response := make([]model.AuditModule, 0)
|
||||
err := c.cli.Invoke(getAvailableConfigs).
|
||||
JsonResponseBody(&response).
|
||||
Do(c.baseCtx)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "call %s", getAvailableConfigs)
|
||||
}
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (c Config) GetConfigByModuleName(name string) (*model.Config, error) {
|
||||
request := &model.GetModuleByUuidAndNameRequest{ModuleName: name}
|
||||
response := new(model.Config)
|
||||
@@ -57,14 +68,15 @@ func (c Config) GetConfigByModuleName(name string) (*model.Config, error) {
|
||||
JsonRequestBody(request).
|
||||
JsonResponseBody(&response).
|
||||
Do(c.baseCtx)
|
||||
switch {
|
||||
case status.Code(err) == codes.NotFound:
|
||||
return nil, model.ErrModuleNotFound
|
||||
case err != nil:
|
||||
return nil, errors.WithMessagef(err, "call %s", getConfigByModuleName)
|
||||
default:
|
||||
if err == nil {
|
||||
return response, nil
|
||||
}
|
||||
if apiError := apierrors.FromError(err); apiError != nil {
|
||||
if apiError.ErrorCode == model.ErrCodeModuleNotFound || apiError.ErrorCode == model.ErrCodeConfigNotFound {
|
||||
return nil, model.ErrModuleNotFound
|
||||
}
|
||||
}
|
||||
return nil, errors.WithMessagef(err, "call %s", getConfigByModuleName)
|
||||
}
|
||||
|
||||
func (c Config) CreateUpdateConfig(request model.Config) (*model.Config, error) {
|
||||
@@ -162,17 +174,17 @@ func (c Config) handleCreateUpdateConfigError(err error) error {
|
||||
apiErr := apierrors.FromError(err)
|
||||
if apiErr != nil {
|
||||
for field, desc := range apiErr.Details {
|
||||
stringBuilder.WriteString(fmt.Sprintf("%s | %s\n", field, desc))
|
||||
fmt.Fprintf(&stringBuilder, "%s | %s\n", field, desc)
|
||||
}
|
||||
} else {
|
||||
for _, detail := range errorStatus.Details() {
|
||||
switch d := detail.(type) {
|
||||
case *epb.BadRequest:
|
||||
for _, violation := range d.FieldViolations {
|
||||
stringBuilder.WriteString(fmt.Sprintf("%s | %s\n", violation.Field, violation.Description))
|
||||
fmt.Fprintf(&stringBuilder, "%s | %s\n", violation.Field, violation.Description)
|
||||
}
|
||||
default:
|
||||
stringBuilder.WriteString(fmt.Sprint(d))
|
||||
fmt.Fprint(&stringBuilder, d)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"ispctl/model"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/rc"
|
||||
"github.com/txix-open/isp-kit/rc/schema"
|
||||
)
|
||||
|
||||
// Audit reports the active configs that reference SECRET variables on
|
||||
// UI-exposed fields. Those values were already rendered into module browsers,
|
||||
// so the variables must be rotated.
|
||||
func (c Config) Audit() ([]model.AuditViolation, error) {
|
||||
modules, err := c.configRepo.GetAuditModules()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
variables, err := c.configRepo.GetAllVariables()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
secrets := make(map[string]struct{}, len(variables))
|
||||
for _, variable := range variables {
|
||||
if variable.Type == model.SecretVariableType {
|
||||
secrets[variable.Name] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
violations := make([]model.AuditViolation, 0)
|
||||
for _, module := range modules {
|
||||
configuration, err := c.configRepo.GetConfigByModuleName(module.Name)
|
||||
if err != nil {
|
||||
if errors.Is(err, model.ErrModuleNotFound) {
|
||||
continue // no active config — nothing to audit
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
moduleViolations, err := auditModule(module.Name, module.ConfigSchema, configuration.Data, secrets)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "module [%s]", module.Name)
|
||||
}
|
||||
violations = append(violations, moduleViolations...)
|
||||
}
|
||||
|
||||
sort.Slice(violations, func(i, j int) bool {
|
||||
if violations[i].Module != violations[j].Module {
|
||||
return violations[i].Module < violations[j].Module
|
||||
}
|
||||
return violations[i].Path < violations[j].Path
|
||||
})
|
||||
return violations, nil
|
||||
}
|
||||
|
||||
// auditModule returns the violations of a single module: UI-exposed paths whose
|
||||
// config references SECRET variables, and sensitive paths whose config value
|
||||
// is not a single reference to a SECRET variable. The schema and the config
|
||||
// are read with the shared isp-kit readers, in the same currency as the
|
||||
// config-service secret policy. The reference report covers every string
|
||||
// leaf, including composite JSON strings (report-only in stage 1).
|
||||
func auditModule(moduleName string, schemaData json.RawMessage, configData map[string]any, secrets map[string]struct{}) ([]model.AuditViolation, error) {
|
||||
var uiPaths, sensitivePaths []string
|
||||
if len(schemaData) > 0 {
|
||||
var err error
|
||||
uiPaths, err = schema.UIExposedPaths(schemaData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sensitivePaths, err = schema.SensitivePaths(schemaData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
uiSet := make(map[string]struct{}, len(uiPaths))
|
||||
for _, path := range uiPaths {
|
||||
uiSet[path] = struct{}{}
|
||||
}
|
||||
|
||||
configBytes, err := json.Marshal(configData)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "marshal config data")
|
||||
}
|
||||
refs, err := rc.VariableRefReport(configBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
violations := make([]model.AuditViolation, 0)
|
||||
for path, names := range refs {
|
||||
if _, isUI := uiSet[path]; !isUI {
|
||||
continue
|
||||
}
|
||||
secretNames := make([]string, 0, len(names))
|
||||
for _, name := range names {
|
||||
if _, isSecret := secrets[name]; isSecret {
|
||||
secretNames = append(secretNames, name)
|
||||
}
|
||||
}
|
||||
if len(secretNames) == 0 {
|
||||
continue
|
||||
}
|
||||
sort.Strings(secretNames)
|
||||
violations = append(violations, model.AuditViolation{
|
||||
Module: moduleName,
|
||||
Path: path,
|
||||
Variables: secretNames,
|
||||
Reason: "secret variable in ui-exposed field",
|
||||
})
|
||||
}
|
||||
|
||||
if len(sensitivePaths) > 0 {
|
||||
sensitiveSet := make(map[string]struct{}, len(sensitivePaths))
|
||||
for _, path := range sensitivePaths {
|
||||
sensitiveSet[path] = struct{}{}
|
||||
}
|
||||
values, err := leafValues(configBytes, sensitiveSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, path := range sensitivePaths {
|
||||
value, exists := values[path]
|
||||
if !exists || value == "" {
|
||||
continue // absent or empty field
|
||||
}
|
||||
if name, isRef := rc.SingleVariableRef(value); isRef {
|
||||
if _, isSecret := secrets[name]; isSecret {
|
||||
continue // a reference to a SECRET variable is compliant
|
||||
}
|
||||
violations = append(violations, model.AuditViolation{
|
||||
Module: moduleName,
|
||||
Path: path,
|
||||
Variables: []string{name},
|
||||
Reason: fmt.Sprintf("references non-SECRET variable %s", name),
|
||||
})
|
||||
continue
|
||||
}
|
||||
// A plain value, including composite JSON strings, is reported
|
||||
// (report-only in stage 1, the write policy does not apply to
|
||||
// composite strings).
|
||||
violations = append(violations, model.AuditViolation{
|
||||
Module: moduleName,
|
||||
Path: path,
|
||||
Variables: []string{},
|
||||
Reason: "plain value in sensitive field",
|
||||
})
|
||||
}
|
||||
}
|
||||
return violations, nil
|
||||
}
|
||||
|
||||
// leafValues collects the raw values of the config's string leaves located at
|
||||
// the given canonical paths.
|
||||
func leafValues(data []byte, paths map[string]struct{}) (map[string]string, error) {
|
||||
values := make(map[string]string, len(paths))
|
||||
_, err := rc.TransformStringLeaves(data, func(path, value string) string {
|
||||
if _, want := paths[path]; want {
|
||||
values[path] = value
|
||||
}
|
||||
return value
|
||||
})
|
||||
return values, err
|
||||
}
|
||||
+19
-5
@@ -4,18 +4,32 @@ import (
|
||||
"encoding/json"
|
||||
|
||||
"ispctl/model"
|
||||
"ispctl/repository"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/rc/schema"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
enableUnsafe bool
|
||||
configRepo repository.Config
|
||||
// configRepo is the config-service API surface consumed by Config. It is an
|
||||
// interface so tests can substitute a fake; production passes the concrete
|
||||
// repository.Config, which satisfies it.
|
||||
type configRepo interface {
|
||||
GetAvailableConfigs() ([]model.ModuleInfo, error)
|
||||
GetAuditModules() ([]model.AuditModule, error)
|
||||
GetConfigByModuleName(name string) (*model.Config, error)
|
||||
CreateUpdateConfig(request model.Config) (*model.Config, error)
|
||||
GetSchemaByModuleId(moduleId string) (*model.ConfigSchema, error)
|
||||
GetAllVariables() ([]model.Variable, error)
|
||||
GetVariableByName(variableName string) (*model.Variable, error)
|
||||
UpsertVariables(request []model.UpsertVariableRequest) error
|
||||
DeleteVariable(variableName string) error
|
||||
}
|
||||
|
||||
func NewConfig(enableUnsafe bool, configRepo repository.Config) Config {
|
||||
type Config struct {
|
||||
enableUnsafe bool
|
||||
configRepo configRepo
|
||||
}
|
||||
|
||||
func NewConfig(enableUnsafe bool, configRepo configRepo) Config {
|
||||
return Config{
|
||||
enableUnsafe: enableUnsafe,
|
||||
configRepo: configRepo,
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
package tests_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"ispctl/model"
|
||||
"ispctl/service"
|
||||
)
|
||||
|
||||
// fakeConfigRepo implements the service.configRepo contract with static data;
|
||||
// only the methods used by Audit are backed by real values.
|
||||
type fakeConfigRepo struct {
|
||||
modules []model.AuditModule
|
||||
configs map[string]*model.Config // keyed by module name
|
||||
variables []model.Variable
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) GetAvailableConfigs() ([]model.ModuleInfo, error) {
|
||||
return nil, errors.New("not used in tests")
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) GetAuditModules() ([]model.AuditModule, error) {
|
||||
return r.modules, nil
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) GetConfigByModuleName(name string) (*model.Config, error) {
|
||||
config, ok := r.configs[name]
|
||||
if !ok {
|
||||
return nil, model.ErrModuleNotFound
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) CreateUpdateConfig(request model.Config) (*model.Config, error) {
|
||||
return nil, errors.New("not used in tests")
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) GetSchemaByModuleId(moduleId string) (*model.ConfigSchema, error) {
|
||||
return nil, errors.New("not used in tests")
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) GetAllVariables() ([]model.Variable, error) {
|
||||
return r.variables, nil
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) GetVariableByName(variableName string) (*model.Variable, error) {
|
||||
return nil, model.ErrVariableNotFound
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) UpsertVariables(request []model.UpsertVariableRequest) error {
|
||||
return errors.New("not used in tests")
|
||||
}
|
||||
|
||||
func (r *fakeConfigRepo) DeleteVariable(variableName string) error {
|
||||
return errors.New("not used in tests")
|
||||
}
|
||||
|
||||
// secretAndTextVariables is the default variable set: s1 is SECRET, t1 is TEXT.
|
||||
func secretAndTextVariables() []model.Variable {
|
||||
return []model.Variable{
|
||||
{Name: "s1", Type: model.SecretVariableType},
|
||||
{Name: "t1", Type: model.TextVariableType},
|
||||
}
|
||||
}
|
||||
|
||||
// objectSchema marshals a properties map into a minimal JSON schema.
|
||||
func objectSchema(t *testing.T, properties map[string]any) json.RawMessage {
|
||||
t.Helper()
|
||||
schema, err := json.Marshal(map[string]any{
|
||||
"type": "object",
|
||||
"properties": properties,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return schema
|
||||
}
|
||||
|
||||
// auditFixture wires a single module m1 through the public Audit API and
|
||||
// returns its violations.
|
||||
func auditFixture(t *testing.T, schemaData json.RawMessage, configData map[string]any) []model.AuditViolation {
|
||||
t.Helper()
|
||||
repo := &fakeConfigRepo{
|
||||
modules: []model.AuditModule{{Id: "id-1", Name: "m1", ConfigSchema: schemaData}},
|
||||
configs: map[string]*model.Config{"m1": {Name: "m1", Data: configData}},
|
||||
variables: secretAndTextVariables(),
|
||||
}
|
||||
violations, err := service.NewConfig(false, repo).Audit()
|
||||
if err != nil {
|
||||
t.Fatalf("Audit: %v", err)
|
||||
}
|
||||
return violations
|
||||
}
|
||||
|
||||
func requireAuditViolations(t *testing.T, got, want []model.AuditViolation) {
|
||||
t.Helper()
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("violations = %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAuditModuleIntersection(t *testing.T) {
|
||||
t.Parallel()
|
||||
schema := objectSchema(t, map[string]any{
|
||||
"ui": map[string]any{"type": "string", "x-ui-exposed": true},
|
||||
"plain": map[string]any{"type": "string"},
|
||||
})
|
||||
configData := map[string]any{
|
||||
"ui": "_Var(s1) _Var(t1)",
|
||||
"plain": "_Var(s1)",
|
||||
}
|
||||
|
||||
violations := auditFixture(t, schema, configData)
|
||||
// Only the UI leaf with the secret reference is reported; the same
|
||||
// reference in the plain leaf and the TEXT reference in the UI leaf are
|
||||
// not.
|
||||
want := []model.AuditViolation{{
|
||||
Module: "m1",
|
||||
Path: "$.ui",
|
||||
Variables: []string{"s1"},
|
||||
Reason: "secret variable in ui-exposed field",
|
||||
}}
|
||||
requireAuditViolations(t, violations, want)
|
||||
}
|
||||
|
||||
func TestAuditModuleSecretOutsideUI(t *testing.T) {
|
||||
t.Parallel()
|
||||
schema := objectSchema(t, map[string]any{
|
||||
"plain": map[string]any{"type": "string"},
|
||||
})
|
||||
|
||||
violations := auditFixture(t, schema, map[string]any{"plain": "_Var(s1)"})
|
||||
if len(violations) != 0 {
|
||||
t.Fatalf("violations = %v, want none: a secret outside ui-exposed fields is not a violation", violations)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAuditModuleArrayPath(t *testing.T) {
|
||||
t.Parallel()
|
||||
schema := objectSchema(t, map[string]any{
|
||||
"clients": map[string]any{
|
||||
"type": "array",
|
||||
"items": map[string]any{"type": "string", "x-ui-exposed": true},
|
||||
},
|
||||
})
|
||||
configData := map[string]any{
|
||||
"clients": []any{"_Var(s1)", "nope"},
|
||||
}
|
||||
|
||||
violations := auditFixture(t, schema, configData)
|
||||
want := []model.AuditViolation{{Module: "m1", Path: "$.clients[]", Variables: []string{"s1"}, Reason: "secret variable in ui-exposed field"}}
|
||||
requireAuditViolations(t, violations, want)
|
||||
}
|
||||
|
||||
func TestAuditModuleCompositeReported(t *testing.T) {
|
||||
// the report covers references hidden inside composite JSON strings
|
||||
// (report-only in stage 1, the policy itself does not apply to them)
|
||||
t.Parallel()
|
||||
schema := objectSchema(t, map[string]any{
|
||||
"secrets": map[string]any{"type": "string", "x-ui-exposed": true},
|
||||
})
|
||||
composite, err := json.Marshal(map[string]any{"a": "_Var(s1)"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
configData := map[string]any{
|
||||
"secrets": string(composite),
|
||||
}
|
||||
|
||||
violations := auditFixture(t, schema, configData)
|
||||
want := []model.AuditViolation{{Module: "m1", Path: "$.secrets", Variables: []string{"s1"}, Reason: "secret variable in ui-exposed field"}}
|
||||
requireAuditViolations(t, violations, want)
|
||||
}
|
||||
|
||||
func TestAuditModuleEmptySchema(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
violations := auditFixture(t, nil, map[string]any{"a": "_Var(s1)"})
|
||||
if len(violations) != 0 {
|
||||
t.Fatalf("violations = %v, want none: an empty schema exposes no fields", violations)
|
||||
}
|
||||
}
|
||||
|
||||
func sensitiveTestSchema(t *testing.T) json.RawMessage {
|
||||
t.Helper()
|
||||
schema, err := json.Marshal(map[string]any{
|
||||
"type": "object",
|
||||
"properties": map[string]any{
|
||||
"token": map[string]any{"type": "string", "x-sensitive": true},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return schema
|
||||
}
|
||||
|
||||
func TestAuditModuleSensitiveLiteral(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
violations := auditFixture(t, sensitiveTestSchema(t), map[string]any{"token": "legacy-pass-123"})
|
||||
want := []model.AuditViolation{{
|
||||
Module: "m1",
|
||||
Path: "$.token",
|
||||
Variables: []string{},
|
||||
Reason: "plain value in sensitive field",
|
||||
}}
|
||||
requireAuditViolations(t, violations, want)
|
||||
}
|
||||
|
||||
func TestAuditModuleSensitiveNonSecretRef(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
violations := auditFixture(t, sensitiveTestSchema(t), map[string]any{"token": "_Var(t1)"})
|
||||
want := []model.AuditViolation{{
|
||||
Module: "m1",
|
||||
Path: "$.token",
|
||||
Variables: []string{"t1"},
|
||||
Reason: "references non-SECRET variable t1",
|
||||
}}
|
||||
requireAuditViolations(t, violations, want)
|
||||
}
|
||||
|
||||
func TestAuditModuleSensitiveCompliant(t *testing.T) {
|
||||
for name, config := range map[string]string{
|
||||
"secret reference": `{"token": "_Var(s1)"}`,
|
||||
"empty value": `{"token": ""}`,
|
||||
"absent field": `{}`,
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var configData map[string]any
|
||||
if err := json.Unmarshal([]byte(config), &configData); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
violations := auditFixture(t, sensitiveTestSchema(t), configData)
|
||||
if len(violations) != 0 {
|
||||
t.Fatalf("violations = %v, want none", violations)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestAuditModuleBothClasses(t *testing.T) {
|
||||
t.Parallel()
|
||||
schema := objectSchema(t, map[string]any{
|
||||
"secrets": map[string]any{"type": "string", "x-ui-exposed": true},
|
||||
"token": map[string]any{"type": "string", "x-sensitive": true},
|
||||
})
|
||||
configData := map[string]any{"secrets": "_Var(s1)", "token": "plain-pass"}
|
||||
|
||||
violations := auditFixture(t, schema, configData)
|
||||
want := []model.AuditViolation{
|
||||
{Module: "m1", Path: "$.secrets", Variables: []string{"s1"}, Reason: "secret variable in ui-exposed field"},
|
||||
{Module: "m1", Path: "$.token", Variables: []string{}, Reason: "plain value in sensitive field"},
|
||||
}
|
||||
requireAuditViolations(t, violations, want)
|
||||
}
|
||||
|
||||
func TestAuditSkipsModuleWithoutActiveConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
repo := &fakeConfigRepo{
|
||||
modules: []model.AuditModule{{Id: "id-1", Name: "m1", ConfigSchema: sensitiveTestSchema(t)}},
|
||||
variables: secretAndTextVariables(),
|
||||
}
|
||||
// no entry in repo.configs: GetConfigByModuleName reports ErrModuleNotFound
|
||||
violations, err := service.NewConfig(false, repo).Audit()
|
||||
if err != nil {
|
||||
t.Fatalf("Audit: %v", err)
|
||||
}
|
||||
if len(violations) != 0 {
|
||||
t.Fatalf("violations = %v, want none: a module without an active config is skipped", violations)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user