securenow 8.9.0 → 8.11.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/NPM_README.md +30 -0
- package/README.md +142 -360
- package/SKILL-API.md +23 -0
- package/SKILL-CLI.md +21 -3
- package/TELEMETRY-SQL.md +98 -0
- package/cli/agent.js +65 -0
- package/cli/telemetry.js +199 -0
- package/cli.js +56 -1
- package/legacy-semconv.js +349 -0
- package/mcp/catalog.js +85 -0
- package/nextjs.js +773 -768
- package/nuxt-server-plugin.mjs +510 -506
- package/package.json +205 -193
- package/telemetry-schema.d.ts +16 -0
- package/telemetry-schema.js +3 -0
- package/telemetry-schema.json +188 -0
- package/tracing.js +852 -844
package/package.json
CHANGED
|
@@ -1,193 +1,205 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "securenow",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "OpenTelemetry instrumentation for Node.js, Next.js, and Nuxt - Send traces and logs to any OTLP-compatible backend",
|
|
5
|
-
"type": "commonjs",
|
|
6
|
-
"main": "register.js",
|
|
7
|
-
"types": "register.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"securenow": "cli.js",
|
|
10
|
-
"securenow-mcp": "mcp/server.js"
|
|
11
|
-
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"default": "./
|
|
63
|
-
},
|
|
64
|
-
"./
|
|
65
|
-
"types": "./
|
|
66
|
-
"default": "./
|
|
67
|
-
},
|
|
68
|
-
"./
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"default": "./
|
|
86
|
-
},
|
|
87
|
-
"./
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"default": "./
|
|
96
|
-
},
|
|
97
|
-
"./
|
|
98
|
-
"default": "./
|
|
99
|
-
},
|
|
100
|
-
"./
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"./
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"./
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"@opentelemetry/
|
|
180
|
-
"@opentelemetry/
|
|
181
|
-
"@opentelemetry/
|
|
182
|
-
"@opentelemetry/
|
|
183
|
-
"@opentelemetry/
|
|
184
|
-
"@opentelemetry/
|
|
185
|
-
"@opentelemetry/
|
|
186
|
-
"@opentelemetry/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"@
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "securenow",
|
|
3
|
+
"version": "8.11.0",
|
|
4
|
+
"description": "OpenTelemetry instrumentation for Node.js, Next.js, and Nuxt - Send traces and logs to any OTLP-compatible backend",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "register.js",
|
|
7
|
+
"types": "register.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"securenow": "cli.js",
|
|
10
|
+
"securenow-mcp": "mcp/server.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "node test-app-config.js && node test-resolve-ip.js && node test-otel-defaults.js && node test-telemetry.js && node test-legacy-semconv.js && node test-package-contents.js"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"opentelemetry",
|
|
17
|
+
"otel",
|
|
18
|
+
"tracing",
|
|
19
|
+
"logging",
|
|
20
|
+
"logs",
|
|
21
|
+
"observability",
|
|
22
|
+
"apm",
|
|
23
|
+
"monitoring",
|
|
24
|
+
"cli",
|
|
25
|
+
"nextjs",
|
|
26
|
+
"next.js",
|
|
27
|
+
"instrumentation",
|
|
28
|
+
"telemetry",
|
|
29
|
+
"distributed-tracing",
|
|
30
|
+
"node",
|
|
31
|
+
"express",
|
|
32
|
+
"fastify",
|
|
33
|
+
"nestjs",
|
|
34
|
+
"nuxt",
|
|
35
|
+
"nuxt3",
|
|
36
|
+
"nitro",
|
|
37
|
+
"vue",
|
|
38
|
+
"firewall",
|
|
39
|
+
"ip-blocking",
|
|
40
|
+
"waf",
|
|
41
|
+
"security"
|
|
42
|
+
],
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./register.d.ts",
|
|
46
|
+
"default": "./register.js"
|
|
47
|
+
},
|
|
48
|
+
"./register": {
|
|
49
|
+
"types": "./register.d.ts",
|
|
50
|
+
"default": "./register.js"
|
|
51
|
+
},
|
|
52
|
+
"./tracing": {
|
|
53
|
+
"types": "./tracing.d.ts",
|
|
54
|
+
"default": "./tracing.js"
|
|
55
|
+
},
|
|
56
|
+
"./events": {
|
|
57
|
+
"types": "./events.d.ts",
|
|
58
|
+
"default": "./events.js"
|
|
59
|
+
},
|
|
60
|
+
"./telemetry-schema": {
|
|
61
|
+
"types": "./telemetry-schema.d.ts",
|
|
62
|
+
"default": "./telemetry-schema.js"
|
|
63
|
+
},
|
|
64
|
+
"./sessions": {
|
|
65
|
+
"types": "./sessions.d.ts",
|
|
66
|
+
"default": "./sessions.js"
|
|
67
|
+
},
|
|
68
|
+
"./console-instrumentation": {
|
|
69
|
+
"default": "./console-instrumentation.js"
|
|
70
|
+
},
|
|
71
|
+
"./nextjs": {
|
|
72
|
+
"types": "./nextjs.d.ts",
|
|
73
|
+
"default": "./nextjs.js"
|
|
74
|
+
},
|
|
75
|
+
"./nextjs-auto-capture": {
|
|
76
|
+
"types": "./nextjs-auto-capture.d.ts",
|
|
77
|
+
"default": "./nextjs-auto-capture.js"
|
|
78
|
+
},
|
|
79
|
+
"./nextjs-middleware": {
|
|
80
|
+
"types": "./nextjs-middleware.d.ts",
|
|
81
|
+
"default": "./nextjs-middleware.js"
|
|
82
|
+
},
|
|
83
|
+
"./nextjs-wrapper": {
|
|
84
|
+
"types": "./nextjs-wrapper.d.ts",
|
|
85
|
+
"default": "./nextjs-wrapper.js"
|
|
86
|
+
},
|
|
87
|
+
"./nextjs-webpack-config": "./nextjs-webpack-config.js",
|
|
88
|
+
"./package.json": "./package.json",
|
|
89
|
+
"./nuxt": {
|
|
90
|
+
"types": "./nuxt.d.ts",
|
|
91
|
+
"import": "./nuxt.mjs",
|
|
92
|
+
"default": "./nuxt.mjs"
|
|
93
|
+
},
|
|
94
|
+
"./firewall": {
|
|
95
|
+
"default": "./firewall.js"
|
|
96
|
+
},
|
|
97
|
+
"./challenge": {
|
|
98
|
+
"default": "./challenge.js"
|
|
99
|
+
},
|
|
100
|
+
"./rate-limits": {
|
|
101
|
+
"types": "./rate-limits.d.ts",
|
|
102
|
+
"default": "./rate-limits.js"
|
|
103
|
+
},
|
|
104
|
+
"./firewall-only": {
|
|
105
|
+
"default": "./firewall-only.js"
|
|
106
|
+
},
|
|
107
|
+
"./cidr": {
|
|
108
|
+
"default": "./cidr.js"
|
|
109
|
+
},
|
|
110
|
+
"./resolve-ip": {
|
|
111
|
+
"default": "./resolve-ip.js"
|
|
112
|
+
},
|
|
113
|
+
"./register-vite": "./register-vite.js",
|
|
114
|
+
"./web-vite": {
|
|
115
|
+
"import": "./web-vite.mjs",
|
|
116
|
+
"default": "./web-vite.mjs"
|
|
117
|
+
},
|
|
118
|
+
"./app-config": {
|
|
119
|
+
"default": "./app-config.js"
|
|
120
|
+
},
|
|
121
|
+
"./mcp": {
|
|
122
|
+
"default": "./mcp/server.js"
|
|
123
|
+
},
|
|
124
|
+
"./mcp/catalog": {
|
|
125
|
+
"default": "./mcp/catalog.js"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"files": [
|
|
129
|
+
"register.js",
|
|
130
|
+
"register.d.ts",
|
|
131
|
+
"tracing.js",
|
|
132
|
+
"tracing.d.ts",
|
|
133
|
+
"events.js",
|
|
134
|
+
"events.d.ts",
|
|
135
|
+
"telemetry-schema.js",
|
|
136
|
+
"telemetry-schema.d.ts",
|
|
137
|
+
"telemetry-schema.json",
|
|
138
|
+
"sessions.js",
|
|
139
|
+
"sessions.d.ts",
|
|
140
|
+
"console-instrumentation.js",
|
|
141
|
+
"nextjs.js",
|
|
142
|
+
"nextjs.d.ts",
|
|
143
|
+
"nextjs-auto-capture.js",
|
|
144
|
+
"nextjs-auto-capture.d.ts",
|
|
145
|
+
"nextjs-middleware.js",
|
|
146
|
+
"nextjs-middleware.d.ts",
|
|
147
|
+
"nextjs-wrapper.js",
|
|
148
|
+
"nextjs-wrapper.d.ts",
|
|
149
|
+
"nextjs-webpack-config.js",
|
|
150
|
+
"nuxt.mjs",
|
|
151
|
+
"nuxt.d.ts",
|
|
152
|
+
"nuxt-server-plugin.mjs",
|
|
153
|
+
"cli.js",
|
|
154
|
+
"cli/",
|
|
155
|
+
"mcp/",
|
|
156
|
+
"free-trial-banner.js",
|
|
157
|
+
"resolve-ip.js",
|
|
158
|
+
"cidr.js",
|
|
159
|
+
"firewall.js",
|
|
160
|
+
"challenge.js",
|
|
161
|
+
"otel-defaults.js",
|
|
162
|
+
"legacy-semconv.js",
|
|
163
|
+
"rate-limits.js",
|
|
164
|
+
"rate-limits.d.ts",
|
|
165
|
+
"firewall-only.js",
|
|
166
|
+
"firewall-tcp.js",
|
|
167
|
+
"firewall-iptables.js",
|
|
168
|
+
"firewall-cloud.js",
|
|
169
|
+
"register-vite.js",
|
|
170
|
+
"web-vite.mjs",
|
|
171
|
+
"app-config.js",
|
|
172
|
+
"README.md",
|
|
173
|
+
"NPM_README.md",
|
|
174
|
+
"TELEMETRY-SQL.md",
|
|
175
|
+
"SKILL-CLI.md",
|
|
176
|
+
"SKILL-API.md"
|
|
177
|
+
],
|
|
178
|
+
"dependencies": {
|
|
179
|
+
"@opentelemetry/api": ">=1.9.0 <1.10.0",
|
|
180
|
+
"@opentelemetry/api-logs": "0.222.0",
|
|
181
|
+
"@opentelemetry/auto-instrumentations-node": "0.80.0",
|
|
182
|
+
"@opentelemetry/core": "2.11.0",
|
|
183
|
+
"@opentelemetry/exporter-logs-otlp-http": "0.222.0",
|
|
184
|
+
"@opentelemetry/exporter-trace-otlp-http": "0.222.0",
|
|
185
|
+
"@opentelemetry/instrumentation": "0.222.0",
|
|
186
|
+
"@opentelemetry/instrumentation-document-load": "0.67.0",
|
|
187
|
+
"@opentelemetry/instrumentation-fetch": "0.222.0",
|
|
188
|
+
"@opentelemetry/instrumentation-http": "0.222.0",
|
|
189
|
+
"@opentelemetry/instrumentation-mongodb": "0.75.0",
|
|
190
|
+
"@opentelemetry/instrumentation-user-interaction": "0.66.0",
|
|
191
|
+
"@opentelemetry/instrumentation-xml-http-request": "0.222.0",
|
|
192
|
+
"@opentelemetry/resources": "2.11.0",
|
|
193
|
+
"@opentelemetry/sdk-logs": "0.222.0",
|
|
194
|
+
"@opentelemetry/sdk-metrics": "2.11.0",
|
|
195
|
+
"@opentelemetry/sdk-node": "0.222.0",
|
|
196
|
+
"@opentelemetry/sdk-trace-base": "2.11.0",
|
|
197
|
+
"@opentelemetry/sdk-trace-web": "2.11.0",
|
|
198
|
+
"@opentelemetry/semantic-conventions": "1.43.0"
|
|
199
|
+
},
|
|
200
|
+
"optionalDependencies": {
|
|
201
|
+
"@vercel/otel": "2.1.3"
|
|
202
|
+
},
|
|
203
|
+
"sideEffects": true,
|
|
204
|
+
"license": "ISC"
|
|
205
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SecureNowTelemetrySchema {
|
|
2
|
+
contract: string;
|
|
3
|
+
schemaVersion: string;
|
|
4
|
+
dialect: 'ClickHouse';
|
|
5
|
+
purpose: string;
|
|
6
|
+
ruleContract: Record<string, unknown>;
|
|
7
|
+
tables: Record<string, unknown>;
|
|
8
|
+
clientIp: Record<string, unknown>;
|
|
9
|
+
customEvents: Record<string, unknown>;
|
|
10
|
+
automaticTraceFields: Record<string, string[]>;
|
|
11
|
+
templates: Record<string, string>;
|
|
12
|
+
authoringWorkflow: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const schema: SecureNowTelemetrySchema;
|
|
16
|
+
export = schema;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "securenow.telemetry.alert-sql",
|
|
3
|
+
"schemaVersion": "1.0.0",
|
|
4
|
+
"dialect": "ClickHouse",
|
|
5
|
+
"purpose": "Canonical local contract for agents and humans authoring SecureNow alert rules.",
|
|
6
|
+
"ruleContract": {
|
|
7
|
+
"tenantPlaceholder": "__USER_APP_KEYS__",
|
|
8
|
+
"requiredResultColumns": [
|
|
9
|
+
{
|
|
10
|
+
"name": "ip",
|
|
11
|
+
"type": "String",
|
|
12
|
+
"reason": "Per-IP grouping and IP-based remediation use this column. Keep empty IPs out of the final result."
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"requirements": [
|
|
16
|
+
"Query only documented telemetry tables and fields.",
|
|
17
|
+
"Keep __USER_APP_KEYS__ in every customer-scoped query.",
|
|
18
|
+
"Use the tenant expression documented for the selected table.",
|
|
19
|
+
"Return an ip column and exclude empty IP values for IP-remediation rules.",
|
|
20
|
+
"Bound every query with a time window.",
|
|
21
|
+
"Validate candidate SQL before creating or updating a rule.",
|
|
22
|
+
"Treat fields absent from live field discovery as unverified until instrumentation emits them."
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"tables": {
|
|
26
|
+
"logs": {
|
|
27
|
+
"name": "signoz_logs.distributed_logs_v2",
|
|
28
|
+
"purpose": "OpenTelemetry logs and SecureNow custom security events.",
|
|
29
|
+
"timestamp": {
|
|
30
|
+
"column": "timestamp",
|
|
31
|
+
"type": "UInt64",
|
|
32
|
+
"unit": "nanoseconds",
|
|
33
|
+
"timeFilterExample": "timestamp >= toUnixTimestamp64Nano(now64() - INTERVAL 15 MINUTE)"
|
|
34
|
+
},
|
|
35
|
+
"tenantExpression": "resources_string['service.name'] IN (__USER_APP_KEYS__)",
|
|
36
|
+
"columns": {
|
|
37
|
+
"timestamp": "UInt64 nanoseconds",
|
|
38
|
+
"observed_timestamp": "UInt64 nanoseconds",
|
|
39
|
+
"id": "String",
|
|
40
|
+
"trace_id": "String",
|
|
41
|
+
"span_id": "String",
|
|
42
|
+
"severity_text": "LowCardinality(String)",
|
|
43
|
+
"severity_number": "UInt8",
|
|
44
|
+
"body": "String",
|
|
45
|
+
"attributes_string": "Map(String, String)",
|
|
46
|
+
"attributes_number": "Map(String, Float64)",
|
|
47
|
+
"attributes_bool": "Map(String, Bool)",
|
|
48
|
+
"resources_string": "Map(String, String)",
|
|
49
|
+
"scope_name": "String",
|
|
50
|
+
"scope_version": "String"
|
|
51
|
+
},
|
|
52
|
+
"mapAccess": {
|
|
53
|
+
"string": "attributes_string['field.name']",
|
|
54
|
+
"number": "attributes_number['field.name']",
|
|
55
|
+
"boolean": "attributes_bool['field.name']",
|
|
56
|
+
"resource": "resources_string['field.name']"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"traces": {
|
|
60
|
+
"name": "signoz_traces.distributed_signoz_index_v3",
|
|
61
|
+
"purpose": "OpenTelemetry spans including automatically captured HTTP request telemetry.",
|
|
62
|
+
"timestamp": {
|
|
63
|
+
"column": "timestamp",
|
|
64
|
+
"type": "DateTime64(9)",
|
|
65
|
+
"unit": "nanoseconds precision",
|
|
66
|
+
"timeFilterExample": "timestamp >= now64(9) - INTERVAL 15 MINUTE"
|
|
67
|
+
},
|
|
68
|
+
"tenantExpression": "`resource_string_service$$name` IN (__USER_APP_KEYS__)",
|
|
69
|
+
"columns": {
|
|
70
|
+
"timestamp": "DateTime64(9)",
|
|
71
|
+
"trace_id": "FixedString(32)",
|
|
72
|
+
"span_id": "String",
|
|
73
|
+
"parent_span_id": "String",
|
|
74
|
+
"name": "LowCardinality(String)",
|
|
75
|
+
"kind": "Int8 (1 internal, 2 server, 3 client, 4 producer, 5 consumer)",
|
|
76
|
+
"duration_nano": "UInt64",
|
|
77
|
+
"status_code": "Int16",
|
|
78
|
+
"status_message": "String",
|
|
79
|
+
"attributes_string": "Map(String, String)",
|
|
80
|
+
"attributes_number": "Map(String, Float64)",
|
|
81
|
+
"attributes_bool": "Map(String, Bool)",
|
|
82
|
+
"resources_string": "Map(String, String)",
|
|
83
|
+
"response_status_code": "LowCardinality(String)",
|
|
84
|
+
"http_url": "LowCardinality(String)",
|
|
85
|
+
"http_method": "LowCardinality(String)",
|
|
86
|
+
"http_host": "LowCardinality(String)",
|
|
87
|
+
"has_error": "Bool",
|
|
88
|
+
"resource_string_service$$name": "LowCardinality(String)",
|
|
89
|
+
"attribute_string_http$$route": "LowCardinality(String)"
|
|
90
|
+
},
|
|
91
|
+
"mapAccess": {
|
|
92
|
+
"string": "attributes_string['field.name']",
|
|
93
|
+
"number": "attributes_number['field.name']",
|
|
94
|
+
"boolean": "attributes_bool['field.name']",
|
|
95
|
+
"resource": "resources_string['field.name']"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"clientIp": {
|
|
100
|
+
"preferredField": "http.client_ip",
|
|
101
|
+
"traceExpression": "coalesce(nullIf(attributes_string['http.client_ip'], ''), nullIf(attributes_string['net.peer.ip'], ''), nullIf(attributes_string['network.peer.address'], ''), nullIf(attributes_string['client.address'], ''), nullIf(attributes_string['net.sock.peer.addr'], ''))",
|
|
102
|
+
"eventExpression": "attributes_string['http.client_ip']",
|
|
103
|
+
"trustNote": "Confirm trusted-proxy configuration before using forwarded IPs for blocking."
|
|
104
|
+
},
|
|
105
|
+
"customEvents": {
|
|
106
|
+
"sdkImport": "securenow/events",
|
|
107
|
+
"signature": "track(type: string, props?: TrackProps): void",
|
|
108
|
+
"storageTable": "logs",
|
|
109
|
+
"propertyMapping": {
|
|
110
|
+
"type": "attributes_string['event.type']",
|
|
111
|
+
"userId": "attributes_string['enduser.id']",
|
|
112
|
+
"sessionId": "attributes_string['session.id']",
|
|
113
|
+
"ip": "attributes_string['http.client_ip']",
|
|
114
|
+
"userAgent": "attributes_string['http.user_agent']",
|
|
115
|
+
"severity": "severity_text",
|
|
116
|
+
"attributes.string": "attributes_string['<custom-key>']",
|
|
117
|
+
"attributes.number": "attributes_number['<custom-key>']",
|
|
118
|
+
"attributes.boolean": "attributes_bool['<custom-key>']"
|
|
119
|
+
},
|
|
120
|
+
"recommendedAuthenticationEvents": [
|
|
121
|
+
"auth.login.failure",
|
|
122
|
+
"auth.login.success",
|
|
123
|
+
"auth.otp.send.requested",
|
|
124
|
+
"auth.otp.send.result",
|
|
125
|
+
"auth.otp.verify.failure",
|
|
126
|
+
"auth.otp.verify.success",
|
|
127
|
+
"auth.password_reset.requested",
|
|
128
|
+
"auth.password_reset.completed",
|
|
129
|
+
"auth.mfa.challenge.failure",
|
|
130
|
+
"auth.mfa.challenge.success",
|
|
131
|
+
"auth.session.revoked"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"automaticTraceFields": {
|
|
135
|
+
"http": [
|
|
136
|
+
"http.method",
|
|
137
|
+
"http.route",
|
|
138
|
+
"http.target",
|
|
139
|
+
"http.url",
|
|
140
|
+
"http.status_code",
|
|
141
|
+
"http.host",
|
|
142
|
+
"http.scheme",
|
|
143
|
+
"http.user_agent"
|
|
144
|
+
],
|
|
145
|
+
"clientAndProxy": [
|
|
146
|
+
"http.client_ip",
|
|
147
|
+
"http.client_ip.source",
|
|
148
|
+
"http.socket_ip",
|
|
149
|
+
"http.forwarded_for",
|
|
150
|
+
"http.real_ip",
|
|
151
|
+
"http.cf.connecting_ip",
|
|
152
|
+
"http.proxy.trusted"
|
|
153
|
+
],
|
|
154
|
+
"securityPresenceOnly": [
|
|
155
|
+
"http.security.auth_present",
|
|
156
|
+
"http.security.cookies_present",
|
|
157
|
+
"http.security.csrf_token_present"
|
|
158
|
+
],
|
|
159
|
+
"optionalBodyCapture": [
|
|
160
|
+
"http.request.body",
|
|
161
|
+
"http.request.body.type",
|
|
162
|
+
"http.request.body.size",
|
|
163
|
+
"http.request.body.parse_error"
|
|
164
|
+
],
|
|
165
|
+
"resources": [
|
|
166
|
+
"service.name",
|
|
167
|
+
"service.instance.id",
|
|
168
|
+
"service.version",
|
|
169
|
+
"deployment.environment",
|
|
170
|
+
"telemetry.sdk.name",
|
|
171
|
+
"telemetry.sdk.language",
|
|
172
|
+
"telemetry.sdk.version"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"templates": {
|
|
176
|
+
"traceBurstByIp": "WITH coalesce(nullIf(attributes_string['http.client_ip'], ''), nullIf(attributes_string['net.peer.ip'], ''), nullIf(attributes_string['network.peer.address'], ''), nullIf(attributes_string['client.address'], ''), nullIf(attributes_string['net.sock.peer.addr'], '')) AS client_ip\nSELECT client_ip AS ip, count() AS hits\nFROM signoz_traces.distributed_signoz_index_v3\nWHERE `resource_string_service$$name` IN (__USER_APP_KEYS__)\n AND timestamp >= now64(9) - INTERVAL 15 MINUTE\n AND attributes_string['http.target'] = '/replace-with-real-route'\nGROUP BY ip\nHAVING ip != '' AND hits >= 20",
|
|
177
|
+
"eventFailuresByIp": "SELECT attributes_string['http.client_ip'] AS ip, count() AS failures\nFROM signoz_logs.distributed_logs_v2\nWHERE resources_string['service.name'] IN (__USER_APP_KEYS__)\n AND timestamp >= toUnixTimestamp64Nano(now64() - INTERVAL 15 MINUTE)\n AND attributes_string['event.type'] = 'replace.with.verified.event'\nGROUP BY ip\nHAVING ip != '' AND failures >= 10"
|
|
178
|
+
},
|
|
179
|
+
"authoringWorkflow": [
|
|
180
|
+
"npx securenow telemetry schema --json",
|
|
181
|
+
"npx securenow telemetry fields --app <key> --env production --since 24h --json",
|
|
182
|
+
"npx securenow alerts rules --json",
|
|
183
|
+
"npx securenow alerts rules validate --sql @rule.sql --app <key>",
|
|
184
|
+
"npx securenow alerts rules create --name <name> --sql @rule.sql --apps <key>",
|
|
185
|
+
"npx securenow alerts rules test <rule-id> --mode dry_run --wait",
|
|
186
|
+
"npx securenow alerts rules promote <rule-id>"
|
|
187
|
+
]
|
|
188
|
+
}
|