You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It today isn't quite clear which internal objects are safe for external
usage. For example, selecting from crdb_internal.zones is considered
safe, while deleting from system.jobs is not.
To address this, we're adding a gate protecting some of these internals,
as well as auditing around their usage so that we can better see how the
internal state of the database may have been modified.
The start of this effort is this PR, which adds an gate on the privilege
check for system descriptors. This gate is simple now, it checks whether
the caller is internal or if the override session variable is set to
access "unsafe internals".
It should be noted that allowance is the default to start, so that
extensive testing can be done on this feature before its rolled out more
widely.
Fixes: #149594, #151333
Epic: CRDB-24527
Release note (sql change): Adds a new session variable
`allow_unsafe_internals` which controls access to the
`system` database.
Copy file name to clipboardExpand all lines: pkg/sql/sqlerrors/errors.go
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -661,6 +661,7 @@ var (
661
661
ErrNoType=pgerror.New(pgcode.InvalidName, "no type specified")
662
662
ErrNoFunction=pgerror.New(pgcode.InvalidName, "no function specified")
663
663
ErrNoMatch=pgerror.New(pgcode.UndefinedObject, "no object matched")
664
+
ErrUnsafeTableAccess=errors.WithHint(pgerror.New(pgcode.InsufficientPrivilege, "Access to crdb_internal and system is restricted."), "These interfaces are unsupported in production. To proceed, set the session variable allow_unsafe_internals = true (not recommended), or contact Cockroach Labs for a supported alternative.")
664
665
)
665
666
666
667
varErrNoZoneConfigApplies=errors.New("no zone config applies")
0 commit comments