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
{{ message }}
Repository navigation
Commit 4c361d4
Browse filesBrowse the repository at this point in the historyBrowse files
Adds redaction.entropy (off by default) to mask long high-entropy strings in text, forms and Analog server logs, and passes the resolved options to trusted pages.
Refs #371
|`redaction.secretNames`|`[]`| Extra field names to treat as secret, on top of the built-in list. They match by words, like the built-in list, so `passport` also covers `passportNumber`. |
180
-
|`redaction.unmask`|`[]`| Field names to show even when they look secret. They join the `unmask` list of `window.__PANGULAR_FORMS__`. |
|`redaction.secretNames`|`[]`| Extra field names to treat as secret, on top of the built-in list. They match by words, like the built-in list, so `passport` also covers `passportNumber`. |
184
+
|`redaction.unmask`|`[]`| Field names to show even when they look secret. They join the `unmask` list of `window.__PANGULAR_FORMS__`. |
185
+
|`redaction.entropy`|`false`| Also mask high-entropy strings that no name or shape rule catches, such as an opaque token in a harmless-looking field. Hex values and ULIDs stay readable. `true` turns it on with the defaults; an object turns it on and sets the options below. |
186
+
187
+
|`redaction.entropy` field | Default | What it sets |
|`minLength`|`24`| The shortest run that can be masked, a whole number from 16 to 512. Raise it if ids in your app are masked that shouldn't be. |
190
+
|`threshold`|`4.5`| The most bits per character a run needs, from 2 to 6. Shorter runs need less (see [High-entropy strings](../security.md#high-entropy-strings)). |
191
+
192
+
A field that is out of range takes its default, and the server reports the problem when it starts. To mask only longer runs:
Forms, the router, component inputs, signals, NgRx, pipes, Analog previews, SSR & HTTP URLs and Capacitor plugin calls use the extra secret names. Each list keeps up to 100 names. The server sends both lists to a page only after the page is trusted, so they are not in `__connection.json`. See [Access and redaction](../security.md#what-is-redacted) for what is redacted and what unmasking allows.
204
+
Forms, the router, component inputs, signals, NgRx, pipes, Analog previews, SSR & HTTP URLs and Capacitor plugin calls use the extra secret names. Each list keeps up to 100 names. `redaction.entropy` applies to the same text, on the page and again on the devtools server; [High-entropy strings](../security.md#high-entropy-strings) says what it masks. The server sends the `redaction` options to a page only after the page is trusted, so they are not in `__connection.json`. See [Access and redaction](../security.md#what-is-redacted) for what is redacted and what unmasking allows.
183
205
184
206
### Limits
185
207
@@ -330,19 +352,20 @@ A value that the server ignores falls back to its default, which is usually the
330
352
331
353
The [Dashboard](../inspectors/dashboard.md#configuration-block) has a **Configuration** block. It lists the options that differ from the defaults, or says **Defaults** when nothing is changed. The panel reads the `redaction` rows from the server once it is trusted, since `__connection.json` leaves them out. A static report has no server to ask, so it shows no **Extra secret names** or **Unmasked names** rows.
Copy file name to clipboardExpand all lines: apps/docs/src/content/security.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,6 +299,26 @@ An email address in a URL is replaced with `[email]`, in a path segment, a query
299
299
300
300
An `@` that isn't part of an address stays, as in `/@angular/core`, `[email protected]` or `/users/@alice`. The user in a URL's authority, such as `git` in `ssh://[email protected]`, stays visible like the user before a URL password. Inside an encoded URL in a query value (`?next=https%3A%2F%2Fbob%40example.com`) there is no authority to tell apart, so the address is masked, host included. The router lint (`lint-routes` and the [Lint](./inspectors/router.md#lint) view) still reports the `email-in-url` rule for a navigation whose address was masked.
301
301
302
+
### High-entropy strings
303
+
304
+
Set `redaction.entropy` to `true` to also mask strings that look random, such as an opaque session token in a field with a harmless name or a cloud secret with no known prefix. It is off by default. An object such as `{minLength: 32, threshold: 4}` turns it on with other limits. See [Redaction options](./getting-started/configuration.md#redaction).
305
+
306
+
A run of letters, digits, `_`, `-`, `+` and `/` (and any trailing `=`) is replaced with `[redacted]` when all of these hold:
| It has `minLength` characters or more (24) | Short ids, words and numbers stay readable. |
311
+
| It mixes lowercase, uppercase and digits | Plain words, numbers and lowercase slugs such as `css-1a2b3c` stay readable. |
312
+
| It is not hex and not a ULID | Hashes, commit SHAs, UUIDs, Mongo ids and ULIDs stay readable. |
313
+
| It doesn't read as words | camelCase and snake_case identifiers, such as `getUserProfileById2024`, stay readable. |
314
+
| Its Shannon entropy is high enough |`log2(length) - 1` bits per character, at most `threshold` (4.5): 3.6 bits at 24 characters, 4 at 32, 4.5 from 45. |
315
+
316
+
About 99 in 100 random 24-character tokens pass these checks, and more of longer ones. A run with `/` is judged whole, as base64 is, unless one of its segments is a plain word or number, as in a path. Then each segment is judged on its own, so `/api/v2/Users/<token>/edit` keeps its path readable. Long base64 data, such as an inline image, is masked too.
317
+
318
+
The check runs last, after the name and shape rules, so a Stripe key still shows its `sk_live_` prefix. It covers every text the other rules cover: values, keys, messages, URLs, previews and headers in serialized values, NgRx state, forms, the router, SSR & HTTP calls, Analog reports and server logs, Capacitor calls and errors, on the page and again on the devtools server.
319
+
320
+
The check reads each text once, so its cost grows in step with the text, and a long text of 200 KB takes milliseconds to check.
321
+
302
322
### Router
303
323
304
324
These are replaced with `[redacted]` in URLs, params, data and messages:
- A **Terminals** dock that runs the project's build and test commands (opt in with `terminals: true`).
136
136
- Hub messages and toasts, a dock group with badges, and an **All tools** dock.
137
137
- New entry points: `/overlay-manual` (starts nothing on import), `/plugin`, `/capacitor-hook`, `/store-hook`, `/startup-hook`, `/ssr` and `/cd-data`.
138
-
- New config options: `agent.browserTools`, `limits.capacitorCalls`, `limits.idleAfterMs`, `popup` and `plugins`.
138
+
- New config options: `agent.browserTools`, `limits.capacitorCalls`, `limits.idleAfterMs`, `popup`, `plugins` and `redaction.entropy`.
139
+
-`redaction.entropy`, off by default, masks long high-entropy strings that no name or shape rule catches, such as an opaque token in a harmless field. `true` masks runs of 24 characters or more; `{minLength, threshold}` sets other limits. Hex values, UUIDs, ULIDs and camelCase identifiers stay readable, and known shapes keep their prefix. It applies on every redaction path, on the page and on the devtools server, and shows as **Entropy masking** on the Dashboard.
139
140
- After pairing, focus moves to the active tab with a **Connected** note.
0 commit comments