Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nais/cli

go 1.26.5
go 1.26.6

tool (
github.com/Khan/genqlient
Expand Down
12 changes: 12 additions & 0 deletions internal/postgres/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func validateAuditFlags(ctx context.Context, info *CloudSQLDBInfo) error {
"cloudsql.enable_pgaudit",
"pgaudit.log",
"pgaudit.log_parameter",
"pgaudit.log_relation",
}

err = validateRequiredFlags(dbFlags, requiredFlags)
Expand Down Expand Up @@ -255,6 +256,17 @@ func verifyAuditAsAppUser(ctx context.Context, appName, team, environment string
}
out.Printf(" ✅ Flag <info>pgaudit.log_parameter</info> = <info>%s</info>\n", logParameter)

logRelation, relationExists := dbFlags["pgaudit.log_relation"]
if !relationExists {
out.Println(" ❌ Flag <info>pgaudit.log_relation</info> is missing")
return false, fmt.Errorf("pgaudit.log_relation flag is not set")
}
if logRelation != "on" && logRelation != "true" {
out.Printf(" ❌ Flag <info>pgaudit.log_relation</info>: expected <info>on</info>, got <info>%s</info>\n", logRelation)
return false, fmt.Errorf("pgaudit.log_relation must be set to 'on'")
}
out.Printf(" ✅ Flag <info>pgaudit.log_relation</info> = <info>%s</info>\n", logRelation)

db, err := sql.Open("cloudsqlpostgres", connectionInfo.ProxyConnectionString())
if err != nil {
return false, fmt.Errorf("error connecting to database: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion mise/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tools]
git-cliff = "2.10.1"
go = "1.26.5"
go = "1.26.6"
golangci-lint = "2.12.2"
yamlfmt = "0.17.2"

Expand Down
Loading