Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: remove deprecated CEL factors and fix proto documentation (#17659)

Danny Xua889cb70b045
diff --git a/backend/common/cel.go b/backend/common/cel.go
index 3cd60e09d8..c2c00bb1a5 100644
--- a/backend/common/cel.go
+++ b/backend/common/cel.go
@@ -31,7 +31,6 @@ var RiskFactors = []cel.EnvOption{
cel.Variable("sql_statement", cel.StringType),
cel.Variable("expiration_days", cel.IntType),
- cel.Variable("export_rows", cel.IntType),
cel.Variable("role", cel.StringType),
}
@@ -189,8 +188,7 @@ func validateCELExpr(expression *expr.Expr, conditionCELAttributes []cel.EnvOpti
// QueryExportFactors is the factors for query and export.
type QueryExportFactors struct {
- Databases []string
- ExportRows int64
+ Databases []string
}
// GetQueryExportFactors is used to get risk factors from query and export expressions.
@@ -225,9 +223,6 @@ func findField(callExpr *exprproto.Expr_Call, factors *QueryExportFactors) {
if len(callExpr.Args) == 2 {
idExpr := callExpr.Args[0].GetIdentExpr()
if idExpr != nil {
- if idExpr.Name == "request.row_limit" {
- factors.ExportRows = callExpr.Args[1].GetConstExpr().GetInt64Value()
- }
if idExpr.Name == "resource.database" && callExpr.Function == "_==_" {
factors.Databases = append(factors.Databases, callExpr.Args[1].GetConstExpr().GetStringValue())
}
diff --git a/backend/common/cel_test.go b/backend/common/cel_test.go
index 99a823cc54..3c2b570eee 100644
--- a/backend/common/cel_test.go
+++ b/backend/common/cel_test.go
@@ -81,15 +81,13 @@ func TestGetQueryExportFactors(t *testing.T) {
{
expression: "request.time < timestamp(\"2023-07-04T06:09:03.384Z\") && request.row_limit == 1000 && (resource.database == \"instances/postgres-sample/databases/employee\" && resource.schema == \"public\" && resource.table in [\"dept_manager\"])",
want: QueryExportFactors{
- Databases: []string{"instances/postgres-sample/databases/employee"},
- ExportRows: 1000,
+ Databases: []string{"instances/postgres-sample/databases/employee"},
},
},
{
expression: "request.time < timestamp(\"2023-07-04T07:40:05.658Z\") && request.row_limit == 1000 && (resource.database in [\"instances/postgres-sample/databases/employee\"])",
want: QueryExportFactors{
- Databases: []string{"instances/postgres-sample/databases/employee"},
- ExportRows: 1000,
+ Databases: []string{"instances/postgres-sample/databases/employee"},
},
},
{
diff --git a/backend/generated-go/store/instance.pb.go b/backend/generated-go/store/instance.pb.go
index cfb8005952..55bfcc4d80 100644
--- a/backend/generated-go/store/instance.pb.go
+++ b/backend/generated-go/store/instance.pb.go
@@ -1404,9 +1404,11 @@ type DataSource_AWSCredential struct {
ObfuscatedSecretAccessKey string `protobuf:"bytes,4,opt,name=obfuscated_secret_access_key,json=obfuscatedSecretAccessKey,proto3" json:"obfuscated_secret_access_key,omitempty"`
SessionToken string `protobuf:"bytes,5,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"`
ObfuscatedSessionToken string `protobuf:"bytes,6,opt,name=obfuscated_session_token,json=obfuscatedSessionToken,proto3" json:"obfuscated_session_token,omitempty"`
- // ARN of IAM role to assume for cross-account access
+ // ARN of IAM role to assume for cross-account access.
+ // See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
RoleArn string `protobuf:"bytes,7,opt,name=role_arn,json=roleArn,proto3" json:"role_arn,omitempty"`
- // Optional external ID for additional security when assuming role
+ // Optional external ID for additional security when assuming role.
+ // See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
ExternalId string `protobuf:"bytes,8,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
diff --git a/backend/generated-go/v1/instance_service.pb.go b/backend/generated-go/v1/instance_service.pb.go
index 82c0918653..a53cb8952d 100644
--- a/backend/generated-go/v1/instance_service.pb.go
+++ b/backend/generated-go/v1/instance_service.pb.go
@@ -2481,9 +2481,11 @@ type DataSource_AWSCredential struct {
AccessKeyId string `protobuf:"bytes,1,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"`
SecretAccessKey string `protobuf:"bytes,2,opt,name=secret_access_key,json=secretAccessKey,proto3" json:"secret_access_key,omitempty"`
SessionToken string `protobuf:"bytes,3,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"`
- // ARN of IAM role to assume for cross-account access
+ // ARN of IAM role to assume for cross-account access.
+ // See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
RoleArn string `protobuf:"bytes,4,opt,name=role_arn,json=roleArn,proto3" json:"role_arn,omitempty"`
- // Optional external ID for additional security when assuming role
+ // Optional external ID for additional security when assuming role.
+ // See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
ExternalId string `protobuf:"bytes,5,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
diff --git a/backend/generated-go/v1/risk_service.pb.go b/backend/generated-go/v1/risk_service.pb.go
index 96e99e1b14..5e102ff3ba 100644
--- a/backend/generated-go/v1/risk_service.pb.go
+++ b/backend/generated-go/v1/risk_service.pb.go
@@ -430,7 +430,6 @@ type Risk struct {
// schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
// table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
// sql_statement: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
- // export_rows: export data count, support "==", "!=", "<", "<=", ">", ">=" operations.
// expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
// role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
//
@@ -459,26 +458,6 @@ type Risk struct {
// database_name
// schema_name
// table_name
- // export_rows
- //
- // When the risk source is REQUEST_QUERY, support following variables:
- // environment_id
- // project_id
- // db_engine
- // database_name
- // schema_name
- // table_name
- // expiration_days
- //
- // When the risk source is REQUEST_EXPORT, support following variables:
- // environment_id
- // project_id
- // db_engine
- // database_name
- // schema_name
- // table_name
- // expiration_days
- // export_rows
//
// When the risk source is REQUEST_ROLE, support following variables:
// project_id
diff --git a/backend/plugin/db/util/aws.go b/backend/plugin/db/util/aws.go
index 0a1b269967..49552eef1a 100644
--- a/backend/plugin/db/util/aws.go
+++ b/backend/plugin/db/util/aws.go
@@ -1,3 +1,4 @@
+//nolint:revive
package util
import (
diff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.go
index 48eb162c71..98aa09e5aa 100644
--- a/backend/runner/approval/runner.go
+++ b/backend/runner/approval/runner.go
@@ -682,7 +682,6 @@ func (r *Runner) getGrantRequestIssueRisk(ctx context.Context, issue *store.Issu
args := map[string]any{
"project_id": issue.Project.ResourceID,
"expiration_days": expirationDays,
- "export_rows": factors.ExportRows,
"role": payload.GrantRequest.Role,
}
if len(factors.Databases) == 0 {
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
index e864a30662..099cfeff86 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
@@ -112,7 +112,7 @@ export const RiskSourceFactorMap: Map<Risk_Source, Factor[]> = new Map([
[Risk_Source.CREATE_DATABASE, [...commonFactorList, "database_name"]],
[
Risk_Source.DATA_EXPORT,
- [...commonFactorList, ...schemaObjectNameFactorList, "export_rows"],
+ [...commonFactorList, ...schemaObjectNameFactorList],
],
[
Risk_Source.REQUEST_ROLE,
@@ -120,7 +120,6 @@ export const RiskSourceFactorMap: Map<Risk_Source, Factor[]> = new Map([
"environment_id", // use `environment.resource_id` instead.
"project_id", // use `project.resource_id` instead.
"expiration_days",
- "export_rows",
"role",
],
],
@@ -302,7 +301,6 @@ export const getOptionConfigMap = (source: Risk_Source) => {
case "resource.database":
case "resource.schema":
case "resource.table":
- case "request.export_format":
case "resource.environment_name":
case "resource.instance_id":
case "resource.database_name":
@@ -313,7 +311,6 @@ export const getOptionConfigMap = (source: Risk_Source) => {
case "column_name":
case "affected_rows":
case "table_rows":
- case "export_rows":
case "request.row_limit":
case "expiration_days":
case "request.time":
diff --git a/frontend/src/plugins/cel/types/factor.ts b/frontend/src/plugins/cel/types/factor.ts
index 01641e2f53..6a8743c593 100644
--- a/frontend/src/plugins/cel/types/factor.ts
+++ b/frontend/src/plugins/cel/types/factor.ts
@@ -9,7 +9,6 @@ export const NumberFactorList = [
// Request query/export factors
"expiration_days",
- "export_rows",
] as const;
export type NumberFactor = (typeof NumberFactorList)[number];
@@ -31,8 +30,6 @@ export const StringFactorList = [
"resource.database",
"resource.schema",
"resource.table",
- // Deprecated
- "request.export_format",
// Database/table group related factors
"resource.environment_name", // using `environment.name`
diff --git a/frontend/src/plugins/cel/types/operator.ts b/frontend/src/plugins/cel/types/operator.ts
index bac6d03147..696c7d5c0c 100644
--- a/frontend/src/plugins/cel/types/operator.ts
+++ b/frontend/src/plugins/cel/types/operator.ts
@@ -123,7 +123,6 @@ const OperatorList: Record<Factor, Operator[]> = {
// Request query/export factors
expiration_days: uniq([...EqualityOperatorList, ...CompareOperatorList]),
- export_rows: uniq([...EqualityOperatorList, ...CompareOperatorList]),
role: uniq([
...EqualityOperatorList,
...CollectionOperatorList,
@@ -131,7 +130,6 @@ const OperatorList: Record<Factor, Operator[]> = {
]),
// These factors don't have operator candidates for user selection.
- "request.export_format": [],
"request.row_limit": [],
"resource.database": [],
"resource.schema": [],
diff --git a/frontend/src/types/proto-es/v1/instance_service_pb.d.ts b/frontend/src/types/proto-es/v1/instance_service_pb.d.ts
index 05b407d9dc..2419decf1a 100644
--- a/frontend/src/types/proto-es/v1/instance_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/instance_service_pb.d.ts
@@ -1133,14 +1133,16 @@ export declare type DataSource_AWSCredential = Message<"bytebase.v1.DataSource.A
sessionToken: string;
/**
- * ARN of IAM role to assume for cross-account access
+ * ARN of IAM role to assume for cross-account access.
+ * See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
*
* @generated from field: string role_arn = 4;
*/
roleArn: string;
/**
- * Optional external ID for additional security when assuming role
+ * Optional external ID for additional security when assuming role.
+ * See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
*
* @generated from field: string external_id = 5;
*/
diff --git a/frontend/src/types/proto-es/v1/risk_service_pb.d.ts b/frontend/src/types/proto-es/v1/risk_service_pb.d.ts
index a66846c772..3c2e680b8c 100644
--- a/frontend/src/types/proto-es/v1/risk_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/risk_service_pb.d.ts
@@ -210,7 +210,6 @@ export declare type Risk = Message<"bytebase.v1.Risk"> & {
* schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
* table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
* sql_statement: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
- * export_rows: export data count, support "==", "!=", "<", "<=", ">", ">=" operations.
* expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
* role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
*
@@ -239,26 +238,6 @@ export declare type Risk = Message<"bytebase.v1.Risk"> & {
* database_name
* schema_name
* table_name
- * export_rows
- *
- * When the risk source is REQUEST_QUERY, support following variables:
- * environment_id
- * project_id
- * db_engine
- * database_name
- * schema_name
- * table_name
- * expiration_days
- *
- * When the risk source is REQUEST_EXPORT, support following variables:
- * environment_id
- * project_id
- * db_engine
- * database_name
- * schema_name
- * table_name
- * expiration_days
- * export_rows
*
* When the risk source is REQUEST_ROLE, support following variables:
* project_id
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 6922ef8da7..d609698ae5 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -9739,11 +9739,15 @@ components:
roleArn:
writeOnly: true
type: string
- description: ARN of IAM role to assume for cross-account access
+ description: |-
+ ARN of IAM role to assume for cross-account access.
+ See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
externalId:
writeOnly: true
type: string
- description: Optional external ID for additional security when assuming role
+ description: |-
+ Optional external ID for additional security when assuming role.
+ See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
DataSource_Address:
type: object
properties:
@@ -12716,7 +12720,6 @@ components:
schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
sql_statement: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
- export_rows: export data count, support "==", "!=", "<", "<=", ">", ">=" operations.
expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
@@ -12745,26 +12748,6 @@ components:
database_name
schema_name
table_name
- export_rows
-
- When the risk source is REQUEST_QUERY, support following variables:
- environment_id
- project_id
- db_engine
- database_name
- schema_name
- table_name
- expiration_days
-
- When the risk source is REQUEST_EXPORT, support following variables:
- environment_id
- project_id
- db_engine
- database_name
- schema_name
- table_name
- expiration_days
- export_rows
When the risk source is REQUEST_ROLE, support following variables:
project_id
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 7e57ba6e94..1360369238 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -2476,8 +2476,8 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
| obfuscated_secret_access_key | [string](#string) | | |
| session_token | [string](#string) | | |
| obfuscated_session_token | [string](#string) | | |
-| role_arn | [string](#string) | | ARN of IAM role to assume for cross-account access |
-| external_id | [string](#string) | | Optional external ID for additional security when assuming role |
+| role_arn | [string](#string) | | ARN of IAM role to assume for cross-account access. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html |
+| external_id | [string](#string) | | Optional external ID for additional security when assuming role. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index a7dcd2ccf5..7ba2475e3b 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -7308,14 +7308,16 @@ For PostgreSQL HA, this can be used to set target_session_attrs=read-write </p><
<td>role_arn</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>ARN of IAM role to assume for cross-account access </p></td>
+ <td><p>ARN of IAM role to assume for cross-account access.
+See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html </p></td>
</tr>
<tr>
<td>external_id</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Optional external ID for additional security when assuming role </p></td>
+ <td><p>Optional external ID for additional security when assuming role.
+See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html </p></td>
</tr>
</tbody>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index d51fafaf7d..7808748c58 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -1411,8 +1411,8 @@ This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
| access_key_id | [string](#string) | | |
| secret_access_key | [string](#string) | | |
| session_token | [string](#string) | | |
-| role_arn | [string](#string) | | ARN of IAM role to assume for cross-account access |
-| external_id | [string](#string) | | Optional external ID for additional security when assuming role |
+| role_arn | [string](#string) | | ARN of IAM role to assume for cross-account access. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html |
+| external_id | [string](#string) | | Optional external ID for additional security when assuming role. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html |
@@ -9702,17 +9702,13 @@ When paginating, all other parameters provided to `LiskRisks` must match the cal
| active | [bool](#bool) | | |
| condition | [google.type.Expr](#google-type-Expr) | | The condition that is associated with the risk. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-All supported variables: affected_rows: affected row count in the DDL/DML, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. table_rows: table row count number, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. environment_id: the environment resource id, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operations. project_id: the project resource id, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. db_engine: the database engine type, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operations. Check the Engine enum for the values. sql_type: the SQL type, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operations. when the risk source is DDL, check https://github.com/bytebase/bytebase/blob/main/frontend/src/plugins/cel/types/values.ts#L70 for supported values. when the risk source is DML, check https://github.com/bytebase/bytebase/blob/main/frontend/src/plugins/cel/types/values.ts#L71 for supported values. database_name: the database name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. schema_name: the schema name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. table_name: the table name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. sql_statement: the SQL statement, support &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. export_rows: export data count, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. expiration_days: the role expiration days for the request, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. role: the request role full name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations.
+All supported variables: affected_rows: affected row count in the DDL/DML, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. table_rows: table row count number, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. environment_id: the environment resource id, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operations. project_id: the project resource id, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. db_engine: the database engine type, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operations. Check the Engine enum for the values. sql_type: the SQL type, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operations. when the risk source is DDL, check https://github.com/bytebase/bytebase/blob/main/frontend/src/plugins/cel/types/values.ts#L70 for supported values. when the risk source is DML, check https://github.com/bytebase/bytebase/blob/main/frontend/src/plugins/cel/types/values.ts#L71 for supported values. database_name: the database name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. schema_name: the schema name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. table_name: the table name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. sql_statement: the SQL statement, support &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations. expiration_days: the role expiration days for the request, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations. role: the request role full name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations.
When the risk source is DDL/DML, support following variables: affected_rows table_rows environment_id project_id db_engine sql_type database_name schema_name table_name sql_statement
When the risk source is CREATE_DATABASE, support following variables: environment_id project_id db_engine database_name
-When the risk source is DATA_EXPORT, support following variables: environment_id project_id db_engine database_name schema_name table_name export_rows
-
-When the risk source is REQUEST_QUERY, support following variables: environment_id project_id db_engine database_name schema_name table_name expiration_days
-
-When the risk source is REQUEST_EXPORT, support following variables: environment_id project_id db_engine database_name schema_name table_name expiration_days export_rows
+When the risk source is DATA_EXPORT, support following variables: environment_id project_id db_engine database_name schema_name table_name
When the risk source is REQUEST_ROLE, support following variables: project_id expiration_days role |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 6bdeedec56..e927313c6a 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -4684,14 +4684,16 @@ For PostgreSQL HA, this can be used to set target_session_attrs=read-write </p><
<td>role_arn</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>ARN of IAM role to assume for cross-account access </p></td>
+ <td><p>ARN of IAM role to assume for cross-account access.
+See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html </p></td>
</tr>
<tr>
<td>external_id</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Optional external ID for additional security when assuming role </p></td>
+ <td><p>Optional external ID for additional security when assuming role.
+See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html </p></td>
</tr>
</tbody>
@@ -27119,7 +27121,6 @@ database_name: the database name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [x
schema_name: the schema name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations.
table_name: the table name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations.
sql_statement: the SQL statement, support &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations.
-export_rows: export data count, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations.
expiration_days: the role expiration days for the request, support &#34;==&#34;, &#34;!=&#34;, &#34;&lt;&#34;, &#34;&lt;=&#34;, &#34;&gt;&#34;, &#34;&gt;=&#34; operations.
role: the request role full name, support &#34;==&#34;, &#34;!=&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34;, &#34;contains()&#34;, &#34;matches()&#34;, &#34;startsWith()&#34;, &#34;endsWith()&#34; operations.
@@ -27148,26 +27149,6 @@ db_engine
database_name
schema_name
table_name
-export_rows
-
-When the risk source is REQUEST_QUERY, support following variables:
-environment_id
-project_id
-db_engine
-database_name
-schema_name
-table_name
-expiration_days
-
-When the risk source is REQUEST_EXPORT, support following variables:
-environment_id
-project_id
-db_engine
-database_name
-schema_name
-table_name
-expiration_days
-export_rows
When the risk source is REQUEST_ROLE, support following variables:
project_id
diff --git a/proto/v1/v1/risk_service.proto b/proto/v1/v1/risk_service.proto
index b4b9a1ddd6..2393c330a7 100644
--- a/proto/v1/v1/risk_service.proto
+++ b/proto/v1/v1/risk_service.proto
@@ -167,7 +167,6 @@ message Risk {
// schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
// table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
// sql_statement: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
- // export_rows: export data count, support "==", "!=", "<", "<=", ">", ">=" operations.
// expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
// role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
//
@@ -196,26 +195,6 @@ message Risk {
// database_name
// schema_name
// table_name
- // export_rows
- //
- // When the risk source is REQUEST_QUERY, support following variables:
- // environment_id
- // project_id
- // db_engine
- // database_name
- // schema_name
- // table_name
- // expiration_days
- //
- // When the risk source is REQUEST_EXPORT, support following variables:
- // environment_id
- // project_id
- // db_engine
- // database_name
- // schema_name
- // table_name
- // expiration_days
- // export_rows
//
// When the risk source is REQUEST_ROLE, support following variables:
// project_id