@noctcore/eslint-plugin-observability 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/docs/rules/no-sensitive-fields-in-logs.md +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,6 @@ export default [
|
|
|
40
40
|
| Rule | Description | Recommended |
|
|
41
41
|
| --- | --- | --- |
|
|
42
42
|
| [`structured-log-arguments`](./docs/rules/structured-log-arguments.md) | Pass dynamic values in a structured context object, not interpolated into the message string. | `error` |
|
|
43
|
-
| [`no-sensitive-fields-in-logs`](./docs/rules/no-sensitive-fields-in-logs.md) | Name-heuristic guard against writing credentials/secrets into log sinks. | `
|
|
43
|
+
| [`no-sensitive-fields-in-logs`](./docs/rules/no-sensitive-fields-in-logs.md) | Name-heuristic guard against writing credentials/secrets into log sinks. | `error` |
|
|
44
44
|
| [`no-error-detail-loss`](./docs/rules/no-error-detail-loss.md) | A catch block that reports failure must log the error itself, not only `e.message`. | `error` |
|
|
45
45
|
| [`audit-pii-declared`](./docs/rules/audit-pii-declared.md) | A PII-shaped key written into an audit payload must be declared: registered for scrubbing on purge, or declared non-PII. Enforces declaration, not deletion. Inert until `auditCallees` is set. | `error` |
|
package/dist/index.cjs
CHANGED
|
@@ -29,7 +29,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
29
29
|
// src/configs/recommended.ts
|
|
30
30
|
var recommended = {
|
|
31
31
|
"noctcore-observability/structured-log-arguments": "error",
|
|
32
|
-
"noctcore-observability/no-sensitive-fields-in-logs": "
|
|
32
|
+
"noctcore-observability/no-sensitive-fields-in-logs": "error",
|
|
33
33
|
"noctcore-observability/no-error-detail-loss": "error",
|
|
34
34
|
// Inert until you set `auditCallees`, so it ships enabled but checks nothing by default.
|
|
35
35
|
"noctcore-observability/audit-pii-declared": "error"
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/configs/recommended.ts
|
|
2
2
|
var recommended = {
|
|
3
3
|
"noctcore-observability/structured-log-arguments": "error",
|
|
4
|
-
"noctcore-observability/no-sensitive-fields-in-logs": "
|
|
4
|
+
"noctcore-observability/no-sensitive-fields-in-logs": "error",
|
|
5
5
|
"noctcore-observability/no-error-detail-loss": "error",
|
|
6
6
|
// Inert until you set `auditCallees`, so it ships enabled but checks nothing by default.
|
|
7
7
|
"noctcore-observability/audit-pii-declared": "error"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `noctcore-observability/no-sensitive-fields-in-logs`
|
|
2
2
|
|
|
3
|
-
> A name-heuristic guard against writing credentials and secrets into log sinks. Ships at `
|
|
3
|
+
> A name-heuristic guard against writing credentials and secrets into log sinks. Ships at `error`.
|
|
4
4
|
|
|
5
5
|
## Why
|
|
6
6
|
|
|
@@ -9,8 +9,10 @@ Logs are long-lived, widely readable, and shipped to third-party aggregators. A
|
|
|
9
9
|
request by months. This rule catches the most common shape — a variable, property, or object key
|
|
10
10
|
whose **name** matches a sensitive-field denylist appearing inside a logger call.
|
|
11
11
|
|
|
12
|
-
It reads **names, never values**, so it is a heuristic
|
|
13
|
-
|
|
12
|
+
It reads **names, never values**, so it is a heuristic. It still ships at `error`: a miss puts a
|
|
13
|
+
credential in a long-lived log sink, while a false positive costs a rename or an explicit `redact()`.
|
|
14
|
+
Tests that log a secret on purpose (to prove a redaction boundary works) should turn the rule off for
|
|
15
|
+
those files in config.
|
|
14
16
|
|
|
15
17
|
## What it flags
|
|
16
18
|
|
|
@@ -55,4 +57,4 @@ type Options = {
|
|
|
55
57
|
## When not to use it
|
|
56
58
|
|
|
57
59
|
If your logging pipeline already redacts sensitive fields centrally (a serializer denylist), this
|
|
58
|
-
rule is redundant. Otherwise keep it on at `
|
|
60
|
+
rule is redundant. Otherwise keep it on at `error` as a second line of defence.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctcore/eslint-plugin-observability",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Structured-logging discipline ESLint rules — context objects over interpolated messages, no sensitive fields in logs, no error-detail loss.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|