Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Drop UPDATE privileges on audits table #1966

Merged
merged 1 commit into from
Mar 31, 2021
Merged
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
11 changes: 11 additions & 0 deletions pkg/database/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,17 @@ func (db *Database) Migrations(ctx context.Context) []*gormigrate.Migration {
DROP COLUMN allow_admin_user_report`)
},
},
{
ID: "00100-DropPrivilege",
Migrate: func(tx *gorm.DB) error {
return multiExec(tx,
`REVOKE UPDATE ON TABLE audit_entries FROM CURRENT_USER`)
},
Rollback: func(tx *gorm.DB) error {
return multiExec(tx,
`GRANT UPDATE ON TABLE audit_entries TO CURRENT_USER`)
},
},
}
}

Expand Down