Skip to content

Commit 6fc6f27

Browse files
committed
Incorporated Brian’s feedback.
1 parent 4e9e021 commit 6fc6f27

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/current/_includes/v25.4/misc/session-vars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
| Variable name | Description | Initial value | Modify with [`SET`]({% link {{ page.version.version }}/set-vars.md %})? | View with [`SHOW`]({% link {{ page.version.version }}/show-vars.md %})? |
22
|---|---|---|---|---|
33
| <a id="always-distribute-full-scans"></a> `always_distribute_full_scans` | When set to `on`, full table scans are always [distributed]({% link {{ page.version.version }}/architecture/sql-layer.md %}#distsql). | `off` | Yes | Yes |
4-
| <a id="allow-unsafe-internals"></a><span class="version-tag">New in v25.4:</span> `allow_unsafe_internals` | Controls access to unsafe internals in the `system` database and the [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %}#access-control) schema. When set to `off`, only allowlisted objects are accessible without internal privileges.<br><br>**Warning**: In future releases, this session variable will default to `off` and then will be removed. To assess potential downstream impacts on your setup, set `allow_unsafe_internals` to `off` in a non-production environment. | `on` | Yes | Yes |
4+
| <a id="allow-unsafe-internals"></a><span class="version-tag">New in v25.4:</span> `allow_unsafe_internals` | Controls access to unsafe internals in the `system` database and the [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %}#access-control) schema. When set to `off`, only allowlisted objects are accessible without internal privileges.<br><br>**Warning**: In a future release, this session variable will default to `off`. To assess potential downstream impacts on your setup, set `allow_unsafe_internals` to `off` in a non-production environment. | `on` | Yes | Yes |
55
| <a id="application-name"></a> `application_name` | The current application name for statistics collection. | Empty string, or `cockroach` for sessions from the [built-in SQL client]({% link {{ page.version.version }}/cockroach-sql.md %}). | Yes | Yes |
66
| <a id="autocommit-before-ddl"></a> `autocommit_before_ddl` | When the [`autocommit_before_ddl` session setting]({% link {{page.version.version}}/set-vars.md %}#autocommit-before-ddl) is set to `on`, any schema change statement that is sent during an [explicit transaction]({% link {{page.version.version}}/transactions.md %}) will cause the transaction to [commit]({% link {{page.version.version}}/commit-transaction.md %}) before executing the schema change. This is useful because [CockroachDB does not fully support multiple schema changes in a single transaction]({% link {{ page.version.version }}/online-schema-changes.md %}#schema-changes-within-transactions). : This setting is enabled by default. To disable it for [all roles]({% link {{ page.version.version }}/alter-role.md %}#set-default-session-variable-values-for-all-users), issue the following statement: `ALTER ROLE ALL SET autocommit_before_ddl = false` | `on` | Yes | Yes |
77
| <a id="bytea-output"></a> `bytea_output` | The [mode for conversions from `STRING` to `BYTES`]({% link {{ page.version.version }}/bytes.md %}#supported-conversions). | hex | Yes | Yes |

src/current/v25.4/crdb-internal.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ The `crdb_internal` [system catalog]({% link {{ page.version.version }}/system-c
99

1010
## Access control
1111

12-
{% include_cached new-in.html version="v25.4" %} CockroachDB treats most objects in the `crdb_internal` schema, as well as descriptors in the `system` database, as *unsafe internals*. Access to these objects is controlled by the [`allow_unsafe_internals` session variable]({% link {{ page.version.version }}/session-variables.md %}#allow-unsafe-internals). This defaults to `on`, but you can disable access by setting it to `off`:
12+
{% include_cached new-in.html version="v25.4" %} CockroachDB treats most objects in the `crdb_internal` schema and descriptors in the `system` database as *unsafe internals*. Access to these objects is controlled by the [`allow_unsafe_internals` session variable]({% link {{ page.version.version }}/session-variables.md %}#allow-unsafe-internals). This defaults to `on`, but you can disable access by setting it to `off`.
1313

1414
{% include_cached copy-clipboard.html %}
1515
~~~ sql
1616
SET allow_unsafe_internals = off;
1717
~~~
1818

19-
When set to `off`, external sessions can read only the allowlisted `crdb_internal` objects that are supported for production use (the tables marked ✓ in the table below). All other tables and built-in functions that use the `crdb_internal` namespace require either an internal caller or explicitly enabling `allow_unsafe_internals` for the session:
19+
When set to `off`, external sessions can read only the allowlisted `crdb_internal` objects that are supported for production use (the tables marked ✓ in the table below). All other tables and built-in functions that use the `crdb_internal` namespace require you to explicitly enable `allow_unsafe_internals` for the session.
2020

2121
{% include_cached copy-clipboard.html %}
2222
~~~ sql
2323
SET allow_unsafe_internals = on;
2424
~~~
2525

26-
Some SHOW commands, such as [SHOW DATABASES]({% link {{ page.version.version }}/show-databases.md %}), depend on internal queries that access otherwise restricted data. These commands are designed to bypass the `allow_unsafe_internals` setting, so they continue to function even when direct access to unsafe internals is disabled.
26+
Some `SHOW commands`, such as [`SHOW DATABASES`]({% link {{ page.version.version }}/show-databases.md %}), and CockroachDB tools, such as the [DB Console]({% link {{ page.version.version }}/ui-overview.md %}) and [`cockroach debug zip`]({% link {{ page.version.version }}/cockroach-debug-zip.md %}), rely on internal queries that access restricted data. These commands and tools are designed to bypass the `allow_unsafe_internals` setting and continue to function even when direct access is disabled.
2727

2828
CockroachDB emits [log events to the `SENSITIVE_ACCESS` channel]({% link {{ page.version.version }}/logging-use-cases.md %}#example-unsafe-internals) when a user overrides or is denied access to unsafe internals, generating a record of emergency access to system internals.
2929

3030
{{site.data.alerts.callout_danger}}
31-
In future releases, the `allow_unsafe_internals` session variable will default to `off` and then will be removed. To assess potential downstream impacts on your setup, set `allow_unsafe_internals` to `off` in a non-production environment.
31+
In a future release, the `allow_unsafe_internals` session variable will default to `off`. To assess potential downstream impacts on your setup, set `allow_unsafe_internals` to `off` in a non-production environment.
3232
{{site.data.alerts.end}}
3333

3434
<a id="data-exposed-by-crdb_internal"></a>

src/current/v25.4/logging-use-cases.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,44 +284,44 @@ The following events may be logged to the `SENSITIVE_ACCESS` channel, depending
284284

285285
These events record both successful and denied attempts to access internal system objects.
286286

287-
This command enables access to unsafe internals for the user `max`:
287+
This command enables access to unsafe internals for the user `allow_unsafe_internals_on`:
288288

289289
{% include_cached copy-clipboard.html %}
290290
~~~ sql
291-
ALTER ROLE max SET allow_unsafe_internals = on;
291+
ALTER ROLE allow_unsafe_internals_on SET allow_unsafe_internals = on;
292292
~~~
293293

294-
When the user `max` connects to a session and accesses an unsafe internal object, an event is logged:
294+
When the user `allow_unsafe_internals_on` connects to a session and accesses an unsafe internal object, an event is logged:
295295

296296
{% include_cached copy-clipboard.html %}
297297
~~~ sql
298298
SELECT count(*) FROM crdb_internal.active_range_feeds;
299299
~~~
300300

301-
This `unsafe_internals_accessed` event shows that the internal table `crdb_internal.active_range_feeds` was accessed by user `max` who issued a [`SELECT`]({% link {{ page.version.version }}/selection-queries.md %}) statement:
301+
This `unsafe_internals_accessed` event shows that the internal table `crdb_internal.active_range_feeds` was accessed by user `allow_unsafe_internals_on` who issued a [`SELECT`]({% link {{ page.version.version }}/selection-queries.md %}) statement:
302302

303303
~~~
304-
W250930 19:51:01.128927 464484 8@util/log/event_log.go:90 ⋮ [T1,Vsystem,n1,client=127.0.0.1:65020,hostssl,user=‹max›] 23 ={"Timestamp":1759261861128925000,"EventType":"unsafe_internals_accessed","Query":"SELECT count(*) FROM \"\".crdb_internal.active_range_feeds"}
304+
W250930 19:51:01.128927 464484 8@util/log/event_log.go:90 ⋮ [T1,Vsystem,n1,client=127.0.0.1:65020,hostssl,user=‹allow_unsafe_internals_on›] 23 ={"Timestamp":1759261861128925000,"EventType":"unsafe_internals_accessed","Query":"SELECT count(*) FROM \"\".crdb_internal.active_range_feeds"}
305305
~~~
306306

307-
This command disables access to unsafe internals for the user `max`:
307+
This command disables access to unsafe internals for the user `allow_unsafe_internals_off`:
308308

309309
{% include_cached copy-clipboard.html %}
310310
~~~ sql
311-
ALTER ROLE max SET allow_unsafe_internals = off;
311+
ALTER ROLE allow_unsafe_internals_off SET allow_unsafe_internals = off;
312312
~~~
313313

314-
When the user `max` connects to a session and tries to access an unsafe internal object, an event is logged:
314+
When the user `allow_unsafe_internals_off` connects to a session and tries to access an unsafe internal object, an event is logged:
315315

316316
{% include_cached copy-clipboard.html %}
317317
~~~ sql
318318
SELECT count(*) FROM crdb_internal.active_range_feeds;
319319
~~~
320320

321-
This `unsafe_internals_denied` event shows that access to the internal table `crdb_internal.active_range_feeds` was denied to the user `max`, who issued a [`SELECT`]({% link {{ page.version.version }}/selection-queries.md %}) statement:
321+
This `unsafe_internals_denied` event shows that access to the internal table `crdb_internal.active_range_feeds` was denied to the user `allow_unsafe_internals_off`, who issued a [`SELECT`]({% link {{ page.version.version }}/selection-queries.md %}) statement:
322322

323323
~~~
324-
W250930 15:47:06.906181 122782 8@util/log/event_log.go:90 ⋮ [T1,Vsystem,n1,client=127.0.0.1:57104,hostssl,user=‹max›] 18 ={"Timestamp":1759247226906172000,"EventType":"unsafe_internals_denied","Query":"SELECT count(*) FROM \"\".crdb_internal.active_range_feeds"}
324+
W250930 15:47:06.906181 122782 8@util/log/event_log.go:90 ⋮ [T1,Vsystem,n1,client=127.0.0.1:57104,hostssl,user=‹allow_unsafe_internals_off›] 18 ={"Timestamp":1759247226906172000,"EventType":"unsafe_internals_denied","Query":"SELECT count(*) FROM \"\".crdb_internal.active_range_feeds"}
325325
~~~
326326

327327
- Preceding the `=` character is the `crdb-v2` event metadata. See the [reference documentation]({% link {{ page.version.version }}/log-formats.md %}#format-crdb-v2) for details on the fields.

0 commit comments

Comments
 (0)