Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update risk factors (#16164)
Danny Xue5f2489d04e5
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts b/frontend/src/components/CustomApproval/Settings/components/common/utils.tsindex 24bb18b698..2927c3ff15 100644--- a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts+++ b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts@@ -1,4 +1,3 @@-import { uniq, without } from "lodash-es";import { CheckIcon } from "lucide-vue-next";import type { SelectOption } from "naive-ui";import { h, type VNode } from "vue";@@ -68,92 +67,66 @@ export const orderByLevelDesc = (a: Risk, b: Risk): number => {return a.name < b.name ? -1 : 1;};-const NumberFactorList = [- // Risk related factors- "affected_rows",- "table_rows",- "level",- "source",- "expiration_days",- "export_rows",+const commonFactorList = [+ "environment_id", // use `environment.resource_id` instead.+ "project_id", // use `project.resource_id` instead.+ "db_engine",] as const;-const StringFactorList = [- "environment_id", // using `environment.resource_id`- "project_id", // using `project.resource_id`- "db_engine",- "sql_type",+const schemaObjectNameFactorList = ["database_name","schema_name","table_name",- "role",+] as const;++const migrationFactorList = [+ "affected_rows",+ "table_rows",+ "sql_type",+ "sql_statement",] as const;export const RiskSourceFactorMap: Map<Risk_Source, string[]> = new Map([[Risk_Source.DDL,- uniq(- without(- [...NumberFactorList, ...StringFactorList, "sql_statement"],- "level",- "source",- "expiration_days",- "export_rows"- )- ),+ [+ ...commonFactorList,+ ...schemaObjectNameFactorList,+ ...migrationFactorList,+ ],],[Risk_Source.DML,- uniq(- without(- [...NumberFactorList, ...StringFactorList, "sql_statement"],- "level",- "source",- "expiration_days",- "export_rows"- )- ),+ [+ ...commonFactorList,+ ...schemaObjectNameFactorList,+ ...migrationFactorList,+ ],],[Risk_Source.CREATE_DATABASE,- uniq(- without(- [...StringFactorList],- "sql_type",- "schema_name",- "table_name",- "table_rows",- "expiration_days",- "export_rows"- )- ),+ [+ ...commonFactorList,+ "database_name",+ ],],[Risk_Source.DATA_EXPORT,- uniq(- without(- [...StringFactorList, ...NumberFactorList],- "level",- "affected_rows",- "table_rows",- "source",- "sql_type",- "expiration_days"- )- ),+ [+ ...commonFactorList,+ ...schemaObjectNameFactorList,+ "export_rows",+ ],],[Risk_Source.REQUEST_ROLE,- uniq(- without(- [...StringFactorList, ...NumberFactorList],- "level",- "source",- "affected_rows",- "table_rows",- "sql_type"- )- ),+ [+ ...commonFactorList,+ ...schemaObjectNameFactorList,+ "expiration_days",+ "export_rows",+ "role",+ ],],]);