敏感设置增加访问审计
This commit is contained in:
1 parent
eff4143fd6
commit
afb7e2f0d9
12 files changed
+348
-5
No files matched your search
@@ -0,0 +1,14 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE IF NOT EXISTS security_audit_logs (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
user_id BIGINT NOT NULL,
|
||||
action VARCHAR(128) NOT NULL,
|
||||
resource VARCHAR(255) NOT NULL,
|
||||
keys_json TEXT NOT NULL,
|
||||
outcome VARCHAR(32) NOT NULL DEFAULT 'accepted',
|
||||
created_at BIGINT NOT NULL,
|
||||
INDEX idx_security_audit_logs_user_created (user_id, created_at, id)
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE IF EXISTS security_audit_logs;
|
||||
@@ -0,0 +1,16 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE IF NOT EXISTS security_audit_logs (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
user_id BIGINT NOT NULL,
|
||||
action VARCHAR(128) NOT NULL,
|
||||
resource VARCHAR(255) NOT NULL,
|
||||
keys_json TEXT NOT NULL DEFAULT '[]',
|
||||
outcome VARCHAR(32) NOT NULL DEFAULT 'accepted',
|
||||
created_at BIGINT NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_security_audit_logs_user_created
|
||||
ON security_audit_logs(user_id, created_at DESC, id DESC);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE IF EXISTS security_audit_logs;
|
||||
@@ -0,0 +1,16 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE IF NOT EXISTS security_audit_logs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
user_id INTEGER NOT NULL,
|
||||
action TEXT NOT NULL,
|
||||
resource TEXT NOT NULL,
|
||||
keys_json TEXT NOT NULL DEFAULT '[]',
|
||||
outcome TEXT NOT NULL DEFAULT 'accepted',
|
||||
created_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_security_audit_logs_user_created
|
||||
ON security_audit_logs(user_id, created_at DESC, id DESC);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE IF EXISTS security_audit_logs;
|
||||
Reference in new issue
Block a user