@contrast/agent 4.32.0 → 5.0.0-alpha.2
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/lib/index.js +55 -0
- package/package.json +21 -202
- package/LICENSE +0 -12
- package/README.md +0 -111
- package/agent-loader.js +0 -44
- package/bin/VERSION +0 -1
- package/bin/contrast-service-darwin-arm64 +0 -0
- package/bin/contrast-service-darwin-x64 +0 -0
- package/bin/contrast-service-linux-arm64 +0 -0
- package/bin/contrast-service-linux-x64 +0 -0
- package/bin/contrast-service-win32-x64.exe +0 -0
- package/bootstrap.js +0 -65
- package/changelog.config.js +0 -56
- package/cli-rewriter.js +0 -24
- package/cli.js +0 -38
- package/config-diagnostics.js +0 -127
- package/esm.mjs +0 -156
- package/lib/agent-emitter.js +0 -89
- package/lib/agent.js +0 -214
- package/lib/app-info.js +0 -150
- package/lib/assess/deadzones/index.js +0 -93
- package/lib/assess/deadzones/rewrite.js +0 -64
- package/lib/assess/express/index.js +0 -29
- package/lib/assess/express/route-coverage.js +0 -143
- package/lib/assess/express/sinks/index.js +0 -23
- package/lib/assess/express/sinks/xss.js +0 -88
- package/lib/assess/express/sources.js +0 -56
- package/lib/assess/fastify/index.js +0 -29
- package/lib/assess/fastify/route-coverage.js +0 -119
- package/lib/assess/fastify/sinks/index.js +0 -25
- package/lib/assess/fastify/sinks/response-scanning.js +0 -54
- package/lib/assess/fastify/sinks/unvalidated-redirect.js +0 -95
- package/lib/assess/fastify/sinks/xss.js +0 -238
- package/lib/assess/fastify/sources.js +0 -76
- package/lib/assess/hapi/index.js +0 -29
- package/lib/assess/hapi/route-coverage.js +0 -163
- package/lib/assess/hapi/sinks/index.js +0 -27
- package/lib/assess/hapi/sinks/response-scanning.js +0 -49
- package/lib/assess/hapi/sinks/session.js +0 -125
- package/lib/assess/hapi/sinks/unvalidated-redirect.js +0 -100
- package/lib/assess/hapi/sinks/xss.js +0 -178
- package/lib/assess/hapi/sources.js +0 -37
- package/lib/assess/index.js +0 -35
- package/lib/assess/koa/index.js +0 -29
- package/lib/assess/koa/route-coverage.js +0 -114
- package/lib/assess/koa/sinks/index.js +0 -25
- package/lib/assess/koa/sinks/response-scanning.js +0 -40
- package/lib/assess/koa/sinks/unvalidated-redirect.js +0 -96
- package/lib/assess/koa/sinks/xss.js +0 -127
- package/lib/assess/koa/sources.js +0 -145
- package/lib/assess/loopback4/index.js +0 -29
- package/lib/assess/loopback4/route-coverage.js +0 -129
- package/lib/assess/loopback4/sinks/index.js +0 -25
- package/lib/assess/loopback4/sinks/response-scanning.js +0 -39
- package/lib/assess/loopback4/sinks/xss.js +0 -77
- package/lib/assess/loopback4/sources.js +0 -33
- package/lib/assess/membrane/debraner.js +0 -170
- package/lib/assess/membrane/deserialization-membrane.js +0 -76
- package/lib/assess/membrane/index.js +0 -463
- package/lib/assess/membrane/source-membrane.js +0 -415
- package/lib/assess/models/base-event.js +0 -207
- package/lib/assess/models/call-context.js +0 -197
- package/lib/assess/models/index.js +0 -31
- package/lib/assess/models/propagation-event.js +0 -77
- package/lib/assess/models/signature.js +0 -92
- package/lib/assess/models/sink-event.js +0 -43
- package/lib/assess/models/source-event.js +0 -95
- package/lib/assess/models/tag-range/index.js +0 -180
- package/lib/assess/models/tag-range/relationships.js +0 -67
- package/lib/assess/models/tag-range/util.js +0 -363
- package/lib/assess/policy/deadzones.json +0 -185
- package/lib/assess/policy/index.js +0 -20
- package/lib/assess/policy/init.js +0 -309
- package/lib/assess/policy/non-dataflow-rules.json +0 -156
- package/lib/assess/policy/propagators.json +0 -545
- package/lib/assess/policy/rules.json +0 -1682
- package/lib/assess/policy/signatures.json +0 -1412
- package/lib/assess/policy/util.js +0 -423
- package/lib/assess/propagators/JSON/parse.js +0 -53
- package/lib/assess/propagators/JSON/stringify.js +0 -444
- package/lib/assess/propagators/ajv/conditionals.js +0 -164
- package/lib/assess/propagators/ajv/evaluator-shim.js +0 -42
- package/lib/assess/propagators/ajv/index.js +0 -91
- package/lib/assess/propagators/ajv/json-schema-type-evaluators.js +0 -495
- package/lib/assess/propagators/ajv/object-walk.js +0 -76
- package/lib/assess/propagators/ajv/refs.js +0 -265
- package/lib/assess/propagators/ajv/schema-context.js +0 -388
- package/lib/assess/propagators/array-prototype-join.js +0 -163
- package/lib/assess/propagators/common.js +0 -137
- package/lib/assess/propagators/dustjs/escape-html.js +0 -22
- package/lib/assess/propagators/dustjs/escape-js.js +0 -22
- package/lib/assess/propagators/ejs-template-generate-source.js +0 -64
- package/lib/assess/propagators/encode-uri/encode-uri-component.js +0 -22
- package/lib/assess/propagators/encode-uri/encode-uri.js +0 -22
- package/lib/assess/propagators/fastify-static/allowed-path.js +0 -85
- package/lib/assess/propagators/handlebars-compile.js +0 -78
- package/lib/assess/propagators/handlebars-escape-expresssion.js +0 -71
- package/lib/assess/propagators/index.js +0 -154
- package/lib/assess/propagators/joi/any.js +0 -47
- package/lib/assess/propagators/joi/boolean.js +0 -68
- package/lib/assess/propagators/joi/expression.js +0 -48
- package/lib/assess/propagators/joi/index.js +0 -27
- package/lib/assess/propagators/joi/keys.js +0 -72
- package/lib/assess/propagators/joi/number.js +0 -67
- package/lib/assess/propagators/joi/object.js +0 -60
- package/lib/assess/propagators/joi/string-base.js +0 -123
- package/lib/assess/propagators/joi/string-schema.js +0 -199
- package/lib/assess/propagators/joi/values.js +0 -304
- package/lib/assess/propagators/manager.js +0 -469
- package/lib/assess/propagators/mongoose/helpers.js +0 -57
- package/lib/assess/propagators/mongoose/index.js +0 -19
- package/lib/assess/propagators/mongoose/map.js +0 -62
- package/lib/assess/propagators/mongoose/mixed.js +0 -71
- package/lib/assess/propagators/mongoose/string.js +0 -112
- package/lib/assess/propagators/mustache/escape.js +0 -22
- package/lib/assess/propagators/number.js +0 -54
- package/lib/assess/propagators/object.js +0 -60
- package/lib/assess/propagators/path/basename.js +0 -113
- package/lib/assess/propagators/path/common.js +0 -387
- package/lib/assess/propagators/path/dirname.js +0 -78
- package/lib/assess/propagators/path/extname.js +0 -83
- package/lib/assess/propagators/path/format.js +0 -65
- package/lib/assess/propagators/path/join.js +0 -53
- package/lib/assess/propagators/path/normalize.js +0 -55
- package/lib/assess/propagators/path/parse.js +0 -43
- package/lib/assess/propagators/path/relative.js +0 -154
- package/lib/assess/propagators/path/resolve.js +0 -63
- package/lib/assess/propagators/path/to-namespaced-path.js +0 -52
- package/lib/assess/propagators/pug-compile.js +0 -58
- package/lib/assess/propagators/querystring/escape.js +0 -56
- package/lib/assess/propagators/querystring/parse.js +0 -118
- package/lib/assess/propagators/querystring/stringify.js +0 -313
- package/lib/assess/propagators/querystring/unescape.js +0 -60
- package/lib/assess/propagators/querystring/utils.js +0 -69
- package/lib/assess/propagators/sequelize/sql-string-escape.js +0 -61
- package/lib/assess/propagators/sequelize/sql-string-format-named-parameters.js +0 -145
- package/lib/assess/propagators/sequelize/sql-string-format.js +0 -104
- package/lib/assess/propagators/sequelize/utils.js +0 -36
- package/lib/assess/propagators/serve-static.js +0 -109
- package/lib/assess/propagators/string-prototype-replace.js +0 -671
- package/lib/assess/propagators/string-prototype-split.js +0 -266
- package/lib/assess/propagators/string-prototype-trim.js +0 -61
- package/lib/assess/propagators/string.js +0 -68
- package/lib/assess/propagators/template-escape.js +0 -87
- package/lib/assess/propagators/templates.js +0 -168
- package/lib/assess/propagators/url/url-prototype-parse.js +0 -133
- package/lib/assess/propagators/url/url-url.js +0 -464
- package/lib/assess/propagators/url/utils.js +0 -58
- package/lib/assess/propagators/util/format.js +0 -305
- package/lib/assess/propagators/utils.js +0 -148
- package/lib/assess/propagators/v8/init-hooks.js +0 -142
- package/lib/assess/propagators/validator/init-hooks.js +0 -252
- package/lib/assess/propagators/validator/validator-methods.js +0 -98
- package/lib/assess/response-scanning/app-activity.js +0 -33
- package/lib/assess/response-scanning/autocomplete-missing.js +0 -66
- package/lib/assess/response-scanning/cache-controls-missing.js +0 -205
- package/lib/assess/response-scanning/clickjacking-control-missing.js +0 -49
- package/lib/assess/response-scanning/common.js +0 -58
- package/lib/assess/response-scanning/cookies/common.js +0 -63
- package/lib/assess/response-scanning/cookies/events.js +0 -28
- package/lib/assess/response-scanning/cookies/httponly.js +0 -45
- package/lib/assess/response-scanning/cookies/secure-flag-missing.js +0 -46
- package/lib/assess/response-scanning/headers/csp-header-insecure.js +0 -190
- package/lib/assess/response-scanning/headers/csp-header-missing.js +0 -45
- package/lib/assess/response-scanning/headers/csp-utils.js +0 -28
- package/lib/assess/response-scanning/headers/hsts-header-missing.js +0 -59
- package/lib/assess/response-scanning/headers/powered-by.js +0 -53
- package/lib/assess/response-scanning/headers/xcontenttype-header-missing.js +0 -51
- package/lib/assess/response-scanning/headers/xxssprotection-header-disabled.js +0 -46
- package/lib/assess/response-scanning/parameter-pollution.js +0 -63
- package/lib/assess/response-scanning/parseable-response-emitter.js +0 -43
- package/lib/assess/restify/index.js +0 -30
- package/lib/assess/restify/route-coverage.js +0 -86
- package/lib/assess/restify/session.js +0 -53
- package/lib/assess/restify/sinks/index.js +0 -25
- package/lib/assess/restify/sinks/response-scanning.js +0 -48
- package/lib/assess/restify/sinks/unvalidated-redirect.js +0 -100
- package/lib/assess/restify/sinks/xss.js +0 -87
- package/lib/assess/restify/sources.js +0 -224
- package/lib/assess/sinks/common.js +0 -513
- package/lib/assess/sinks/dustjs-linkedin-xss.js +0 -131
- package/lib/assess/sinks/dynamo.js +0 -277
- package/lib/assess/sinks/hapi-16-xss.js +0 -75
- package/lib/assess/sinks/index.js +0 -179
- package/lib/assess/sinks/libxmljs-xxe.js +0 -57
- package/lib/assess/sinks/mongodb.js +0 -368
- package/lib/assess/sinks/rethinkdb-nosql-injection.js +0 -142
- package/lib/assess/sinks/ssrf-url.js +0 -98
- package/lib/assess/sources/event-handler.js +0 -309
- package/lib/assess/sources/formidable.js +0 -38
- package/lib/assess/sources/index.js +0 -247
- package/lib/assess/spdy/index.js +0 -23
- package/lib/assess/spdy/sinks/index.js +0 -23
- package/lib/assess/spdy/sinks/xss.js +0 -84
- package/lib/assess/static/hardcoded.js +0 -345
- package/lib/assess/static/read-findings-from-cache.js +0 -40
- package/lib/assess/technologies/index.js +0 -48
- package/lib/assess/utils.js +0 -22
- package/lib/cat.txt +0 -87
- package/lib/cli-rewriter/index.js +0 -328
- package/lib/constants.js +0 -749
- package/lib/contrast.js +0 -497
- package/lib/core/arch-components/dynamodb.js +0 -45
- package/lib/core/arch-components/dynamodbv3.js +0 -48
- package/lib/core/arch-components/index.js +0 -23
- package/lib/core/arch-components/mongodb.js +0 -189
- package/lib/core/arch-components/mysql.js +0 -63
- package/lib/core/arch-components/postgres.js +0 -70
- package/lib/core/arch-components/rethinkdb.js +0 -53
- package/lib/core/arch-components/sqlite3.js +0 -44
- package/lib/core/arch-components/util.js +0 -51
- package/lib/core/async-storage/context.js +0 -133
- package/lib/core/async-storage/hooks/bluebird.js +0 -91
- package/lib/core/async-storage/hooks/mongodb.js +0 -157
- package/lib/core/async-storage/hooks/mysql.js +0 -154
- package/lib/core/async-storage/hooks/redis.js +0 -38
- package/lib/core/async-storage/hooks/utils.js +0 -42
- package/lib/core/async-storage/index.js +0 -222
- package/lib/core/async-storage/scopes/index.js +0 -153
- package/lib/core/common/formidable.js +0 -65
- package/lib/core/common/index.js +0 -19
- package/lib/core/config/options.js +0 -1027
- package/lib/core/config/util.js +0 -391
- package/lib/core/exclusions/exclusion-factory.js +0 -124
- package/lib/core/exclusions/exclusion.js +0 -48
- package/lib/core/exclusions/input.js +0 -95
- package/lib/core/exclusions/url.js +0 -66
- package/lib/core/express/index.js +0 -538
- package/lib/core/express/utils.js +0 -571
- package/lib/core/fastify/index.js +0 -199
- package/lib/core/fastify/utils.js +0 -28
- package/lib/core/hapi/index.js +0 -215
- package/lib/core/hapi/utils.js +0 -126
- package/lib/core/index.js +0 -34
- package/lib/core/koa/index.js +0 -299
- package/lib/core/koa/utils.js +0 -31
- package/lib/core/logger/daily-rotate-file.js +0 -45
- package/lib/core/logger/dataflow-monitor.js +0 -124
- package/lib/core/logger/debug-logger.js +0 -364
- package/lib/core/logger/index.js +0 -43
- package/lib/core/logger/perf-logger.js +0 -241
- package/lib/core/logger/umbrella-logger.js +0 -163
- package/lib/core/loopback4/index.js +0 -173
- package/lib/core/metrics/index.js +0 -150
- package/lib/core/restify/index.js +0 -147
- package/lib/core/restify/utils.js +0 -84
- package/lib/core/rewrite/assignment-expression.js +0 -40
- package/lib/core/rewrite/binary-expression.js +0 -63
- package/lib/core/rewrite/call-expression.js +0 -44
- package/lib/core/rewrite/callees.js +0 -142
- package/lib/core/rewrite/catch-clause.js +0 -49
- package/lib/core/rewrite/function-wrap.js +0 -49
- package/lib/core/rewrite/import-declaration.js +0 -71
- package/lib/core/rewrite/index.js +0 -316
- package/lib/core/rewrite/injections.js +0 -169
- package/lib/core/rewrite/is-contrast-method.js +0 -28
- package/lib/core/rewrite/log.js +0 -24
- package/lib/core/rewrite/member-expression.js +0 -52
- package/lib/core/rewrite/object-property.js +0 -46
- package/lib/core/rewrite/prepend-globals.js +0 -48
- package/lib/core/rewrite/rewrite-log.js +0 -74
- package/lib/core/rewrite/switch-statement.js +0 -71
- package/lib/core/rewrite/template-literal.js +0 -64
- package/lib/core/stacktrace.js +0 -221
- package/lib/coverage.js +0 -158
- package/lib/feature-set.js +0 -297
- package/lib/generator-function.js +0 -20
- package/lib/hooks/array.js +0 -75
- package/lib/hooks/cluster.js +0 -232
- package/lib/hooks/dataflow-monitor.js +0 -38
- package/lib/hooks/encoding.js +0 -88
- package/lib/hooks/express-fileupload.js +0 -57
- package/lib/hooks/express-session.js +0 -108
- package/lib/hooks/fn-to-string.js +0 -106
- package/lib/hooks/frameworks/base.js +0 -103
- package/lib/hooks/frameworks/common.js +0 -191
- package/lib/hooks/frameworks/hapi16.js +0 -293
- package/lib/hooks/frameworks/http.js +0 -89
- package/lib/hooks/frameworks/http2.js +0 -73
- package/lib/hooks/frameworks/index.js +0 -29
- package/lib/hooks/frameworks/spdy.js +0 -87
- package/lib/hooks/hapi-16-reply.js +0 -55
- package/lib/hooks/hapi-16-session.js +0 -312
- package/lib/hooks/http.js +0 -210
- package/lib/hooks/module/extensions.js +0 -41
- package/lib/hooks/module/helpers.js +0 -157
- package/lib/hooks/module/index.js +0 -99
- package/lib/hooks/newrelic.js +0 -60
- package/lib/hooks/object-is.js +0 -48
- package/lib/hooks/object-to-primitive.js +0 -64
- package/lib/hooks/patcher.js +0 -575
- package/lib/hooks/require.js +0 -57
- package/lib/hooks/stealthy-require.js +0 -64
- package/lib/instrumentation.js +0 -190
- package/lib/libraries.js +0 -172
- package/lib/library-usage.js +0 -51
- package/lib/list-installed.js +0 -97
- package/lib/protect/analysis/aho-corasick.js +0 -175
- package/lib/protect/analysis/dfsa-analyzer.js +0 -64
- package/lib/protect/errors/handler-async-errors.js +0 -66
- package/lib/protect/errors/handler.js +0 -55
- package/lib/protect/errors/security-exception.js +0 -31
- package/lib/protect/express/index.js +0 -27
- package/lib/protect/express/sinks.js +0 -34
- package/lib/protect/express/sources.js +0 -54
- package/lib/protect/express/utils.js +0 -60
- package/lib/protect/fastify/index.js +0 -25
- package/lib/protect/fastify/sinks.js +0 -37
- package/lib/protect/fastify/sources.js +0 -90
- package/lib/protect/hapi/error-handler.js +0 -79
- package/lib/protect/hapi/index.js +0 -27
- package/lib/protect/hapi/sinks.js +0 -40
- package/lib/protect/hapi/sources.js +0 -104
- package/lib/protect/index.js +0 -31
- package/lib/protect/input-analysis.js +0 -359
- package/lib/protect/koa/index.js +0 -25
- package/lib/protect/koa/sinks.js +0 -38
- package/lib/protect/koa/sources.js +0 -152
- package/lib/protect/listeners.js +0 -213
- package/lib/protect/loopback4/index.js +0 -23
- package/lib/protect/loopback4/sources.js +0 -48
- package/lib/protect/models/application-context.js +0 -46
- package/lib/protect/models/sink-event.js +0 -28
- package/lib/protect/models/source-event.js +0 -51
- package/lib/protect/restify/index.js +0 -25
- package/lib/protect/restify/sinks.js +0 -39
- package/lib/protect/restify/sources.js +0 -100
- package/lib/protect/rules/assessment.js +0 -204
- package/lib/protect/rules/attack-patterns.js +0 -364
- package/lib/protect/rules/base-scanner/index.js +0 -621
- package/lib/protect/rules/base-scanner/java-script-scanner.js +0 -154
- package/lib/protect/rules/base-scanner/postgresqlscanner.js +0 -26
- package/lib/protect/rules/base-scanner/scan-state.js +0 -243
- package/lib/protect/rules/base-scanner/scan-states.json +0 -14
- package/lib/protect/rules/base-scanner/substring-finder.js +0 -59
- package/lib/protect/rules/base-scanner/token-sequence.js +0 -57
- package/lib/protect/rules/bot-blocker/bot-blocker-rule.js +0 -108
- package/lib/protect/rules/bot-blocker/bots.json +0 -283
- package/lib/protect/rules/bot-blocker/index.js +0 -93
- package/lib/protect/rules/cmd-injection/cmdinjection-rule.js +0 -113
- package/lib/protect/rules/cmd-injection-command-backdoors/backdoor-detector.js +0 -103
- package/lib/protect/rules/cmd-injection-command-backdoors/cmd-injection-command-backdoors-rule.js +0 -90
- package/lib/protect/rules/cmd-injection-semantic-chained-commands/chained-command-scanner.js +0 -278
- package/lib/protect/rules/cmd-injection-semantic-chained-commands/cmd-injection-semantic-chained-commands-rule.js +0 -117
- package/lib/protect/rules/cmd-injection-semantic-dangerous-paths/cmd-injection-semantic-dangerous-paths-rule.js +0 -112
- package/lib/protect/rules/cmd-injection-semantic-dangerous-paths/dangerous-paths-scanner.js +0 -210
- package/lib/protect/rules/common.js +0 -38
- package/lib/protect/rules/index.js +0 -357
- package/lib/protect/rules/ip-denylist/ip-denylist-rule.js +0 -106
- package/lib/protect/rules/method-tampering/evaluator.js +0 -39
- package/lib/protect/rules/method-tampering/method-tampering-rule.js +0 -99
- package/lib/protect/rules/nosqli/nosql-injection-rule.js +0 -307
- package/lib/protect/rules/nosqli/nosql-scanner/index.js +0 -46
- package/lib/protect/rules/nosqli/nosql-scanner/labels.json +0 -73
- package/lib/protect/rules/nosqli/nosql-scanner/mongodbscanner.js +0 -85
- package/lib/protect/rules/nosqli/nosql-scanner/rethinkdbscanner.js +0 -26
- package/lib/protect/rules/path-traversal/path-traversal-rule.js +0 -61
- package/lib/protect/rules/rule-factory.js +0 -250
- package/lib/protect/rules/signatures/cmd-injection/config.json +0 -8
- package/lib/protect/rules/signatures/cmd-injection/custom-searchers/chained-command-searcher.js +0 -117
- package/lib/protect/rules/signatures/cmd-injection/custom-searchers/index.js +0 -26
- package/lib/protect/rules/signatures/cmd-injection/index.js +0 -30
- package/lib/protect/rules/signatures/evaluator.js +0 -187
- package/lib/protect/rules/signatures/index.js +0 -83
- package/lib/protect/rules/signatures/nosql-injection/config.json +0 -8
- package/lib/protect/rules/signatures/nosql-injection/custom-searchers/index.js +0 -28
- package/lib/protect/rules/signatures/nosql-injection/custom-searchers/nosql-comment-searcher.js +0 -42
- package/lib/protect/rules/signatures/nosql-injection/custom-searchers/simple-or-searcher.js +0 -115
- package/lib/protect/rules/signatures/nosql-injection/index.js +0 -30
- package/lib/protect/rules/signatures/path-traversal/config.json +0 -8
- package/lib/protect/rules/signatures/path-traversal/index.js +0 -30
- package/lib/protect/rules/signatures/reflected-xss/config.json +0 -14
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/behavior-url-searcher.js +0 -84
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/custom-searches.json +0 -103
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/function-definition-searcher.js +0 -59
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/immediate-function-searcher.js +0 -105
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/index.js +0 -36
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/link-and-src-target-searcher.js +0 -145
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/location-set-searcher.js +0 -72
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/map-access-searcher.js +0 -102
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/native-function-execution-searcher.js +0 -82
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/no-alnum-searcher.js +0 -50
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/redefined-function-searcher.js +0 -111
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/style-url-injection-searcher.js +0 -65
- package/lib/protect/rules/signatures/reflected-xss/custom-searchers/variable-assignment-searcher.js +0 -90
- package/lib/protect/rules/signatures/reflected-xss/helpers/function-call.js +0 -83
- package/lib/protect/rules/signatures/reflected-xss/index.js +0 -30
- package/lib/protect/rules/signatures/signature.js +0 -201
- package/lib/protect/rules/signatures/sql-injection/config.json +0 -10
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/if-else-drop-searcher.js +0 -49
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/index.js +0 -30
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/simple-or-searcher.js +0 -124
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/sql-comment-searcher.js +0 -73
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/time-function-searcher.js +0 -64
- package/lib/protect/rules/signatures/sql-injection/custom-searchers/tsql-exec-searcher.js +0 -45
- package/lib/protect/rules/signatures/sql-injection/index.js +0 -30
- package/lib/protect/rules/signatures/ssjs-injection/config.json +0 -17
- package/lib/protect/rules/signatures/ssjs-injection/index.js +0 -30
- package/lib/protect/rules/signatures/unsafe-file-upload/config.json +0 -7
- package/lib/protect/rules/signatures/unsafe-file-upload/index.js +0 -29
- package/lib/protect/rules/signatures/untrusted-deserialization/config.json +0 -8
- package/lib/protect/rules/signatures/untrusted-deserialization/index.js +0 -27
- package/lib/protect/rules/sqli/generic-complicated.js +0 -50
- package/lib/protect/rules/sqli/sql-injection-rule.js +0 -278
- package/lib/protect/rules/sqli/sql-scanner/index.js +0 -61
- package/lib/protect/rules/sqli/sql-scanner/labels.json +0 -135
- package/lib/protect/rules/sqli/sql-scanner/mysql-scanner.js +0 -170
- package/lib/protect/rules/ssjs-injection/evaluator.js +0 -48
- package/lib/protect/rules/ssjs-injection/ssjsinjection-rule.js +0 -164
- package/lib/protect/rules/unsafe-file-upload/unsafe-file-upload-rule.js +0 -33
- package/lib/protect/rules/untrusted-deserialization/untrusted-deserialization-rule.js +0 -95
- package/lib/protect/rules/virtual-patch/index.js +0 -17
- package/lib/protect/rules/virtual-patch/utils.js +0 -72
- package/lib/protect/rules/virtual-patch/virtual-patch-rule.js +0 -162
- package/lib/protect/rules/xss/helpers/function-call.js +0 -82
- package/lib/protect/rules/xss/reflected-xss-rule.js +0 -103
- package/lib/protect/rules/xxe/xxerule.js +0 -184
- package/lib/protect/sample-aggregator.js +0 -144
- package/lib/protect/samples.js +0 -167
- package/lib/protect/service.js +0 -1203
- package/lib/protect/sinks/child-process.js +0 -65
- package/lib/protect/sinks/eval.js +0 -57
- package/lib/protect/sinks/fs.js +0 -97
- package/lib/protect/sinks/function.js +0 -64
- package/lib/protect/sinks/index.js +0 -54
- package/lib/protect/sinks/libxmljs.js +0 -107
- package/lib/protect/sinks/mongodb.js +0 -158
- package/lib/protect/sinks/mysql.js +0 -63
- package/lib/protect/sinks/node-serialize.js +0 -53
- package/lib/protect/sinks/postgres.js +0 -81
- package/lib/protect/sinks/rethinkdb.js +0 -47
- package/lib/protect/sinks/sequelize.js +0 -86
- package/lib/protect/sinks/sqlite3.js +0 -50
- package/lib/protect/sinks/vm.js +0 -89
- package/lib/protect/sources/busboy.js +0 -58
- package/lib/protect/sources/formidable.js +0 -55
- package/lib/protect/sources/index.js +0 -27
- package/lib/protect/validators/authorization.js +0 -31
- package/lib/protect/validators/common.js +0 -74
- package/lib/protect/validators/connection.js +0 -31
- package/lib/protect/validators/content-length.js +0 -30
- package/lib/protect/validators/host.js +0 -23
- package/lib/protect/validators/if-none-match.js +0 -71
- package/lib/protect/validators/index.js +0 -24
- package/lib/protect/validators/origin.js +0 -29
- package/lib/reporter/app-activity-queue.js +0 -179
- package/lib/reporter/grpc-client.js +0 -88
- package/lib/reporter/messages/speedracer/activity.js +0 -38
- package/lib/reporter/messages/speedracer/application-create.js +0 -65
- package/lib/reporter/messages/speedracer/application-update.js +0 -41
- package/lib/reporter/messages/speedracer/base.js +0 -401
- package/lib/reporter/messages/speedracer/index.js +0 -33
- package/lib/reporter/messages/speedracer/observed-route.js +0 -41
- package/lib/reporter/messages/speedracer/poll.js +0 -43
- package/lib/reporter/messages/speedracer/request.js +0 -33
- package/lib/reporter/messages/speedracer/startup.js +0 -63
- package/lib/reporter/messaging-router.js +0 -116
- package/lib/reporter/models/app-activity/app-activity.js +0 -43
- package/lib/reporter/models/app-activity/attacker-activity.js +0 -77
- package/lib/reporter/models/app-activity/defend.js +0 -94
- package/lib/reporter/models/app-activity/inventory.js +0 -73
- package/lib/reporter/models/app-activity/protection-rule-activity.js +0 -68
- package/lib/reporter/models/app-activity/rule-events.js +0 -55
- package/lib/reporter/models/app-activity/sample.js +0 -139
- package/lib/reporter/models/app-activity/source.js +0 -79
- package/lib/reporter/models/app-activity/user-input.js +0 -87
- package/lib/reporter/models/app-create.js +0 -63
- package/lib/reporter/models/app-update/index.js +0 -178
- package/lib/reporter/models/app-update/library-manifest.js +0 -54
- package/lib/reporter/models/app-update/library-usage.js +0 -36
- package/lib/reporter/models/app-update/library.js +0 -165
- package/lib/reporter/models/event-tag.js +0 -36
- package/lib/reporter/models/finding/event.js +0 -158
- package/lib/reporter/models/finding/finding.js +0 -77
- package/lib/reporter/models/frameworks/express-request.js +0 -75
- package/lib/reporter/models/frameworks/fastify-request.js +0 -27
- package/lib/reporter/models/frameworks/hapi-request.js +0 -39
- package/lib/reporter/models/frameworks/index.js +0 -21
- package/lib/reporter/models/frameworks/koa-request.js +0 -27
- package/lib/reporter/models/frameworks/restify-request.js +0 -27
- package/lib/reporter/models/observed-route.js +0 -37
- package/lib/reporter/models/request.js +0 -288
- package/lib/reporter/models/route-coverage.js +0 -53
- package/lib/reporter/models/startup.js +0 -56
- package/lib/reporter/models/trace-event-source.js +0 -38
- package/lib/reporter/models/utils/request-factory.js +0 -32
- package/lib/reporter/models/utils/user-input-factory.js +0 -190
- package/lib/reporter/models/utils/user-input-kit.js +0 -48
- package/lib/reporter/mq-client.js +0 -59
- package/lib/reporter/server-activity-queue.js +0 -37
- package/lib/reporter/socket-client.js +0 -172
- package/lib/reporter/speedracer/base-connection-state.js +0 -49
- package/lib/reporter/speedracer/constants.js +0 -68
- package/lib/reporter/speedracer/failure-connection-state.js +0 -45
- package/lib/reporter/speedracer/index.js +0 -330
- package/lib/reporter/speedracer/success-connection-state.js +0 -67
- package/lib/reporter/speedracer/unknown-connection-state.js +0 -154
- package/lib/reporter/translations/enums.js +0 -268
- package/lib/reporter/translations/helpers.js +0 -115
- package/lib/reporter/translations/to-protobuf/dtm/activity.js +0 -149
- package/lib/reporter/translations/to-protobuf/dtm/address.js +0 -25
- package/lib/reporter/translations/to-protobuf/dtm/agent-startup.js +0 -40
- package/lib/reporter/translations/to-protobuf/dtm/application-create.js +0 -44
- package/lib/reporter/translations/to-protobuf/dtm/application-update.js +0 -61
- package/lib/reporter/translations/to-protobuf/dtm/architecture-component.js +0 -33
- package/lib/reporter/translations/to-protobuf/dtm/attack-result.js +0 -38
- package/lib/reporter/translations/to-protobuf/dtm/bot-blocker-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/cmd-injection-details.js +0 -22
- package/lib/reporter/translations/to-protobuf/dtm/cmd-injection-semantic-analysis-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/finding.js +0 -47
- package/lib/reporter/translations/to-protobuf/dtm/http-method-tampering-details.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/http-request.js +0 -50
- package/lib/reporter/translations/to-protobuf/dtm/index.js +0 -48
- package/lib/reporter/translations/to-protobuf/dtm/ip-denylist-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/library-usage-update.js +0 -32
- package/lib/reporter/translations/to-protobuf/dtm/no-sql-injection-details.js +0 -26
- package/lib/reporter/translations/to-protobuf/dtm/observed-route.js +0 -73
- package/lib/reporter/translations/to-protobuf/dtm/pair.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/path-traversal-details.js +0 -22
- package/lib/reporter/translations/to-protobuf/dtm/poll.js +0 -19
- package/lib/reporter/translations/to-protobuf/dtm/rasp-rule-sample.js +0 -134
- package/lib/reporter/translations/to-protobuf/dtm/raw-request.js +0 -105
- package/lib/reporter/translations/to-protobuf/dtm/route-coverage.js +0 -68
- package/lib/reporter/translations/to-protobuf/dtm/simple-pair.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/sql-injection-details.js +0 -26
- package/lib/reporter/translations/to-protobuf/dtm/ssjs-injection-details.js +0 -25
- package/lib/reporter/translations/to-protobuf/dtm/stack-trace-element.js +0 -30
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/action.js +0 -21
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/index.js +0 -56
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/parent-object-id.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-object.js +0 -28
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-signature.js +0 -37
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-event-source.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-stack.js +0 -27
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/trace-taint-range.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/trace-event/type.js +0 -21
- package/lib/reporter/translations/to-protobuf/dtm/untrusted-deserialization-details.js +0 -24
- package/lib/reporter/translations/to-protobuf/dtm/user-input.js +0 -37
- package/lib/reporter/translations/to-protobuf/dtm/virtual-patch-details.js +0 -23
- package/lib/reporter/translations/to-protobuf/dtm/xss-details.js +0 -34
- package/lib/reporter/translations/to-protobuf/dtm/xxe-details.js +0 -45
- package/lib/reporter/translations/to-protobuf/index.js +0 -18
- package/lib/reporter/translations/to-protobuf/settings/application-settings.js +0 -76
- package/lib/reporter/translations/to-protobuf/settings/assess-features.js +0 -66
- package/lib/reporter/translations/to-protobuf/settings/auth.js +0 -25
- package/lib/reporter/translations/to-protobuf/settings/bot-blocker.js +0 -27
- package/lib/reporter/translations/to-protobuf/settings/custom-rule-feature.js +0 -27
- package/lib/reporter/translations/to-protobuf/settings/defend-features.js +0 -74
- package/lib/reporter/translations/to-protobuf/settings/exclusions.js +0 -98
- package/lib/reporter/translations/to-protobuf/settings/index.js +0 -37
- package/lib/reporter/translations/to-protobuf/settings/input-analysis-result.js +0 -22
- package/lib/reporter/translations/to-protobuf/settings/inventory-features.js +0 -35
- package/lib/reporter/translations/to-protobuf/settings/ip-filter.js +0 -29
- package/lib/reporter/translations/to-protobuf/settings/log-enhancer.js +0 -23
- package/lib/reporter/translations/to-protobuf/settings/protection-rule.js +0 -45
- package/lib/reporter/translations/to-protobuf/settings/reaction.js +0 -29
- package/lib/reporter/translations/to-protobuf/settings/rule-definition.js +0 -59
- package/lib/reporter/translations/to-protobuf/settings/sampling.js +0 -35
- package/lib/reporter/translations/to-protobuf/settings/server-features.js +0 -73
- package/lib/reporter/translations/to-protobuf/settings/syslog.js +0 -62
- package/lib/reporter/translations/to-protobuf/settings/virtual-patch.js +0 -77
- package/lib/reporter/ts-reporter.js +0 -448
- package/lib/telemetry.js +0 -194
- package/lib/tracker.js +0 -156
- package/lib/util/base64.js +0 -23
- package/lib/util/bitset.js +0 -85
- package/lib/util/block-request.js +0 -34
- package/lib/util/callback-resolver.js +0 -37
- package/lib/util/clean-stack.js +0 -308
- package/lib/util/clean-string/brackets.js +0 -86
- package/lib/util/clean-string/clean-string-base.js +0 -60
- package/lib/util/clean-string/comments.js +0 -107
- package/lib/util/clean-string/concatenations.js +0 -183
- package/lib/util/clean-string/jsclean-string.js +0 -96
- package/lib/util/clean-string/placeholders.js +0 -107
- package/lib/util/clean-string/util.js +0 -69
- package/lib/util/colors.js +0 -28
- package/lib/util/config-diagnostics-utils.js +0 -229
- package/lib/util/file-finder.js +0 -160
- package/lib/util/get-file-type.js +0 -43
- package/lib/util/heap-dump.js +0 -72
- package/lib/util/html-util.js +0 -83
- package/lib/util/ip-analyzer.js +0 -246
- package/lib/util/is-agent-path.js +0 -25
- package/lib/util/is-contrast-error.js +0 -15
- package/lib/util/is-piped-to-dev.js +0 -16
- package/lib/util/is-string.js +0 -24
- package/lib/util/partial.js +0 -29
- package/lib/util/pkg-name.js +0 -23
- package/lib/util/request-util.js +0 -74
- package/lib/util/resolve-obj.js +0 -39
- package/lib/util/route-info.js +0 -50
- package/lib/util/some.js +0 -27
- package/lib/util/source-map.js +0 -171
- package/lib/util/static-rules.js +0 -33
- package/lib/util/trace-util.js +0 -74
- package/lib/util/traverse.js +0 -188
- package/lib/util/user-input-evaluator.js +0 -64
- package/lib/util/xml-analyzer/external-entity-finder.js +0 -183
- package/node_modules/@colors/colors/LICENSE +0 -26
- package/node_modules/@colors/colors/README.md +0 -219
- package/node_modules/@colors/colors/examples/normal-usage.js +0 -83
- package/node_modules/@colors/colors/examples/safe-string.js +0 -80
- package/node_modules/@colors/colors/index.d.ts +0 -136
- package/node_modules/@colors/colors/lib/colors.js +0 -211
- package/node_modules/@colors/colors/lib/custom/trap.js +0 -46
- package/node_modules/@colors/colors/lib/custom/zalgo.js +0 -110
- package/node_modules/@colors/colors/lib/extendStringPrototype.js +0 -110
- package/node_modules/@colors/colors/lib/index.js +0 -13
- package/node_modules/@colors/colors/lib/maps/america.js +0 -10
- package/node_modules/@colors/colors/lib/maps/rainbow.js +0 -12
- package/node_modules/@colors/colors/lib/maps/random.js +0 -11
- package/node_modules/@colors/colors/lib/maps/zebra.js +0 -5
- package/node_modules/@colors/colors/lib/styles.js +0 -95
- package/node_modules/@colors/colors/lib/system/has-flag.js +0 -35
- package/node_modules/@colors/colors/lib/system/supports-colors.js +0 -151
- package/node_modules/@colors/colors/package.json +0 -49
- package/node_modules/@colors/colors/safe.d.ts +0 -48
- package/node_modules/@colors/colors/safe.js +0 -10
- package/node_modules/@colors/colors/themes/generic-logging.js +0 -12
- package/node_modules/@dabh/diagnostics/CHANGELOG.md +0 -26
- package/node_modules/@dabh/diagnostics/LICENSE +0 -20
- package/node_modules/@dabh/diagnostics/README.md +0 -473
- package/node_modules/@dabh/diagnostics/adapters/hash.js +0 -11
- package/node_modules/@dabh/diagnostics/adapters/index.js +0 -18
- package/node_modules/@dabh/diagnostics/adapters/localstorage.js +0 -11
- package/node_modules/@dabh/diagnostics/adapters/process.env.js +0 -11
- package/node_modules/@dabh/diagnostics/browser/development.js +0 -35
- package/node_modules/@dabh/diagnostics/browser/index.js +0 -8
- package/node_modules/@dabh/diagnostics/browser/override.js +0 -6
- package/node_modules/@dabh/diagnostics/browser/production.js +0 -24
- package/node_modules/@dabh/diagnostics/diagnostics.js +0 -212
- package/node_modules/@dabh/diagnostics/logger/console.js +0 -19
- package/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js +0 -20
- package/node_modules/@dabh/diagnostics/modifiers/namespace.js +0 -32
- package/node_modules/@dabh/diagnostics/node/development.js +0 -36
- package/node_modules/@dabh/diagnostics/node/index.js +0 -8
- package/node_modules/@dabh/diagnostics/node/override.js +0 -21
- package/node_modules/@dabh/diagnostics/node/production.js +0 -24
- package/node_modules/@dabh/diagnostics/package.json +0 -68
- package/node_modules/async/CHANGELOG.md +0 -344
- package/node_modules/async/LICENSE +0 -19
- package/node_modules/async/README.md +0 -60
- package/node_modules/async/all.js +0 -119
- package/node_modules/async/allLimit.js +0 -46
- package/node_modules/async/allSeries.js +0 -45
- package/node_modules/async/any.js +0 -122
- package/node_modules/async/anyLimit.js +0 -47
- package/node_modules/async/anySeries.js +0 -46
- package/node_modules/async/apply.js +0 -55
- package/node_modules/async/applyEach.js +0 -57
- package/node_modules/async/applyEachSeries.js +0 -37
- package/node_modules/async/asyncify.js +0 -118
- package/node_modules/async/auto.js +0 -333
- package/node_modules/async/autoInject.js +0 -182
- package/node_modules/async/bower.json +0 -17
- package/node_modules/async/cargo.js +0 -63
- package/node_modules/async/cargoQueue.js +0 -71
- package/node_modules/async/compose.js +0 -55
- package/node_modules/async/concat.js +0 -115
- package/node_modules/async/concatLimit.js +0 -60
- package/node_modules/async/concatSeries.js +0 -41
- package/node_modules/async/constant.js +0 -55
- package/node_modules/async/detect.js +0 -96
- package/node_modules/async/detectLimit.js +0 -48
- package/node_modules/async/detectSeries.js +0 -47
- package/node_modules/async/dir.js +0 -43
- package/node_modules/async/dist/async.js +0 -6057
- package/node_modules/async/dist/async.min.js +0 -1
- package/node_modules/async/dist/async.mjs +0 -5945
- package/node_modules/async/doDuring.js +0 -68
- package/node_modules/async/doUntil.js +0 -46
- package/node_modules/async/doWhilst.js +0 -68
- package/node_modules/async/during.js +0 -78
- package/node_modules/async/each.js +0 -129
- package/node_modules/async/eachLimit.js +0 -50
- package/node_modules/async/eachOf.js +0 -185
- package/node_modules/async/eachOfLimit.js +0 -47
- package/node_modules/async/eachOfSeries.js +0 -39
- package/node_modules/async/eachSeries.js +0 -44
- package/node_modules/async/ensureAsync.js +0 -67
- package/node_modules/async/every.js +0 -119
- package/node_modules/async/everyLimit.js +0 -46
- package/node_modules/async/everySeries.js +0 -45
- package/node_modules/async/filter.js +0 -93
- package/node_modules/async/filterLimit.js +0 -45
- package/node_modules/async/filterSeries.js +0 -43
- package/node_modules/async/find.js +0 -96
- package/node_modules/async/findLimit.js +0 -48
- package/node_modules/async/findSeries.js +0 -47
- package/node_modules/async/flatMap.js +0 -115
- package/node_modules/async/flatMapLimit.js +0 -60
- package/node_modules/async/flatMapSeries.js +0 -41
- package/node_modules/async/foldl.js +0 -153
- package/node_modules/async/foldr.js +0 -41
- package/node_modules/async/forEach.js +0 -129
- package/node_modules/async/forEachLimit.js +0 -50
- package/node_modules/async/forEachOf.js +0 -185
- package/node_modules/async/forEachOfLimit.js +0 -47
- package/node_modules/async/forEachOfSeries.js +0 -39
- package/node_modules/async/forEachSeries.js +0 -44
- package/node_modules/async/forever.js +0 -68
- package/node_modules/async/groupBy.js +0 -108
- package/node_modules/async/groupByLimit.js +0 -71
- package/node_modules/async/groupBySeries.js +0 -36
- package/node_modules/async/index.js +0 -588
- package/node_modules/async/inject.js +0 -153
- package/node_modules/async/internal/DoublyLinkedList.js +0 -92
- package/node_modules/async/internal/Heap.js +0 -120
- package/node_modules/async/internal/applyEach.js +0 -29
- package/node_modules/async/internal/asyncEachOfLimit.js +0 -75
- package/node_modules/async/internal/awaitify.js +0 -27
- package/node_modules/async/internal/breakLoop.js +0 -10
- package/node_modules/async/internal/consoleFunc.js +0 -31
- package/node_modules/async/internal/createTester.js +0 -40
- package/node_modules/async/internal/eachOfLimit.js +0 -90
- package/node_modules/async/internal/filter.js +0 -55
- package/node_modules/async/internal/getIterator.js +0 -11
- package/node_modules/async/internal/initialParams.js +0 -14
- package/node_modules/async/internal/isArrayLike.js +0 -10
- package/node_modules/async/internal/iterator.js +0 -57
- package/node_modules/async/internal/map.js +0 -30
- package/node_modules/async/internal/once.js +0 -17
- package/node_modules/async/internal/onlyOnce.js +0 -15
- package/node_modules/async/internal/parallel.js +0 -34
- package/node_modules/async/internal/promiseCallback.js +0 -23
- package/node_modules/async/internal/queue.js +0 -291
- package/node_modules/async/internal/range.js +0 -14
- package/node_modules/async/internal/reject.js +0 -26
- package/node_modules/async/internal/setImmediate.js +0 -34
- package/node_modules/async/internal/withoutIndex.js +0 -10
- package/node_modules/async/internal/wrapAsync.js +0 -34
- package/node_modules/async/log.js +0 -41
- package/node_modules/async/map.js +0 -142
- package/node_modules/async/mapLimit.js +0 -45
- package/node_modules/async/mapSeries.js +0 -44
- package/node_modules/async/mapValues.js +0 -152
- package/node_modules/async/mapValuesLimit.js +0 -61
- package/node_modules/async/mapValuesSeries.js +0 -37
- package/node_modules/async/memoize.js +0 -91
- package/node_modules/async/nextTick.js +0 -52
- package/node_modules/async/package.json +0 -84
- package/node_modules/async/parallel.js +0 -180
- package/node_modules/async/parallelLimit.js +0 -41
- package/node_modules/async/priorityQueue.js +0 -91
- package/node_modules/async/queue.js +0 -167
- package/node_modules/async/race.js +0 -67
- package/node_modules/async/reduce.js +0 -153
- package/node_modules/async/reduceRight.js +0 -41
- package/node_modules/async/reflect.js +0 -78
- package/node_modules/async/reflectAll.js +0 -93
- package/node_modules/async/reject.js +0 -87
- package/node_modules/async/rejectLimit.js +0 -45
- package/node_modules/async/rejectSeries.js +0 -43
- package/node_modules/async/retry.js +0 -159
- package/node_modules/async/retryable.js +0 -77
- package/node_modules/async/select.js +0 -93
- package/node_modules/async/selectLimit.js +0 -45
- package/node_modules/async/selectSeries.js +0 -43
- package/node_modules/async/seq.js +0 -79
- package/node_modules/async/series.js +0 -186
- package/node_modules/async/setImmediate.js +0 -45
- package/node_modules/async/some.js +0 -122
- package/node_modules/async/someLimit.js +0 -47
- package/node_modules/async/someSeries.js +0 -46
- package/node_modules/async/sortBy.js +0 -190
- package/node_modules/async/timeout.js +0 -89
- package/node_modules/async/times.js +0 -50
- package/node_modules/async/timesLimit.js +0 -43
- package/node_modules/async/timesSeries.js +0 -32
- package/node_modules/async/transform.js +0 -173
- package/node_modules/async/tryEach.js +0 -78
- package/node_modules/async/unmemoize.js +0 -25
- package/node_modules/async/until.js +0 -61
- package/node_modules/async/waterfall.js +0 -105
- package/node_modules/async/whilst.js +0 -78
- package/node_modules/async/wrapSync.js +0 -118
- package/node_modules/color/LICENSE +0 -21
- package/node_modules/color/README.md +0 -123
- package/node_modules/color/index.js +0 -482
- package/node_modules/color/package.json +0 -44
- package/node_modules/color-convert/CHANGELOG.md +0 -54
- package/node_modules/color-convert/LICENSE +0 -21
- package/node_modules/color-convert/README.md +0 -68
- package/node_modules/color-convert/conversions.js +0 -868
- package/node_modules/color-convert/index.js +0 -78
- package/node_modules/color-convert/package.json +0 -50
- package/node_modules/color-convert/route.js +0 -97
- package/node_modules/color-name/.eslintrc.json +0 -43
- package/node_modules/color-name/.npmignore +0 -107
- package/node_modules/color-name/LICENSE +0 -8
- package/node_modules/color-name/README.md +0 -11
- package/node_modules/color-name/index.js +0 -152
- package/node_modules/color-name/package.json +0 -29
- package/node_modules/color-name/test.js +0 -7
- package/node_modules/color-string/LICENSE +0 -21
- package/node_modules/color-string/README.md +0 -62
- package/node_modules/color-string/index.js +0 -242
- package/node_modules/color-string/package.json +0 -43
- package/node_modules/colors/LICENSE +0 -25
- package/node_modules/colors/README.md +0 -221
- package/node_modules/colors/examples/normal-usage.js +0 -82
- package/node_modules/colors/examples/safe-string.js +0 -79
- package/node_modules/colors/index.d.ts +0 -136
- package/node_modules/colors/lib/colors.js +0 -211
- package/node_modules/colors/lib/custom/trap.js +0 -46
- package/node_modules/colors/lib/custom/zalgo.js +0 -110
- package/node_modules/colors/lib/extendStringPrototype.js +0 -110
- package/node_modules/colors/lib/index.js +0 -13
- package/node_modules/colors/lib/maps/america.js +0 -10
- package/node_modules/colors/lib/maps/rainbow.js +0 -12
- package/node_modules/colors/lib/maps/random.js +0 -11
- package/node_modules/colors/lib/maps/zebra.js +0 -5
- package/node_modules/colors/lib/styles.js +0 -95
- package/node_modules/colors/lib/system/has-flag.js +0 -35
- package/node_modules/colors/lib/system/supports-colors.js +0 -151
- package/node_modules/colors/package.json +0 -49
- package/node_modules/colors/safe.d.ts +0 -48
- package/node_modules/colors/safe.js +0 -10
- package/node_modules/colors/themes/generic-logging.js +0 -12
- package/node_modules/colorspace/LICENSE.md +0 -20
- package/node_modules/colorspace/README.md +0 -43
- package/node_modules/colorspace/index.js +0 -29
- package/node_modules/colorspace/package.json +0 -41
- package/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/core-util-is/README.md +0 -3
- package/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/core-util-is/package.json +0 -36
- package/node_modules/core-util-is/test.js +0 -68
- package/node_modules/cycle/README.md +0 -49
- package/node_modules/cycle/cycle.js +0 -170
- package/node_modules/cycle/package.json +0 -16
- package/node_modules/enabled/.travis.yml +0 -9
- package/node_modules/enabled/LICENSE +0 -20
- package/node_modules/enabled/README.md +0 -68
- package/node_modules/enabled/index.js +0 -34
- package/node_modules/enabled/package.json +0 -37
- package/node_modules/enabled/test.js +0 -39
- package/node_modules/fast-safe-stringify/.travis.yml +0 -8
- package/node_modules/fast-safe-stringify/CHANGELOG.md +0 -17
- package/node_modules/fast-safe-stringify/LICENSE +0 -23
- package/node_modules/fast-safe-stringify/benchmark.js +0 -137
- package/node_modules/fast-safe-stringify/index.d.ts +0 -8
- package/node_modules/fast-safe-stringify/index.js +0 -161
- package/node_modules/fast-safe-stringify/package.json +0 -50
- package/node_modules/fast-safe-stringify/readme.md +0 -154
- package/node_modules/fast-safe-stringify/test-stable.js +0 -311
- package/node_modules/fast-safe-stringify/test.js +0 -304
- package/node_modules/fecha/LICENSE +0 -22
- package/node_modules/fecha/README.md +0 -320
- package/node_modules/fecha/dist/fecha.min.js +0 -2
- package/node_modules/fecha/dist/fecha.min.js.map +0 -1
- package/node_modules/fecha/lib/fecha.d.ts +0 -52
- package/node_modules/fecha/lib/fecha.js +0 -403
- package/node_modules/fecha/lib/fecha.js.map +0 -1
- package/node_modules/fecha/lib/fecha.umd.js +0 -418
- package/node_modules/fecha/lib/fecha.umd.js.map +0 -1
- package/node_modules/fecha/package.json +0 -59
- package/node_modules/fecha/src/fecha.ts +0 -524
- package/node_modules/file-stream-rotator/.nvmrc +0 -1
- package/node_modules/file-stream-rotator/.travis.yml +0 -5
- package/node_modules/file-stream-rotator/FileStreamRotator.js +0 -543
- package/node_modules/file-stream-rotator/README.md +0 -133
- package/node_modules/file-stream-rotator/index.js +0 -1
- package/node_modules/file-stream-rotator/package.json +0 -34
- package/node_modules/file-stream-rotator/test.js +0 -208
- package/node_modules/file-stream-rotator/tests/every-minute-test.js +0 -68
- package/node_modules/file-stream-rotator/tests/every-second-test.js +0 -66
- package/node_modules/fn.name/.gitattributes +0 -1
- package/node_modules/fn.name/.travis.yml +0 -10
- package/node_modules/fn.name/LICENSE +0 -22
- package/node_modules/fn.name/README.md +0 -42
- package/node_modules/fn.name/index.js +0 -42
- package/node_modules/fn.name/package.json +0 -41
- package/node_modules/fn.name/test.js +0 -73
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -33
- package/node_modules/is-arrayish/LICENSE +0 -21
- package/node_modules/is-arrayish/README.md +0 -16
- package/node_modules/is-arrayish/index.js +0 -9
- package/node_modules/is-arrayish/package.json +0 -49
- package/node_modules/is-arrayish/yarn-error.log +0 -1443
- package/node_modules/is-stream/index.d.ts +0 -80
- package/node_modules/is-stream/index.js +0 -29
- package/node_modules/is-stream/license +0 -9
- package/node_modules/is-stream/package.json +0 -45
- package/node_modules/is-stream/readme.md +0 -57
- package/node_modules/isarray/.npmignore +0 -1
- package/node_modules/isarray/.travis.yml +0 -4
- package/node_modules/isarray/Makefile +0 -6
- package/node_modules/isarray/README.md +0 -60
- package/node_modules/isarray/component.json +0 -19
- package/node_modules/isarray/index.js +0 -5
- package/node_modules/isarray/package.json +0 -49
- package/node_modules/isarray/test.js +0 -20
- package/node_modules/kuler/.travis.yml +0 -5
- package/node_modules/kuler/LICENSE +0 -7
- package/node_modules/kuler/README.md +0 -40
- package/node_modules/kuler/index.js +0 -118
- package/node_modules/kuler/package.json +0 -38
- package/node_modules/kuler/test.js +0 -23
- package/node_modules/logform/.babelrc +0 -3
- package/node_modules/logform/.eslintrc +0 -7
- package/node_modules/logform/.gitattributes +0 -1
- package/node_modules/logform/CHANGELOG.md +0 -256
- package/node_modules/logform/LICENSE +0 -21
- package/node_modules/logform/README.md +0 -653
- package/node_modules/logform/align.js +0 -14
- package/node_modules/logform/browser.js +0 -38
- package/node_modules/logform/cli.js +0 -52
- package/node_modules/logform/colorize.js +0 -122
- package/node_modules/logform/combine.js +0 -66
- package/node_modules/logform/dist/align.js +0 -15
- package/node_modules/logform/dist/browser.js +0 -72
- package/node_modules/logform/dist/cli.js +0 -73
- package/node_modules/logform/dist/colorize.js +0 -144
- package/node_modules/logform/dist/combine.js +0 -71
- package/node_modules/logform/dist/errors.js +0 -43
- package/node_modules/logform/dist/format.js +0 -91
- package/node_modules/logform/dist/index.js +0 -87
- package/node_modules/logform/dist/json.js +0 -34
- package/node_modules/logform/dist/label.js +0 -20
- package/node_modules/logform/dist/levels.js +0 -14
- package/node_modules/logform/dist/logstash.js +0 -34
- package/node_modules/logform/dist/metadata.js +0 -64
- package/node_modules/logform/dist/ms.js +0 -21
- package/node_modules/logform/dist/pad-levels.js +0 -127
- package/node_modules/logform/dist/pretty-print.js +0 -34
- package/node_modules/logform/dist/printf.js +0 -41
- package/node_modules/logform/dist/simple.js +0 -37
- package/node_modules/logform/dist/splat.js +0 -159
- package/node_modules/logform/dist/timestamp.js +0 -32
- package/node_modules/logform/dist/uncolorize.js +0 -31
- package/node_modules/logform/errors.js +0 -39
- package/node_modules/logform/examples/combine.js +0 -14
- package/node_modules/logform/examples/filter.js +0 -30
- package/node_modules/logform/examples/invalid.js +0 -6
- package/node_modules/logform/examples/metadata.js +0 -78
- package/node_modules/logform/examples/padLevels.js +0 -39
- package/node_modules/logform/examples/volume.js +0 -25
- package/node_modules/logform/format.js +0 -52
- package/node_modules/logform/index.d.ts +0 -197
- package/node_modules/logform/index.js +0 -52
- package/node_modules/logform/json.js +0 -30
- package/node_modules/logform/label.js +0 -19
- package/node_modules/logform/levels.js +0 -12
- package/node_modules/logform/logstash.js +0 -29
- package/node_modules/logform/metadata.js +0 -61
- package/node_modules/logform/ms.js +0 -18
- package/node_modules/logform/package.json +0 -53
- package/node_modules/logform/pad-levels.js +0 -83
- package/node_modules/logform/pretty-print.js +0 -29
- package/node_modules/logform/printf.js +0 -26
- package/node_modules/logform/simple.js +0 -33
- package/node_modules/logform/splat.js +0 -132
- package/node_modules/logform/timestamp.js +0 -30
- package/node_modules/logform/tsconfig.json +0 -22
- package/node_modules/logform/uncolorize.js +0 -27
- package/node_modules/moment/CHANGELOG.md +0 -988
- package/node_modules/moment/LICENSE +0 -22
- package/node_modules/moment/README.md +0 -55
- package/node_modules/moment/dist/locale/af.js +0 -71
- package/node_modules/moment/dist/locale/ar-dz.js +0 -156
- package/node_modules/moment/dist/locale/ar-kw.js +0 -55
- package/node_modules/moment/dist/locale/ar-ly.js +0 -171
- package/node_modules/moment/dist/locale/ar-ma.js +0 -56
- package/node_modules/moment/dist/locale/ar-sa.js +0 -105
- package/node_modules/moment/dist/locale/ar-tn.js +0 -55
- package/node_modules/moment/dist/locale/ar.js +0 -189
- package/node_modules/moment/dist/locale/az.js +0 -102
- package/node_modules/moment/dist/locale/be.js +0 -142
- package/node_modules/moment/dist/locale/bg.js +0 -87
- package/node_modules/moment/dist/locale/bm.js +0 -52
- package/node_modules/moment/dist/locale/bn-bd.js +0 -129
- package/node_modules/moment/dist/locale/bn.js +0 -119
- package/node_modules/moment/dist/locale/bo.js +0 -124
- package/node_modules/moment/dist/locale/br.js +0 -168
- package/node_modules/moment/dist/locale/bs.js +0 -150
- package/node_modules/moment/dist/locale/ca.js +0 -100
- package/node_modules/moment/dist/locale/cs.js +0 -180
- package/node_modules/moment/dist/locale/cv.js +0 -63
- package/node_modules/moment/dist/locale/cy.js +0 -98
- package/node_modules/moment/dist/locale/da.js +0 -53
- package/node_modules/moment/dist/locale/de-at.js +0 -79
- package/node_modules/moment/dist/locale/de-ch.js +0 -78
- package/node_modules/moment/dist/locale/de.js +0 -78
- package/node_modules/moment/dist/locale/dv.js +0 -90
- package/node_modules/moment/dist/locale/el.js +0 -106
- package/node_modules/moment/dist/locale/en-au.js +0 -68
- package/node_modules/moment/dist/locale/en-ca.js +0 -64
- package/node_modules/moment/dist/locale/en-gb.js +0 -68
- package/node_modules/moment/dist/locale/en-ie.js +0 -68
- package/node_modules/moment/dist/locale/en-il.js +0 -64
- package/node_modules/moment/dist/locale/en-in.js +0 -68
- package/node_modules/moment/dist/locale/en-nz.js +0 -68
- package/node_modules/moment/dist/locale/en-sg.js +0 -68
- package/node_modules/moment/dist/locale/eo.js +0 -68
- package/node_modules/moment/dist/locale/es-do.js +0 -108
- package/node_modules/moment/dist/locale/es-mx.js +0 -110
- package/node_modules/moment/dist/locale/es-us.js +0 -110
- package/node_modules/moment/dist/locale/es.js +0 -110
- package/node_modules/moment/dist/locale/et.js +0 -78
- package/node_modules/moment/dist/locale/eu.js +0 -65
- package/node_modules/moment/dist/locale/fa.js +0 -113
- package/node_modules/moment/dist/locale/fi.js +0 -124
- package/node_modules/moment/dist/locale/fil.js +0 -58
- package/node_modules/moment/dist/locale/fo.js +0 -57
- package/node_modules/moment/dist/locale/fr-ca.js +0 -70
- package/node_modules/moment/dist/locale/fr-ch.js +0 -74
- package/node_modules/moment/dist/locale/fr.js +0 -108
- package/node_modules/moment/dist/locale/fy.js +0 -75
- package/node_modules/moment/dist/locale/ga.js +0 -95
- package/node_modules/moment/dist/locale/gd.js +0 -95
- package/node_modules/moment/dist/locale/gl.js +0 -75
- package/node_modules/moment/dist/locale/gom-deva.js +0 -126
- package/node_modules/moment/dist/locale/gom-latn.js +0 -124
- package/node_modules/moment/dist/locale/gu.js +0 -122
- package/node_modules/moment/dist/locale/he.js +0 -94
- package/node_modules/moment/dist/locale/hi.js +0 -168
- package/node_modules/moment/dist/locale/hr.js +0 -156
- package/node_modules/moment/dist/locale/hu.js +0 -118
- package/node_modules/moment/dist/locale/hy-am.js +0 -94
- package/node_modules/moment/dist/locale/id.js +0 -76
- package/node_modules/moment/dist/locale/is.js +0 -140
- package/node_modules/moment/dist/locale/it-ch.js +0 -64
- package/node_modules/moment/dist/locale/it.js +0 -106
- package/node_modules/moment/dist/locale/ja.js +0 -148
- package/node_modules/moment/dist/locale/jv.js +0 -76
- package/node_modules/moment/dist/locale/ka.js +0 -92
- package/node_modules/moment/dist/locale/kk.js +0 -82
- package/node_modules/moment/dist/locale/km.js +0 -103
- package/node_modules/moment/dist/locale/kn.js +0 -124
- package/node_modules/moment/dist/locale/ko.js +0 -75
- package/node_modules/moment/dist/locale/ku.js +0 -118
- package/node_modules/moment/dist/locale/ky.js +0 -84
- package/node_modules/moment/dist/locale/lb.js +0 -137
- package/node_modules/moment/dist/locale/lo.js +0 -66
- package/node_modules/moment/dist/locale/lt.js +0 -125
- package/node_modules/moment/dist/locale/lv.js +0 -94
- package/node_modules/moment/dist/locale/me.js +0 -117
- package/node_modules/moment/dist/locale/mi.js +0 -60
- package/node_modules/moment/dist/locale/mk.js +0 -85
- package/node_modules/moment/dist/locale/ml.js +0 -82
- package/node_modules/moment/dist/locale/mn.js +0 -100
- package/node_modules/moment/dist/locale/mr.js +0 -203
- package/node_modules/moment/dist/locale/ms-my.js +0 -76
- package/node_modules/moment/dist/locale/ms.js +0 -75
- package/node_modules/moment/dist/locale/mt.js +0 -56
- package/node_modules/moment/dist/locale/my.js +0 -91
- package/node_modules/moment/dist/locale/nb.js +0 -60
- package/node_modules/moment/dist/locale/ne.js +0 -121
- package/node_modules/moment/dist/locale/nl-be.js +0 -102
- package/node_modules/moment/dist/locale/nl.js +0 -104
- package/node_modules/moment/dist/locale/nn.js +0 -59
- package/node_modules/moment/dist/locale/oc-lnc.js +0 -85
- package/node_modules/moment/dist/locale/pa-in.js +0 -122
- package/node_modules/moment/dist/locale/pl.js +0 -140
- package/node_modules/moment/dist/locale/pt-br.js +0 -58
- package/node_modules/moment/dist/locale/pt.js +0 -63
- package/node_modules/moment/dist/locale/ro.js +0 -76
- package/node_modules/moment/dist/locale/ru.js +0 -213
- package/node_modules/moment/dist/locale/sd.js +0 -81
- package/node_modules/moment/dist/locale/se.js +0 -57
- package/node_modules/moment/dist/locale/si.js +0 -69
- package/node_modules/moment/dist/locale/sk.js +0 -145
- package/node_modules/moment/dist/locale/sl.js +0 -171
- package/node_modules/moment/dist/locale/sq.js +0 -65
- package/node_modules/moment/dist/locale/sr-cyrl.js +0 -127
- package/node_modules/moment/dist/locale/sr.js +0 -129
- package/node_modules/moment/dist/locale/ss.js +0 -84
- package/node_modules/moment/dist/locale/sv.js +0 -68
- package/node_modules/moment/dist/locale/sw.js +0 -55
- package/node_modules/moment/dist/locale/ta.js +0 -131
- package/node_modules/moment/dist/locale/te.js +0 -88
- package/node_modules/moment/dist/locale/tet.js +0 -68
- package/node_modules/moment/dist/locale/tg.js +0 -117
- package/node_modules/moment/dist/locale/th.js +0 -65
- package/node_modules/moment/dist/locale/tk.js +0 -91
- package/node_modules/moment/dist/locale/tl-ph.js +0 -57
- package/node_modules/moment/dist/locale/tlh.js +0 -124
- package/node_modules/moment/dist/locale/tr.js +0 -106
- package/node_modules/moment/dist/locale/tzl.js +0 -89
- package/node_modules/moment/dist/locale/tzm-latn.js +0 -54
- package/node_modules/moment/dist/locale/tzm.js +0 -54
- package/node_modules/moment/dist/locale/ug-cn.js +0 -111
- package/node_modules/moment/dist/locale/uk.js +0 -167
- package/node_modules/moment/dist/locale/ur.js +0 -82
- package/node_modules/moment/dist/locale/uz-latn.js +0 -54
- package/node_modules/moment/dist/locale/uz.js +0 -51
- package/node_modules/moment/dist/locale/vi.js +0 -80
- package/node_modules/moment/dist/locale/x-pseudo.js +0 -73
- package/node_modules/moment/dist/locale/yo.js +0 -53
- package/node_modules/moment/dist/locale/zh-cn.js +0 -120
- package/node_modules/moment/dist/locale/zh-hk.js +0 -101
- package/node_modules/moment/dist/locale/zh-mo.js +0 -100
- package/node_modules/moment/dist/locale/zh-tw.js +0 -99
- package/node_modules/moment/dist/moment.js +0 -5677
- package/node_modules/moment/ender.js +0 -1
- package/node_modules/moment/locale/af.js +0 -82
- package/node_modules/moment/locale/ar-dz.js +0 -167
- package/node_modules/moment/locale/ar-kw.js +0 -66
- package/node_modules/moment/locale/ar-ly.js +0 -182
- package/node_modules/moment/locale/ar-ma.js +0 -67
- package/node_modules/moment/locale/ar-sa.js +0 -116
- package/node_modules/moment/locale/ar-tn.js +0 -66
- package/node_modules/moment/locale/ar.js +0 -200
- package/node_modules/moment/locale/az.js +0 -113
- package/node_modules/moment/locale/be.js +0 -153
- package/node_modules/moment/locale/bg.js +0 -98
- package/node_modules/moment/locale/bm.js +0 -62
- package/node_modules/moment/locale/bn-bd.js +0 -140
- package/node_modules/moment/locale/bn.js +0 -130
- package/node_modules/moment/locale/bo.js +0 -135
- package/node_modules/moment/locale/br.js +0 -179
- package/node_modules/moment/locale/bs.js +0 -161
- package/node_modules/moment/locale/ca.js +0 -111
- package/node_modules/moment/locale/cs.js +0 -191
- package/node_modules/moment/locale/cv.js +0 -74
- package/node_modules/moment/locale/cy.js +0 -109
- package/node_modules/moment/locale/da.js +0 -64
- package/node_modules/moment/locale/de-at.js +0 -90
- package/node_modules/moment/locale/de-ch.js +0 -87
- package/node_modules/moment/locale/de.js +0 -89
- package/node_modules/moment/locale/dv.js +0 -101
- package/node_modules/moment/locale/el.js +0 -117
- package/node_modules/moment/locale/en-au.js +0 -79
- package/node_modules/moment/locale/en-ca.js +0 -75
- package/node_modules/moment/locale/en-gb.js +0 -79
- package/node_modules/moment/locale/en-ie.js +0 -79
- package/node_modules/moment/locale/en-il.js +0 -75
- package/node_modules/moment/locale/en-in.js +0 -79
- package/node_modules/moment/locale/en-nz.js +0 -79
- package/node_modules/moment/locale/en-sg.js +0 -79
- package/node_modules/moment/locale/eo.js +0 -79
- package/node_modules/moment/locale/es-do.js +0 -119
- package/node_modules/moment/locale/es-mx.js +0 -121
- package/node_modules/moment/locale/es-us.js +0 -121
- package/node_modules/moment/locale/es.js +0 -121
- package/node_modules/moment/locale/et.js +0 -89
- package/node_modules/moment/locale/eu.js +0 -76
- package/node_modules/moment/locale/fa.js +0 -124
- package/node_modules/moment/locale/fi.js +0 -135
- package/node_modules/moment/locale/fil.js +0 -69
- package/node_modules/moment/locale/fo.js +0 -68
- package/node_modules/moment/locale/fr-ca.js +0 -81
- package/node_modules/moment/locale/fr-ch.js +0 -85
- package/node_modules/moment/locale/fr.js +0 -119
- package/node_modules/moment/locale/fy.js +0 -86
- package/node_modules/moment/locale/ga.js +0 -106
- package/node_modules/moment/locale/gd.js +0 -106
- package/node_modules/moment/locale/gl.js +0 -86
- package/node_modules/moment/locale/gom-deva.js +0 -137
- package/node_modules/moment/locale/gom-latn.js +0 -135
- package/node_modules/moment/locale/gu.js +0 -133
- package/node_modules/moment/locale/he.js +0 -105
- package/node_modules/moment/locale/hi.js +0 -179
- package/node_modules/moment/locale/hr.js +0 -167
- package/node_modules/moment/locale/hu.js +0 -129
- package/node_modules/moment/locale/hy-am.js +0 -105
- package/node_modules/moment/locale/id.js +0 -87
- package/node_modules/moment/locale/is.js +0 -151
- package/node_modules/moment/locale/it-ch.js +0 -75
- package/node_modules/moment/locale/it.js +0 -117
- package/node_modules/moment/locale/ja.js +0 -159
- package/node_modules/moment/locale/jv.js +0 -87
- package/node_modules/moment/locale/ka.js +0 -103
- package/node_modules/moment/locale/kk.js +0 -93
- package/node_modules/moment/locale/km.js +0 -114
- package/node_modules/moment/locale/kn.js +0 -135
- package/node_modules/moment/locale/ko.js +0 -86
- package/node_modules/moment/locale/ku.js +0 -129
- package/node_modules/moment/locale/ky.js +0 -95
- package/node_modules/moment/locale/lb.js +0 -148
- package/node_modules/moment/locale/lo.js +0 -77
- package/node_modules/moment/locale/lt.js +0 -136
- package/node_modules/moment/locale/lv.js +0 -105
- package/node_modules/moment/locale/me.js +0 -128
- package/node_modules/moment/locale/mi.js +0 -71
- package/node_modules/moment/locale/mk.js +0 -97
- package/node_modules/moment/locale/ml.js +0 -93
- package/node_modules/moment/locale/mn.js +0 -111
- package/node_modules/moment/locale/mr.js +0 -214
- package/node_modules/moment/locale/ms-my.js +0 -87
- package/node_modules/moment/locale/ms.js +0 -86
- package/node_modules/moment/locale/mt.js +0 -67
- package/node_modules/moment/locale/my.js +0 -102
- package/node_modules/moment/locale/nb.js +0 -71
- package/node_modules/moment/locale/ne.js +0 -132
- package/node_modules/moment/locale/nl-be.js +0 -113
- package/node_modules/moment/locale/nl.js +0 -115
- package/node_modules/moment/locale/nn.js +0 -70
- package/node_modules/moment/locale/oc-lnc.js +0 -96
- package/node_modules/moment/locale/pa-in.js +0 -133
- package/node_modules/moment/locale/pl.js +0 -151
- package/node_modules/moment/locale/pt-br.js +0 -69
- package/node_modules/moment/locale/pt.js +0 -74
- package/node_modules/moment/locale/ro.js +0 -87
- package/node_modules/moment/locale/ru.js +0 -224
- package/node_modules/moment/locale/sd.js +0 -92
- package/node_modules/moment/locale/se.js +0 -68
- package/node_modules/moment/locale/si.js +0 -80
- package/node_modules/moment/locale/sk.js +0 -156
- package/node_modules/moment/locale/sl.js +0 -182
- package/node_modules/moment/locale/sq.js +0 -76
- package/node_modules/moment/locale/sr-cyrl.js +0 -138
- package/node_modules/moment/locale/sr.js +0 -140
- package/node_modules/moment/locale/ss.js +0 -95
- package/node_modules/moment/locale/sv.js +0 -79
- package/node_modules/moment/locale/sw.js +0 -66
- package/node_modules/moment/locale/ta.js +0 -142
- package/node_modules/moment/locale/te.js +0 -99
- package/node_modules/moment/locale/tet.js +0 -79
- package/node_modules/moment/locale/tg.js +0 -128
- package/node_modules/moment/locale/th.js +0 -76
- package/node_modules/moment/locale/tk.js +0 -102
- package/node_modules/moment/locale/tl-ph.js +0 -68
- package/node_modules/moment/locale/tlh.js +0 -135
- package/node_modules/moment/locale/tr.js +0 -117
- package/node_modules/moment/locale/tzl.js +0 -100
- package/node_modules/moment/locale/tzm-latn.js +0 -65
- package/node_modules/moment/locale/tzm.js +0 -65
- package/node_modules/moment/locale/ug-cn.js +0 -122
- package/node_modules/moment/locale/uk.js +0 -178
- package/node_modules/moment/locale/ur.js +0 -93
- package/node_modules/moment/locale/uz-latn.js +0 -65
- package/node_modules/moment/locale/uz.js +0 -62
- package/node_modules/moment/locale/vi.js +0 -91
- package/node_modules/moment/locale/x-pseudo.js +0 -84
- package/node_modules/moment/locale/yo.js +0 -64
- package/node_modules/moment/locale/zh-cn.js +0 -131
- package/node_modules/moment/locale/zh-hk.js +0 -112
- package/node_modules/moment/locale/zh-mo.js +0 -111
- package/node_modules/moment/locale/zh-tw.js +0 -110
- package/node_modules/moment/min/locales.js +0 -12570
- package/node_modules/moment/min/locales.min.js +0 -2
- package/node_modules/moment/min/locales.min.js.map +0 -1
- package/node_modules/moment/min/moment-with-locales.js +0 -18239
- package/node_modules/moment/min/moment-with-locales.min.js +0 -2
- package/node_modules/moment/min/moment-with-locales.min.js.map +0 -1
- package/node_modules/moment/min/moment.min.js +0 -2
- package/node_modules/moment/min/moment.min.js.map +0 -1
- package/node_modules/moment/moment.d.ts +0 -796
- package/node_modules/moment/moment.js +0 -5685
- package/node_modules/moment/package.js +0 -11
- package/node_modules/moment/package.json +0 -116
- package/node_modules/moment/src/lib/create/check-overflow.js +0 -57
- package/node_modules/moment/src/lib/create/date-from-array.js +0 -35
- package/node_modules/moment/src/lib/create/from-anything.js +0 -117
- package/node_modules/moment/src/lib/create/from-array.js +0 -187
- package/node_modules/moment/src/lib/create/from-object.js +0 -20
- package/node_modules/moment/src/lib/create/from-string-and-array.js +0 -67
- package/node_modules/moment/src/lib/create/from-string-and-format.js +0 -135
- package/node_modules/moment/src/lib/create/from-string.js +0 -258
- package/node_modules/moment/src/lib/create/local.js +0 -5
- package/node_modules/moment/src/lib/create/parsing-flags.js +0 -28
- package/node_modules/moment/src/lib/create/utc.js +0 -5
- package/node_modules/moment/src/lib/create/valid.js +0 -51
- package/node_modules/moment/src/lib/duration/abs.js +0 -18
- package/node_modules/moment/src/lib/duration/add-subtract.js +0 -21
- package/node_modules/moment/src/lib/duration/as.js +0 -88
- package/node_modules/moment/src/lib/duration/bubble.js +0 -68
- package/node_modules/moment/src/lib/duration/clone.js +0 -5
- package/node_modules/moment/src/lib/duration/constructor.js +0 -42
- package/node_modules/moment/src/lib/duration/create.js +0 -133
- package/node_modules/moment/src/lib/duration/duration.js +0 -16
- package/node_modules/moment/src/lib/duration/get.js +0 -27
- package/node_modules/moment/src/lib/duration/humanize.js +0 -114
- package/node_modules/moment/src/lib/duration/iso-string.js +0 -68
- package/node_modules/moment/src/lib/duration/prototype.js +0 -78
- package/node_modules/moment/src/lib/duration/valid.js +0 -55
- package/node_modules/moment/src/lib/format/format.js +0 -104
- package/node_modules/moment/src/lib/locale/base-config.js +0 -41
- package/node_modules/moment/src/lib/locale/calendar.js +0 -15
- package/node_modules/moment/src/lib/locale/constructor.js +0 -5
- package/node_modules/moment/src/lib/locale/en.js +0 -39
- package/node_modules/moment/src/lib/locale/formats.js +0 -36
- package/node_modules/moment/src/lib/locale/invalid.js +0 -5
- package/node_modules/moment/src/lib/locale/lists.js +0 -93
- package/node_modules/moment/src/lib/locale/locale.js +0 -45
- package/node_modules/moment/src/lib/locale/locales.js +0 -248
- package/node_modules/moment/src/lib/locale/ordinal.js +0 -8
- package/node_modules/moment/src/lib/locale/pre-post-format.js +0 -3
- package/node_modules/moment/src/lib/locale/prototype.js +0 -88
- package/node_modules/moment/src/lib/locale/relative.js +0 -32
- package/node_modules/moment/src/lib/locale/set.js +0 -56
- package/node_modules/moment/src/lib/moment/add-subtract.js +0 -61
- package/node_modules/moment/src/lib/moment/calendar.js +0 -53
- package/node_modules/moment/src/lib/moment/clone.js +0 -5
- package/node_modules/moment/src/lib/moment/compare.js +0 -72
- package/node_modules/moment/src/lib/moment/constructor.js +0 -80
- package/node_modules/moment/src/lib/moment/creation-data.js +0 -9
- package/node_modules/moment/src/lib/moment/diff.js +0 -79
- package/node_modules/moment/src/lib/moment/format.js +0 -78
- package/node_modules/moment/src/lib/moment/from.js +0 -20
- package/node_modules/moment/src/lib/moment/get-set.js +0 -73
- package/node_modules/moment/src/lib/moment/locale.js +0 -34
- package/node_modules/moment/src/lib/moment/min-max.js +0 -62
- package/node_modules/moment/src/lib/moment/moment.js +0 -28
- package/node_modules/moment/src/lib/moment/now.js +0 -3
- package/node_modules/moment/src/lib/moment/prototype.js +0 -197
- package/node_modules/moment/src/lib/moment/start-end-of.js +0 -164
- package/node_modules/moment/src/lib/moment/to-type.js +0 -42
- package/node_modules/moment/src/lib/moment/to.js +0 -20
- package/node_modules/moment/src/lib/moment/valid.js +0 -15
- package/node_modules/moment/src/lib/parse/regex.js +0 -80
- package/node_modules/moment/src/lib/parse/token.js +0 -36
- package/node_modules/moment/src/lib/units/aliases.js +0 -31
- package/node_modules/moment/src/lib/units/constants.js +0 -9
- package/node_modules/moment/src/lib/units/day-of-month.js +0 -39
- package/node_modules/moment/src/lib/units/day-of-week.js +0 -443
- package/node_modules/moment/src/lib/units/day-of-year.js +0 -37
- package/node_modules/moment/src/lib/units/era.js +0 -287
- package/node_modules/moment/src/lib/units/hour.js +0 -159
- package/node_modules/moment/src/lib/units/millisecond.js +0 -76
- package/node_modules/moment/src/lib/units/minute.js +0 -29
- package/node_modules/moment/src/lib/units/month.js +0 -349
- package/node_modules/moment/src/lib/units/offset.js +0 -249
- package/node_modules/moment/src/lib/units/priorities.js +0 -21
- package/node_modules/moment/src/lib/units/quarter.js +0 -34
- package/node_modules/moment/src/lib/units/second.js +0 -29
- package/node_modules/moment/src/lib/units/timestamp.js +0 -20
- package/node_modules/moment/src/lib/units/timezone.js +0 -16
- package/node_modules/moment/src/lib/units/units.js +0 -20
- package/node_modules/moment/src/lib/units/week-calendar-utils.js +0 -66
- package/node_modules/moment/src/lib/units/week-year.js +0 -138
- package/node_modules/moment/src/lib/units/week.js +0 -69
- package/node_modules/moment/src/lib/units/year.js +0 -85
- package/node_modules/moment/src/lib/utils/abs-ceil.js +0 -7
- package/node_modules/moment/src/lib/utils/abs-floor.js +0 -8
- package/node_modules/moment/src/lib/utils/abs-round.js +0 -7
- package/node_modules/moment/src/lib/utils/compare-arrays.js +0 -18
- package/node_modules/moment/src/lib/utils/defaults.js +0 -10
- package/node_modules/moment/src/lib/utils/deprecate.js +0 -69
- package/node_modules/moment/src/lib/utils/extend.js +0 -19
- package/node_modules/moment/src/lib/utils/has-own-prop.js +0 -3
- package/node_modules/moment/src/lib/utils/hooks.js +0 -13
- package/node_modules/moment/src/lib/utils/index-of.js +0 -18
- package/node_modules/moment/src/lib/utils/is-array.js +0 -6
- package/node_modules/moment/src/lib/utils/is-calendar-spec.js +0 -25
- package/node_modules/moment/src/lib/utils/is-date.js +0 -6
- package/node_modules/moment/src/lib/utils/is-function.js +0 -6
- package/node_modules/moment/src/lib/utils/is-leap-year.js +0 -3
- package/node_modules/moment/src/lib/utils/is-moment-input.js +0 -75
- package/node_modules/moment/src/lib/utils/is-number.js +0 -6
- package/node_modules/moment/src/lib/utils/is-object-empty.js +0 -15
- package/node_modules/moment/src/lib/utils/is-object.js +0 -8
- package/node_modules/moment/src/lib/utils/is-string.js +0 -3
- package/node_modules/moment/src/lib/utils/is-undefined.js +0 -3
- package/node_modules/moment/src/lib/utils/keys.js +0 -20
- package/node_modules/moment/src/lib/utils/map.js +0 -9
- package/node_modules/moment/src/lib/utils/mod.js +0 -3
- package/node_modules/moment/src/lib/utils/some.js +0 -20
- package/node_modules/moment/src/lib/utils/to-int.js +0 -12
- package/node_modules/moment/src/lib/utils/zero-fill.js +0 -10
- package/node_modules/moment/src/locale/af.js +0 -71
- package/node_modules/moment/src/locale/ar-dz.js +0 -156
- package/node_modules/moment/src/locale/ar-kw.js +0 -55
- package/node_modules/moment/src/locale/ar-ly.js +0 -171
- package/node_modules/moment/src/locale/ar-ma.js +0 -56
- package/node_modules/moment/src/locale/ar-sa.js +0 -105
- package/node_modules/moment/src/locale/ar-tn.js +0 -55
- package/node_modules/moment/src/locale/ar.js +0 -189
- package/node_modules/moment/src/locale/az.js +0 -102
- package/node_modules/moment/src/locale/be.js +0 -142
- package/node_modules/moment/src/locale/bg.js +0 -87
- package/node_modules/moment/src/locale/bm.js +0 -52
- package/node_modules/moment/src/locale/bn-bd.js +0 -129
- package/node_modules/moment/src/locale/bn.js +0 -119
- package/node_modules/moment/src/locale/bo.js +0 -124
- package/node_modules/moment/src/locale/br.js +0 -168
- package/node_modules/moment/src/locale/bs.js +0 -150
- package/node_modules/moment/src/locale/ca.js +0 -100
- package/node_modules/moment/src/locale/cs.js +0 -180
- package/node_modules/moment/src/locale/cv.js +0 -63
- package/node_modules/moment/src/locale/cy.js +0 -98
- package/node_modules/moment/src/locale/da.js +0 -53
- package/node_modules/moment/src/locale/de-at.js +0 -79
- package/node_modules/moment/src/locale/de-ch.js +0 -78
- package/node_modules/moment/src/locale/de.js +0 -78
- package/node_modules/moment/src/locale/dv.js +0 -90
- package/node_modules/moment/src/locale/el.js +0 -106
- package/node_modules/moment/src/locale/en-au.js +0 -68
- package/node_modules/moment/src/locale/en-ca.js +0 -64
- package/node_modules/moment/src/locale/en-gb.js +0 -68
- package/node_modules/moment/src/locale/en-ie.js +0 -68
- package/node_modules/moment/src/locale/en-il.js +0 -64
- package/node_modules/moment/src/locale/en-in.js +0 -68
- package/node_modules/moment/src/locale/en-nz.js +0 -68
- package/node_modules/moment/src/locale/en-sg.js +0 -68
- package/node_modules/moment/src/locale/eo.js +0 -68
- package/node_modules/moment/src/locale/es-do.js +0 -108
- package/node_modules/moment/src/locale/es-mx.js +0 -110
- package/node_modules/moment/src/locale/es-us.js +0 -110
- package/node_modules/moment/src/locale/es.js +0 -110
- package/node_modules/moment/src/locale/et.js +0 -78
- package/node_modules/moment/src/locale/eu.js +0 -65
- package/node_modules/moment/src/locale/fa.js +0 -113
- package/node_modules/moment/src/locale/fi.js +0 -124
- package/node_modules/moment/src/locale/fil.js +0 -58
- package/node_modules/moment/src/locale/fo.js +0 -57
- package/node_modules/moment/src/locale/fr-ca.js +0 -70
- package/node_modules/moment/src/locale/fr-ch.js +0 -74
- package/node_modules/moment/src/locale/fr.js +0 -108
- package/node_modules/moment/src/locale/fy.js +0 -75
- package/node_modules/moment/src/locale/ga.js +0 -95
- package/node_modules/moment/src/locale/gd.js +0 -95
- package/node_modules/moment/src/locale/gl.js +0 -75
- package/node_modules/moment/src/locale/gom-deva.js +0 -126
- package/node_modules/moment/src/locale/gom-latn.js +0 -124
- package/node_modules/moment/src/locale/gu.js +0 -122
- package/node_modules/moment/src/locale/he.js +0 -94
- package/node_modules/moment/src/locale/hi.js +0 -168
- package/node_modules/moment/src/locale/hr.js +0 -156
- package/node_modules/moment/src/locale/hu.js +0 -118
- package/node_modules/moment/src/locale/hy-am.js +0 -94
- package/node_modules/moment/src/locale/id.js +0 -76
- package/node_modules/moment/src/locale/is.js +0 -140
- package/node_modules/moment/src/locale/it-ch.js +0 -64
- package/node_modules/moment/src/locale/it.js +0 -106
- package/node_modules/moment/src/locale/ja.js +0 -148
- package/node_modules/moment/src/locale/jv.js +0 -76
- package/node_modules/moment/src/locale/ka.js +0 -92
- package/node_modules/moment/src/locale/kk.js +0 -82
- package/node_modules/moment/src/locale/km.js +0 -103
- package/node_modules/moment/src/locale/kn.js +0 -124
- package/node_modules/moment/src/locale/ko.js +0 -75
- package/node_modules/moment/src/locale/ku.js +0 -118
- package/node_modules/moment/src/locale/ky.js +0 -84
- package/node_modules/moment/src/locale/lb.js +0 -137
- package/node_modules/moment/src/locale/lo.js +0 -66
- package/node_modules/moment/src/locale/lt.js +0 -125
- package/node_modules/moment/src/locale/lv.js +0 -94
- package/node_modules/moment/src/locale/me.js +0 -117
- package/node_modules/moment/src/locale/mi.js +0 -60
- package/node_modules/moment/src/locale/mk.js +0 -85
- package/node_modules/moment/src/locale/ml.js +0 -82
- package/node_modules/moment/src/locale/mn.js +0 -100
- package/node_modules/moment/src/locale/mr.js +0 -203
- package/node_modules/moment/src/locale/ms-my.js +0 -76
- package/node_modules/moment/src/locale/ms.js +0 -75
- package/node_modules/moment/src/locale/mt.js +0 -56
- package/node_modules/moment/src/locale/my.js +0 -91
- package/node_modules/moment/src/locale/nb.js +0 -60
- package/node_modules/moment/src/locale/ne.js +0 -121
- package/node_modules/moment/src/locale/nl-be.js +0 -102
- package/node_modules/moment/src/locale/nl.js +0 -104
- package/node_modules/moment/src/locale/nn.js +0 -59
- package/node_modules/moment/src/locale/oc-lnc.js +0 -85
- package/node_modules/moment/src/locale/pa-in.js +0 -122
- package/node_modules/moment/src/locale/pl.js +0 -140
- package/node_modules/moment/src/locale/pt-br.js +0 -58
- package/node_modules/moment/src/locale/pt.js +0 -63
- package/node_modules/moment/src/locale/ro.js +0 -76
- package/node_modules/moment/src/locale/ru.js +0 -213
- package/node_modules/moment/src/locale/sd.js +0 -81
- package/node_modules/moment/src/locale/se.js +0 -57
- package/node_modules/moment/src/locale/si.js +0 -69
- package/node_modules/moment/src/locale/sk.js +0 -145
- package/node_modules/moment/src/locale/sl.js +0 -171
- package/node_modules/moment/src/locale/sq.js +0 -65
- package/node_modules/moment/src/locale/sr-cyrl.js +0 -127
- package/node_modules/moment/src/locale/sr.js +0 -129
- package/node_modules/moment/src/locale/ss.js +0 -84
- package/node_modules/moment/src/locale/sv.js +0 -68
- package/node_modules/moment/src/locale/sw.js +0 -55
- package/node_modules/moment/src/locale/ta.js +0 -131
- package/node_modules/moment/src/locale/te.js +0 -88
- package/node_modules/moment/src/locale/tet.js +0 -68
- package/node_modules/moment/src/locale/tg.js +0 -117
- package/node_modules/moment/src/locale/th.js +0 -65
- package/node_modules/moment/src/locale/tk.js +0 -91
- package/node_modules/moment/src/locale/tl-ph.js +0 -57
- package/node_modules/moment/src/locale/tlh.js +0 -124
- package/node_modules/moment/src/locale/tr.js +0 -106
- package/node_modules/moment/src/locale/tzl.js +0 -89
- package/node_modules/moment/src/locale/tzm-latn.js +0 -54
- package/node_modules/moment/src/locale/tzm.js +0 -54
- package/node_modules/moment/src/locale/ug-cn.js +0 -111
- package/node_modules/moment/src/locale/uk.js +0 -167
- package/node_modules/moment/src/locale/ur.js +0 -82
- package/node_modules/moment/src/locale/uz-latn.js +0 -54
- package/node_modules/moment/src/locale/uz.js +0 -51
- package/node_modules/moment/src/locale/vi.js +0 -80
- package/node_modules/moment/src/locale/x-pseudo.js +0 -73
- package/node_modules/moment/src/locale/yo.js +0 -53
- package/node_modules/moment/src/locale/zh-cn.js +0 -120
- package/node_modules/moment/src/locale/zh-hk.js +0 -101
- package/node_modules/moment/src/locale/zh-mo.js +0 -100
- package/node_modules/moment/src/locale/zh-tw.js +0 -99
- package/node_modules/moment/src/moment.js +0 -93
- package/node_modules/moment/ts3.1-typings/moment.d.ts +0 -785
- package/node_modules/ms/index.js +0 -162
- package/node_modules/ms/license.md +0 -21
- package/node_modules/ms/package.json +0 -41
- package/node_modules/ms/readme.md +0 -60
- package/node_modules/object-hash/.jshintrc +0 -19
- package/node_modules/object-hash/.travis.yml +0 -35
- package/node_modules/object-hash/LICENSE +0 -22
- package/node_modules/object-hash/bower.json +0 -15
- package/node_modules/object-hash/dist/object_hash.js +0 -2
- package/node_modules/object-hash/dist/object_hash.js.map +0 -1
- package/node_modules/object-hash/dist/object_hash_test.js +0 -4737
- package/node_modules/object-hash/gulpfile.js +0 -97
- package/node_modules/object-hash/index.js +0 -441
- package/node_modules/object-hash/karma.conf.js +0 -69
- package/node_modules/object-hash/package.json +0 -55
- package/node_modules/object-hash/readme.markdown +0 -169
- package/node_modules/object-hash/test/blob.js +0 -41
- package/node_modules/object-hash/test/index.js +0 -290
- package/node_modules/object-hash/test/object-classes.js +0 -106
- package/node_modules/object-hash/test/old-crypto.js +0 -60
- package/node_modules/object-hash/test/replacer.js +0 -36
- package/node_modules/object-hash/test/types.js +0 -174
- package/node_modules/object-hash/test/writeToStream.js +0 -27
- package/node_modules/one-time/LICENSE +0 -22
- package/node_modules/one-time/README.md +0 -88
- package/node_modules/one-time/async.js +0 -43
- package/node_modules/one-time/index.js +0 -42
- package/node_modules/one-time/package.json +0 -38
- package/node_modules/process-nextick-args/index.js +0 -45
- package/node_modules/process-nextick-args/license.md +0 -19
- package/node_modules/process-nextick-args/package.json +0 -29
- package/node_modules/process-nextick-args/readme.md +0 -18
- package/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -58
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -687
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -74
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/readable-stream/package.json +0 -56
- package/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/safe-buffer/package.json +0 -41
- package/node_modules/safe-stable-stringify/CHANGELOG.md +0 -75
- package/node_modules/safe-stable-stringify/LICENSE +0 -21
- package/node_modules/safe-stable-stringify/esm/package.json +0 -4
- package/node_modules/safe-stable-stringify/esm/wrapper.js +0 -6
- package/node_modules/safe-stable-stringify/index.d.ts +0 -18
- package/node_modules/safe-stable-stringify/index.js +0 -618
- package/node_modules/safe-stable-stringify/package.json +0 -69
- package/node_modules/safe-stable-stringify/readme.md +0 -170
- package/node_modules/safe-stable-stringify/tsconfig.json +0 -22
- package/node_modules/simple-swizzle/LICENSE +0 -21
- package/node_modules/simple-swizzle/README.md +0 -39
- package/node_modules/simple-swizzle/index.js +0 -29
- package/node_modules/simple-swizzle/package.json +0 -40
- package/node_modules/stack-trace/.npmignore +0 -1
- package/node_modules/stack-trace/License +0 -19
- package/node_modules/stack-trace/Makefile +0 -11
- package/node_modules/stack-trace/Readme.md +0 -98
- package/node_modules/stack-trace/lib/stack-trace.js +0 -136
- package/node_modules/stack-trace/package.json +0 -25
- package/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -35
- package/node_modules/text-hex/LICENSE +0 -21
- package/node_modules/text-hex/README.md +0 -20
- package/node_modules/text-hex/index.js +0 -24
- package/node_modules/text-hex/package.json +0 -34
- package/node_modules/text-hex/test.js +0 -11
- package/node_modules/triple-beam/.eslintrc +0 -7
- package/node_modules/triple-beam/.gitattributes +0 -1
- package/node_modules/triple-beam/.travis.yml +0 -17
- package/node_modules/triple-beam/CHANGELOG.md +0 -22
- package/node_modules/triple-beam/LICENSE +0 -21
- package/node_modules/triple-beam/README.md +0 -34
- package/node_modules/triple-beam/config/cli.js +0 -42
- package/node_modules/triple-beam/config/index.js +0 -32
- package/node_modules/triple-beam/config/npm.js +0 -36
- package/node_modules/triple-beam/config/syslog.js +0 -38
- package/node_modules/triple-beam/index.js +0 -46
- package/node_modules/triple-beam/package.json +0 -40
- package/node_modules/triple-beam/test.js +0 -98
- package/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/util-deprecate/package.json +0 -31
- package/node_modules/winston/LICENSE +0 -19
- package/node_modules/winston/README.md +0 -1231
- package/node_modules/winston/dist/winston/common.js +0 -56
- package/node_modules/winston/dist/winston/config/index.js +0 -37
- package/node_modules/winston/dist/winston/container.js +0 -147
- package/node_modules/winston/dist/winston/create-logger.js +0 -145
- package/node_modules/winston/dist/winston/exception-handler.js +0 -288
- package/node_modules/winston/dist/winston/exception-stream.js +0 -94
- package/node_modules/winston/dist/winston/logger.js +0 -766
- package/node_modules/winston/dist/winston/profiler.js +0 -69
- package/node_modules/winston/dist/winston/rejection-handler.js +0 -288
- package/node_modules/winston/dist/winston/tail-file.js +0 -135
- package/node_modules/winston/dist/winston/transports/console.js +0 -166
- package/node_modules/winston/dist/winston/transports/file.js +0 -817
- package/node_modules/winston/dist/winston/transports/http.js +0 -342
- package/node_modules/winston/dist/winston/transports/index.js +0 -55
- package/node_modules/winston/dist/winston/transports/stream.js +0 -117
- package/node_modules/winston/dist/winston.js +0 -166
- package/node_modules/winston/index.d.ts +0 -213
- package/node_modules/winston/lib/winston/common.js +0 -61
- package/node_modules/winston/lib/winston/config/index.d.ts +0 -99
- package/node_modules/winston/lib/winston/config/index.js +0 -35
- package/node_modules/winston/lib/winston/container.js +0 -114
- package/node_modules/winston/lib/winston/create-logger.js +0 -104
- package/node_modules/winston/lib/winston/exception-handler.js +0 -245
- package/node_modules/winston/lib/winston/exception-stream.js +0 -54
- package/node_modules/winston/lib/winston/logger.js +0 -676
- package/node_modules/winston/lib/winston/profiler.js +0 -51
- package/node_modules/winston/lib/winston/rejection-handler.js +0 -251
- package/node_modules/winston/lib/winston/tail-file.js +0 -124
- package/node_modules/winston/lib/winston/transports/console.js +0 -117
- package/node_modules/winston/lib/winston/transports/file.js +0 -695
- package/node_modules/winston/lib/winston/transports/http.js +0 -267
- package/node_modules/winston/lib/winston/transports/index.d.ts +0 -103
- package/node_modules/winston/lib/winston/transports/index.js +0 -56
- package/node_modules/winston/lib/winston/transports/stream.js +0 -63
- package/node_modules/winston/lib/winston.js +0 -176
- package/node_modules/winston/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/winston/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/winston/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/winston/node_modules/readable-stream/README.md +0 -106
- package/node_modules/winston/node_modules/readable-stream/errors-browser.js +0 -127
- package/node_modules/winston/node_modules/readable-stream/errors.js +0 -116
- package/node_modules/winston/node_modules/readable-stream/experimentalWarning.js +0 -17
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js +0 -139
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_passthrough.js +0 -39
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js +0 -1124
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js +0 -201
- package/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js +0 -697
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -207
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -210
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -104
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js +0 -64
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -97
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js +0 -27
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/winston/node_modules/readable-stream/package.json +0 -72
- package/node_modules/winston/node_modules/readable-stream/readable-browser.js +0 -9
- package/node_modules/winston/node_modules/readable-stream/readable.js +0 -16
- package/node_modules/winston/node_modules/winston-transport/.babelrc +0 -3
- package/node_modules/winston/node_modules/winston-transport/.eslintrc +0 -7
- package/node_modules/winston/node_modules/winston-transport/.gitattributes +0 -1
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +0 -1
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +0 -1
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/index.json +0 -1
- package/node_modules/winston/node_modules/winston-transport/CHANGELOG.md +0 -126
- package/node_modules/winston/node_modules/winston-transport/LICENSE +0 -22
- package/node_modules/winston/node_modules/winston-transport/README.md +0 -50
- package/node_modules/winston/node_modules/winston-transport/dist/index.js +0 -215
- package/node_modules/winston/node_modules/winston-transport/dist/legacy.js +0 -116
- package/node_modules/winston/node_modules/winston-transport/index.d.ts +0 -39
- package/node_modules/winston/node_modules/winston-transport/index.js +0 -215
- package/node_modules/winston/node_modules/winston-transport/legacy.js +0 -119
- package/node_modules/winston/node_modules/winston-transport/package.json +0 -56
- package/node_modules/winston/package.json +0 -78
- package/node_modules/winston-compat/.gitattributes +0 -1
- package/node_modules/winston-compat/.node-version +0 -1
- package/node_modules/winston-compat/CHANGELOG.md +0 -17
- package/node_modules/winston-compat/LICENSE +0 -22
- package/node_modules/winston-compat/README.md +0 -2
- package/node_modules/winston-compat/index.js +0 -295
- package/node_modules/winston-compat/lib/transport.js +0 -135
- package/node_modules/winston-compat/node_modules/fecha/CHANGELOG.md +0 -11
- package/node_modules/winston-compat/node_modules/fecha/LICENSE +0 -22
- package/node_modules/winston-compat/node_modules/fecha/README.md +0 -259
- package/node_modules/winston-compat/node_modules/fecha/fecha.d.ts +0 -47
- package/node_modules/winston-compat/node_modules/fecha/fecha.js +0 -334
- package/node_modules/winston-compat/node_modules/fecha/fecha.min.js +0 -1
- package/node_modules/winston-compat/node_modules/fecha/package.json +0 -44
- package/node_modules/winston-compat/node_modules/logform/.babelrc +0 -3
- package/node_modules/winston-compat/node_modules/logform/.eslintrc +0 -7
- package/node_modules/winston-compat/node_modules/logform/.gitattributes +0 -1
- package/node_modules/winston-compat/node_modules/logform/.travis.yml +0 -17
- package/node_modules/winston-compat/node_modules/logform/CHANGELOG.md +0 -103
- package/node_modules/winston-compat/node_modules/logform/LICENSE +0 -21
- package/node_modules/winston-compat/node_modules/logform/README.md +0 -170
- package/node_modules/winston-compat/node_modules/logform/align.js +0 -14
- package/node_modules/winston-compat/node_modules/logform/browser.js +0 -36
- package/node_modules/winston-compat/node_modules/logform/cli.js +0 -52
- package/node_modules/winston-compat/node_modules/logform/colorize.js +0 -118
- package/node_modules/winston-compat/node_modules/logform/combine.js +0 -66
- package/node_modules/winston-compat/node_modules/logform/dist/align.js +0 -14
- package/node_modules/winston-compat/node_modules/logform/dist/browser.js +0 -37
- package/node_modules/winston-compat/node_modules/logform/dist/cli.js +0 -75
- package/node_modules/winston-compat/node_modules/logform/dist/colorize.js +0 -147
- package/node_modules/winston-compat/node_modules/logform/dist/combine.js +0 -66
- package/node_modules/winston-compat/node_modules/logform/dist/format.js +0 -69
- package/node_modules/winston-compat/node_modules/logform/dist/index.js +0 -54
- package/node_modules/winston-compat/node_modules/logform/dist/json.js +0 -27
- package/node_modules/winston-compat/node_modules/logform/dist/label.js +0 -19
- package/node_modules/winston-compat/node_modules/logform/dist/levels.js +0 -15
- package/node_modules/winston-compat/node_modules/logform/dist/logstash.js +0 -32
- package/node_modules/winston-compat/node_modules/logform/dist/metadata.js +0 -63
- package/node_modules/winston-compat/node_modules/logform/dist/ms.js +0 -18
- package/node_modules/winston-compat/node_modules/logform/dist/pad-levels.js +0 -118
- package/node_modules/winston-compat/node_modules/logform/dist/pretty-print.js +0 -20
- package/node_modules/winston-compat/node_modules/logform/dist/printf.js +0 -40
- package/node_modules/winston-compat/node_modules/logform/dist/simple.js +0 -36
- package/node_modules/winston-compat/node_modules/logform/dist/splat.js +0 -147
- package/node_modules/winston-compat/node_modules/logform/dist/timestamp.js +0 -28
- package/node_modules/winston-compat/node_modules/logform/dist/uncolorize.js +0 -31
- package/node_modules/winston-compat/node_modules/logform/examples/combine.js +0 -14
- package/node_modules/winston-compat/node_modules/logform/examples/filter.js +0 -30
- package/node_modules/winston-compat/node_modules/logform/examples/invalid.js +0 -6
- package/node_modules/winston-compat/node_modules/logform/examples/metadata.js +0 -78
- package/node_modules/winston-compat/node_modules/logform/examples/padLevels.js +0 -39
- package/node_modules/winston-compat/node_modules/logform/examples/volume.js +0 -25
- package/node_modules/winston-compat/node_modules/logform/format.js +0 -52
- package/node_modules/winston-compat/node_modules/logform/index.d.ts +0 -53
- package/node_modules/winston-compat/node_modules/logform/index.js +0 -52
- package/node_modules/winston-compat/node_modules/logform/json.js +0 -26
- package/node_modules/winston-compat/node_modules/logform/label.js +0 -19
- package/node_modules/winston-compat/node_modules/logform/levels.js +0 -12
- package/node_modules/winston-compat/node_modules/logform/logstash.js +0 -29
- package/node_modules/winston-compat/node_modules/logform/metadata.js +0 -61
- package/node_modules/winston-compat/node_modules/logform/ms.js +0 -18
- package/node_modules/winston-compat/node_modules/logform/package.json +0 -51
- package/node_modules/winston-compat/node_modules/logform/pad-levels.js +0 -83
- package/node_modules/winston-compat/node_modules/logform/pretty-print.js +0 -16
- package/node_modules/winston-compat/node_modules/logform/printf.js +0 -26
- package/node_modules/winston-compat/node_modules/logform/simple.js +0 -33
- package/node_modules/winston-compat/node_modules/logform/splat.js +0 -125
- package/node_modules/winston-compat/node_modules/logform/timestamp.js +0 -30
- package/node_modules/winston-compat/node_modules/logform/tsconfig.json +0 -22
- package/node_modules/winston-compat/node_modules/logform/uncolorize.js +0 -27
- package/node_modules/winston-compat/package.json +0 -46
- package/node_modules/winston-compat/test/clone.test.js +0 -25
- package/node_modules/winston-compat/test/helpers.js +0 -256
- package/node_modules/winston-compat/test/timestamp.test.js +0 -14
- package/node_modules/winston-compat/test/transports/transport.js +0 -205
- package/node_modules/winston-compat/test/winston-compat.test.js +0 -18
- package/node_modules/winston-daily-rotate-file/.eslintrc.js +0 -11
- package/node_modules/winston-daily-rotate-file/.node-version +0 -1
- package/node_modules/winston-daily-rotate-file/.travis.yml +0 -15
- package/node_modules/winston-daily-rotate-file/LICENSE +0 -22
- package/node_modules/winston-daily-rotate-file/README.md +0 -67
- package/node_modules/winston-daily-rotate-file/daily-rotate-file.js +0 -292
- package/node_modules/winston-daily-rotate-file/index.d.ts +0 -73
- package/node_modules/winston-daily-rotate-file/index.js +0 -7
- package/node_modules/winston-daily-rotate-file/node_modules/semver/CHANGELOG.md +0 -70
- package/node_modules/winston-daily-rotate-file/node_modules/semver/LICENSE +0 -15
- package/node_modules/winston-daily-rotate-file/node_modules/semver/README.md +0 -443
- package/node_modules/winston-daily-rotate-file/node_modules/semver/bin/semver.js +0 -174
- package/node_modules/winston-daily-rotate-file/node_modules/semver/package.json +0 -32
- package/node_modules/winston-daily-rotate-file/node_modules/semver/range.bnf +0 -16
- package/node_modules/winston-daily-rotate-file/node_modules/semver/semver.js +0 -1596
- package/node_modules/winston-daily-rotate-file/package.json +0 -54
- package/node_modules/winston-daily-rotate-file/test/memory-stream.js +0 -38
- package/node_modules/winston-daily-rotate-file/test/random-string.js +0 -31
- package/node_modules/winston-daily-rotate-file/test/transport-tests.js +0 -250
- package/node_modules/winston-transport/.babelrc +0 -3
- package/node_modules/winston-transport/.eslintrc +0 -7
- package/node_modules/winston-transport/.gitattributes +0 -1
- package/node_modules/winston-transport/.nyc_output/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
- package/node_modules/winston-transport/.nyc_output/processinfo/1c69f3e4-4c25-457d-9df5-dfa761729528.json +0 -1
- package/node_modules/winston-transport/.nyc_output/processinfo/index.json +0 -1
- package/node_modules/winston-transport/.travis.yml +0 -17
- package/node_modules/winston-transport/CHANGELOG.md +0 -115
- package/node_modules/winston-transport/LICENSE +0 -22
- package/node_modules/winston-transport/README.md +0 -50
- package/node_modules/winston-transport/dist/index.js +0 -215
- package/node_modules/winston-transport/dist/legacy.js +0 -116
- package/node_modules/winston-transport/index.d.ts +0 -37
- package/node_modules/winston-transport/index.js +0 -215
- package/node_modules/winston-transport/legacy.js +0 -119
- package/node_modules/winston-transport/package.json +0 -54
- package/node_modules/winston-transport/tsconfig.json +0 -22
- package/perf-logs.js +0 -155
- package/system-diagnostics.js +0 -199
package/lib/protect/service.js
DELETED
|
@@ -1,1203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Copyright: 2023 Contrast Security, Inc
|
|
3
|
-
Contact: support@contrastsecurity.com
|
|
4
|
-
License: Commercial
|
|
5
|
-
|
|
6
|
-
NOTICE: This Software and the patented inventions embodied within may only be
|
|
7
|
-
used as part of Contrast Security’s commercial offerings. Even though it is
|
|
8
|
-
made available through public repositories, use of this Software is subject to
|
|
9
|
-
the applicable End User Licensing Agreement found at
|
|
10
|
-
https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
11
|
-
between Contrast Security and the End User. The Software may not be reverse
|
|
12
|
-
engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
|
-
way not consistent with the End User License Agreement.
|
|
14
|
-
*/
|
|
15
|
-
'use strict';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @module lib/rules/protect/service
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const _ = require('lodash');
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
IMPORTANCE,
|
|
25
|
-
SAFE_HEADER_VALUES,
|
|
26
|
-
INPUT_TYPES,
|
|
27
|
-
RULES
|
|
28
|
-
} = require('../constants');
|
|
29
|
-
const agentEmitter = require('../agent-emitter');
|
|
30
|
-
const SampleAggregator = require('./sample-aggregator');
|
|
31
|
-
const RuleFactory = require('./rules/rule-factory');
|
|
32
|
-
const ExclusionFactory = require('../core/exclusions/exclusion-factory.js');
|
|
33
|
-
const { IpAnalyzer } = require('../util/ip-analyzer');
|
|
34
|
-
const logger = require('../core/logger')('contrast:rules:protect:service');
|
|
35
|
-
const headerValidators = require('./validators');
|
|
36
|
-
const UserInputKit = require('../reporter/models/utils/user-input-kit');
|
|
37
|
-
const UserInputFactory = require('../reporter/models/utils/user-input-factory');
|
|
38
|
-
const blockRequest = require('../util/block-request');
|
|
39
|
-
const { AsyncStorage, KEYS } = require('../core/async-storage');
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const evalOptions = { preferWorthWatching: true };
|
|
43
|
-
|
|
44
|
-
class ProtectService {
|
|
45
|
-
/**
|
|
46
|
-
* Configures the service to use the provided agent.
|
|
47
|
-
* @param {Agent} agent
|
|
48
|
-
*/
|
|
49
|
-
constructor(agent, reporter) {
|
|
50
|
-
this.reporter = reporter;
|
|
51
|
-
this.config = agent.config;
|
|
52
|
-
this.enabled = agent.isInDefendMode();
|
|
53
|
-
this.assessEnabled = agent.isInAssessMode();
|
|
54
|
-
|
|
55
|
-
this.agentLibAnalysis =
|
|
56
|
-
this.config.agent.node.native_input_analysis &&
|
|
57
|
-
this.config.agent.node.speedracer_input_analysis;
|
|
58
|
-
|
|
59
|
-
// if agentLib is present it will be used (for the "speedracer" variant of
|
|
60
|
-
// protect).
|
|
61
|
-
this.agentLib = agent.agentLib;
|
|
62
|
-
// map the rule-id in this.rules to the constant name for agentLib.RuleType values.
|
|
63
|
-
// are these mappings needed elsewhere? if so, yet another module...
|
|
64
|
-
if (this.agentLib && reporter.speedracer) {
|
|
65
|
-
this.agentLibRuleTypeToName = {
|
|
66
|
-
'nosql-injection-mongo': 'nosql-injection',
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
this._exclusionFactory = new ExclusionFactory({
|
|
71
|
-
featureSet: agent.tsFeatureSet,
|
|
72
|
-
protect: this.enabled,
|
|
73
|
-
assess: this.assessEnabled
|
|
74
|
-
});
|
|
75
|
-
this._ruleFactory = new RuleFactory({
|
|
76
|
-
featureSet: agent.tsFeatureSet,
|
|
77
|
-
enabled: this.enabled,
|
|
78
|
-
agent
|
|
79
|
-
});
|
|
80
|
-
this.rules = this._ruleFactory.getRules();
|
|
81
|
-
this.updateIpAllowlist(agent.tsFeatureSet.serverFeatures);
|
|
82
|
-
|
|
83
|
-
this.urlExclusions = this._exclusionFactory.getUrlExclusions();
|
|
84
|
-
this.inputExclusions = this._exclusionFactory.getInputExclusions();
|
|
85
|
-
this.rules = this._ruleFactory.getRules();
|
|
86
|
-
if (this.agentLibAnalysis) {
|
|
87
|
-
this.addAgentLibBitToRules();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
agentEmitter.on('server-features', (serverFeatures) => {
|
|
91
|
-
this.enabled = agent.isInDefendMode();
|
|
92
|
-
this.assessEnabled = agent.isInAssessMode();
|
|
93
|
-
this.updateRules(serverFeatures);
|
|
94
|
-
this.updateExclusions(serverFeatures);
|
|
95
|
-
this.updateIpAllowlist(serverFeatures);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
agentEmitter.on('application-settings', (applicationSettings) => {
|
|
99
|
-
this.updateRules(applicationSettings);
|
|
100
|
-
this.updateExclusions(applicationSettings);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Sends Connection/Header/URI data to SR or agent-lib to perform input analysis.
|
|
106
|
-
* @param {} meta
|
|
107
|
-
* @param {IncomingMessage} req The current request
|
|
108
|
-
* @param {ServerResponse} res The current response
|
|
109
|
-
* @returns {Boolean} Returning `true` allows instrumentation to resume app code
|
|
110
|
-
*/
|
|
111
|
-
analyzeRequest({ meta, req, res, appContext }) {
|
|
112
|
-
if (this.agentLibAnalysis) {
|
|
113
|
-
const agentLibResults = this.analyzeWithAgentLib(meta, req);
|
|
114
|
-
|
|
115
|
-
const analysis = this.handleAgentLibAnalysis({
|
|
116
|
-
asyncStorageContext: meta.asyncStorageContext,
|
|
117
|
-
appContext,
|
|
118
|
-
agentSettings: agentLibResults,
|
|
119
|
-
req,
|
|
120
|
-
res
|
|
121
|
-
});
|
|
122
|
-
return Promise.resolve(analysis);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// if not doing native analysis (i.e., agent-lib) then send a message to
|
|
126
|
-
// SR and wait for the reply.
|
|
127
|
-
return this.reporter
|
|
128
|
-
.sendMessage('request', { incomingMessage: req })
|
|
129
|
-
.then((agentSettings) => {
|
|
130
|
-
meta.requestId = agentSettings.protectState.uuid;
|
|
131
|
-
|
|
132
|
-
return this.handleAnalysisResponse({
|
|
133
|
-
asyncStorageContext: meta.asyncStorageContext,
|
|
134
|
-
appContext,
|
|
135
|
-
agentSettings,
|
|
136
|
-
req,
|
|
137
|
-
res
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Send request data to SR for analysis
|
|
144
|
-
* @param {Object} meta input analysis request metadata
|
|
145
|
-
* @param {IncomingMessage} req The current request
|
|
146
|
-
* @param {ServerResponse} res The current response
|
|
147
|
-
* @param {Buffer[]} chunks The chunks being handled
|
|
148
|
-
* @returns {Boolean} Returning `true` allows instrumentation to resume app code
|
|
149
|
-
*/
|
|
150
|
-
analyzeRequestStream({ meta, req, res, appContext }) {
|
|
151
|
-
const { requestId, chunks } = meta;
|
|
152
|
-
|
|
153
|
-
// use agentLib?
|
|
154
|
-
if (this.agentLibAnalysis) {
|
|
155
|
-
// don't try to analyze multipart bodies; agent-lib does not parse because the
|
|
156
|
-
// interpretation is framework dependent, like query params.
|
|
157
|
-
let multipart = false;
|
|
158
|
-
if (req.headers['content-type']) {
|
|
159
|
-
multipart = req.headers['content-type'].toLowerCase().includes('multipart');
|
|
160
|
-
}
|
|
161
|
-
let agentLibResults;
|
|
162
|
-
if (multipart) {
|
|
163
|
-
agentLibResults = {};
|
|
164
|
-
} else {
|
|
165
|
-
agentLibResults = this.analyzeBodyWithAgentLib(meta, chunks);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const analysis = this.handleAgentLibAnalysis({
|
|
169
|
-
asyncStorageContext: meta.asyncStorageContext,
|
|
170
|
-
appContext,
|
|
171
|
-
agentSettings: agentLibResults,
|
|
172
|
-
req,
|
|
173
|
-
res
|
|
174
|
-
});
|
|
175
|
-
return Promise.resolve(analysis);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// use SR, not agentLib.
|
|
179
|
-
return this.reporter
|
|
180
|
-
.sendMessage('request', { requestId, chunks })
|
|
181
|
-
.then((agentSettings) =>
|
|
182
|
-
this.handleAnalysisResponse({
|
|
183
|
-
asyncStorageContext: meta.asyncStorageContext,
|
|
184
|
-
appContext,
|
|
185
|
-
agentSettings,
|
|
186
|
-
req,
|
|
187
|
-
res
|
|
188
|
-
})
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
// note that agent-lib returns "trackRequest" which is the logical-not
|
|
194
|
-
// of SR's "permit" return.
|
|
195
|
-
//
|
|
196
|
-
analyzeWithAgentLib(meta, req) {
|
|
197
|
-
const rules = this.getRulesMask(meta.asyncStorageContext.defend.rules);
|
|
198
|
-
if (!rules) {
|
|
199
|
-
return {};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const arg = {
|
|
203
|
-
// header names must be lowercase. should this be done in agent-lib?
|
|
204
|
-
headers: req.rawHeaders.map((h, ix) => (ix & 1 ? h : h.toLowerCase()))
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
arg.uriPath = req.url;
|
|
208
|
-
const questionMark = req.url.indexOf('?');
|
|
209
|
-
if (questionMark >= 0) {
|
|
210
|
-
arg.queries = req.url.slice(questionMark + 1);
|
|
211
|
-
arg.uriPath = req.url.slice(0, questionMark);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
const findings = this.agentLib.scoreRequestConnect(rules, arg, evalOptions);
|
|
215
|
-
|
|
216
|
-
return findings;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
analyzeBodyWithAgentLib(meta, chunks) {
|
|
220
|
-
const rules = this.getRulesMask(meta.asyncStorageContext.defend.rules);
|
|
221
|
-
if (!rules) {
|
|
222
|
-
return {};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
let bodyData = '';
|
|
226
|
-
|
|
227
|
-
if (Array.isArray(chunks)) {
|
|
228
|
-
if (typeof chunks[0] == 'string') {
|
|
229
|
-
const bodyStr = ''.concat('', ...chunks);
|
|
230
|
-
bodyData = Buffer.from(bodyStr).toString('base64');
|
|
231
|
-
} else if (Buffer.isBuffer(chunks[0])) {
|
|
232
|
-
const bodyBuffer = Buffer.concat(chunks);
|
|
233
|
-
bodyData = Uint8Array.from(bodyBuffer);
|
|
234
|
-
} else {
|
|
235
|
-
logger.error('Invalid chunk type');
|
|
236
|
-
}
|
|
237
|
-
} else {
|
|
238
|
-
logger.error('Invalid chunk type');
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// also, if content-type has multipart...
|
|
242
|
-
const findings = this.agentLib.scoreRequestBody(
|
|
243
|
-
rules,
|
|
244
|
-
bodyData,
|
|
245
|
-
evalOptions
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
// store body buffer on findings for nosqli sink.
|
|
249
|
-
findings.bodyBuffer = bodyData;
|
|
250
|
-
return findings;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
getRulesMask(rules) {
|
|
254
|
-
return rules.reduce((mask, rule) => {
|
|
255
|
-
if (!rule.agentLibBit) {
|
|
256
|
-
logger.trace(`rule ${rule.id} missing agentLibBit`);
|
|
257
|
-
return mask;
|
|
258
|
-
}
|
|
259
|
-
return mask | rule.agentLibBit;
|
|
260
|
-
}, 0);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Independent of the part(s) of the HTTP message being analyzed, there is a
|
|
265
|
-
* common process for handling the analysis response from S-R.
|
|
266
|
-
* @param {AgentSettings} agentSettings SR model containing state and results
|
|
267
|
-
* @param {IncomingMessage} req The current request
|
|
268
|
-
* @param {ServerResponse} res The current response
|
|
269
|
-
* @returns {Boolean}
|
|
270
|
-
*/
|
|
271
|
-
handleAnalysisResponse({
|
|
272
|
-
asyncStorageContext,
|
|
273
|
-
appContext,
|
|
274
|
-
agentSettings,
|
|
275
|
-
req,
|
|
276
|
-
res
|
|
277
|
-
}) {
|
|
278
|
-
if (_.get(agentSettings, 'protectState.securityException')) {
|
|
279
|
-
return this.handleBlockAtPerimeter(res);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// If we're not blocking, then save results for input tracing.
|
|
283
|
-
this.collectSamples(
|
|
284
|
-
asyncStorageContext,
|
|
285
|
-
_.get(agentSettings, 'inputAnalysis.resultsList'),
|
|
286
|
-
appContext
|
|
287
|
-
);
|
|
288
|
-
|
|
289
|
-
return true;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Handle the analysis response from agent-lib
|
|
294
|
-
*
|
|
295
|
-
* @param {AgentSettings} agentSettings agentLib findings
|
|
296
|
-
* @param {IncomingMessage} req The current request
|
|
297
|
-
* @param {ServerResponse} res The current response
|
|
298
|
-
* @returns {Boolean}
|
|
299
|
-
*
|
|
300
|
-
* agentLib findings are an object:
|
|
301
|
-
* {trackRequest: true|false, resultsList: [result]}
|
|
302
|
-
*
|
|
303
|
-
* a result is an object:
|
|
304
|
-
* {
|
|
305
|
-
* ruleId: string,
|
|
306
|
-
* inputType: string,
|
|
307
|
-
* path: [string],
|
|
308
|
-
* key: string,
|
|
309
|
-
* value: string,
|
|
310
|
-
* score: number
|
|
311
|
-
* }
|
|
312
|
-
*/
|
|
313
|
-
// eslint-disable-next-line complexity
|
|
314
|
-
handleAgentLibAnalysis({
|
|
315
|
-
asyncStorageContext,
|
|
316
|
-
appContext,
|
|
317
|
-
agentSettings: agentLibResults,
|
|
318
|
-
res
|
|
319
|
-
}) {
|
|
320
|
-
if (!agentLibResults.resultsList) {
|
|
321
|
-
return true;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// at this point rules that are excluded by URL have been removed but
|
|
325
|
-
// none of the user-input exclusions have been applied; those exclusions
|
|
326
|
-
// are only applied for the protect.source event and this is (indirectly)
|
|
327
|
-
// invoked by the request.start and request.end events.
|
|
328
|
-
|
|
329
|
-
// determine if user input is excluded now that we have the results.
|
|
330
|
-
const { defend: { exclusions } } = asyncStorageContext;
|
|
331
|
-
|
|
332
|
-
let securityException = false;
|
|
333
|
-
// map the resultsList to the srResultsList (SR legacy format)
|
|
334
|
-
const srResultsList = [];
|
|
335
|
-
|
|
336
|
-
for (const r of agentLibResults.resultsList) {
|
|
337
|
-
// it's a little ugly but not all names returned correspond. this duplicates work
|
|
338
|
-
// in resultItemToSrResultItem() but allows us to avoid the conversion if the
|
|
339
|
-
// rule was excluded. i'm not sure it is a good trade because i'm presuming most
|
|
340
|
-
// items are not excluded, so it's a little bit of extra work to do this before
|
|
341
|
-
// the conversion.
|
|
342
|
-
const ruleId = this.agentLibRuleTypeToName[r.ruleId] || r.ruleId;
|
|
343
|
-
if (exclusions.length) {
|
|
344
|
-
const exclusionId = this.shouldExclude(exclusions, ruleId, r.inputType, r.key);
|
|
345
|
-
// don't add this to srResultsList if it is excluded.
|
|
346
|
-
// check null - can an exclusion name be an empty string?
|
|
347
|
-
if (exclusionId !== null) {
|
|
348
|
-
logger.debug(`EXCLUSION: ${exclusionId} - ${r.inputType} '${r.key}'`);
|
|
349
|
-
continue;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
const mapped = this.resultItemToSrResultItem(r);
|
|
354
|
-
// nosqli requires the object at the key returned by the object to be stored
|
|
355
|
-
// on the sample so that it can be accessed at sink time.
|
|
356
|
-
if (mapped.ruleId === 'nosql-injection' && agentLibResults.bodyBuffer) {
|
|
357
|
-
this.captureMongoObject(mapped, agentLibResults.bodyBuffer);
|
|
358
|
-
}
|
|
359
|
-
// is the rule BAP?
|
|
360
|
-
if (mapped.scoreLevel === 'DEFINITE' && this.getRuleMode(mapped.ruleId) === 'BLOCK_AT_PERIMETER') {
|
|
361
|
-
securityException = true;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
srResultsList.push(mapped);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/*
|
|
368
|
-
// this is the message SR returns but there is no need to create that format.
|
|
369
|
-
// only the resultsList is used by collectSamples(). securityException has
|
|
370
|
-
// already been synthesized.
|
|
371
|
-
const srAnalysisFmt = {
|
|
372
|
-
sentMs: Date.now(),
|
|
373
|
-
serverFeatures: undefined,
|
|
374
|
-
applicationSettings: undefined,
|
|
375
|
-
accumulatorSettings: undefined,
|
|
376
|
-
protectState: {
|
|
377
|
-
uuid: 'dead-beef-feed-a-fad-b4-a-fade',
|
|
378
|
-
trackRequest: agentLibResults.trackRequest,
|
|
379
|
-
securityException,
|
|
380
|
-
securityMessage: ''
|
|
381
|
-
},
|
|
382
|
-
inputAnalysis: { resultsList: srResultsList },
|
|
383
|
-
// tack on raw agent lib results so they can be used at sinks. this will
|
|
384
|
-
// facilitate removing the SR format when SR is removed.
|
|
385
|
-
agentLibResults
|
|
386
|
-
};
|
|
387
|
-
// */
|
|
388
|
-
|
|
389
|
-
// hack this into agentLibResults for now. it's needed to set sample.blocked
|
|
390
|
-
// when one had a DEFINITE score. previously, this was not needed because SR
|
|
391
|
-
// did reporting and only returned a securityException flag, indicating that
|
|
392
|
-
// the agent needed to block the request.
|
|
393
|
-
agentLibResults.securityException = securityException;
|
|
394
|
-
|
|
395
|
-
// save results for input tracing. collectSamples() is called with the
|
|
396
|
-
// additional parameter, agentLibResults, in this case. (see the implementation
|
|
397
|
-
// of collectSamples()).
|
|
398
|
-
this.collectSamples(
|
|
399
|
-
asyncStorageContext,
|
|
400
|
-
srResultsList,
|
|
401
|
-
appContext,
|
|
402
|
-
agentLibResults
|
|
403
|
-
);
|
|
404
|
-
|
|
405
|
-
// if there is a security exception there used to be no need to do anything more
|
|
406
|
-
// because SR would report it; when SR sent us a "securityException" it had already
|
|
407
|
-
// been reported, so the agent needed only to block the request. but with agentLib
|
|
408
|
-
// the sample must always be collected so it will be reported.
|
|
409
|
-
if (securityException) {
|
|
410
|
-
return this.handleBlockAtPerimeter(res);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
return true;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* map an agent-lib result to an SR format result.
|
|
418
|
-
*
|
|
419
|
-
* @param {result} r see handleAgentLibAnalysis above; an item returned by scoreRequestConnect
|
|
420
|
-
* in the resultsList array.
|
|
421
|
-
*
|
|
422
|
-
* @returns an SR-formatted result.
|
|
423
|
-
*/
|
|
424
|
-
resultItemToSrResultItem(r) {
|
|
425
|
-
const copy = Object.assign({}, r, { attackCount: 1 });
|
|
426
|
-
// the ruleIds are not the same. kind of ugly.
|
|
427
|
-
if (copy.ruleId in this.agentLibRuleTypeToName) {
|
|
428
|
-
copy.ruleId = this.agentLibRuleTypeToName[copy.ruleId];
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// user-input serialization wants a string. it replaces
|
|
432
|
-
// '.' with '>'; it really shouldn't do that - a '.' could
|
|
433
|
-
// be in a key, but that's how it works.
|
|
434
|
-
copy.path = copy.path.join('>');
|
|
435
|
-
// agent-lib doesn't return the pattern IDs that matched. they're not used, but the
|
|
436
|
-
// array cannot be empty for TS (rumor has it).
|
|
437
|
-
copy.idsList = ['agent-lib'];
|
|
438
|
-
if (copy.score >= 90) {
|
|
439
|
-
copy.scoreLevel = 'DEFINITE';
|
|
440
|
-
} else if (copy.score >= 10) {
|
|
441
|
-
copy.scoreLevel = 'WATCH';
|
|
442
|
-
} else {
|
|
443
|
-
// it really shouldn't be in this list...
|
|
444
|
-
copy.scoreLevel = 'NONE';
|
|
445
|
-
}
|
|
446
|
-
// get rid of the score property because it's not part of the SR
|
|
447
|
-
// resultsList items.
|
|
448
|
-
delete copy.score;
|
|
449
|
-
|
|
450
|
-
return copy;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* Capture document object sample for Mongo. Right now applies blanketly
|
|
455
|
-
* to all nosqli rules because there is not a translation layer.
|
|
456
|
-
* For more information on how this applies to mongo injection & expansion,
|
|
457
|
-
* See `mongo.md' in the agent-lib-core repo.
|
|
458
|
-
*
|
|
459
|
-
* @param {Object} libResult result object from library representing mongo injection/expansion
|
|
460
|
-
* @param {Buffer} bodyBuffer buffer form of the request body (concat'd from chunks)
|
|
461
|
-
*/
|
|
462
|
-
captureMongoObject(libResult, bodyBuffer) {
|
|
463
|
-
try {
|
|
464
|
-
// matches Sample's _inputInfoForSink
|
|
465
|
-
if (!libResult.inputInfo) {
|
|
466
|
-
libResult.inputInfo = {};
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
// parse the body as json.
|
|
470
|
-
const { path } = libResult;
|
|
471
|
-
const obj = JSON.parse(bodyBuffer.toString());
|
|
472
|
-
let doc = obj;
|
|
473
|
-
// returned path from lib is array of keys to traverse.
|
|
474
|
-
for (const entry of path) {
|
|
475
|
-
doc = doc[entry];
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
libResult.inputInfo.docObject = doc;
|
|
479
|
-
// the query clause (eg: $ne) is always the last entry in the path.
|
|
480
|
-
libResult.inputInfo.queryClause = path[path.length - 1];
|
|
481
|
-
} catch (e) {
|
|
482
|
-
logger.debug(`Failed to parse body buffer on nosqli libResult ${e}`);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Get the mode for a given rule
|
|
488
|
-
* @param {string} ruleId rule to get mode of
|
|
489
|
-
* @returns {string} the mode of the given rule
|
|
490
|
-
*/
|
|
491
|
-
getRuleMode(ruleId) {
|
|
492
|
-
// must filter every time because teamserver can update these
|
|
493
|
-
// at any time.
|
|
494
|
-
for (const rule of this.rules) {
|
|
495
|
-
if (rule.id === ruleId) {
|
|
496
|
-
return rule.mode;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
return null;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Block at perimeter when instructed to do so by S-R.
|
|
505
|
-
* @param {ServerResponse} res The current response
|
|
506
|
-
* @returns {Boolean} false which halts executing of original method
|
|
507
|
-
*/
|
|
508
|
-
handleBlockAtPerimeter(res) {
|
|
509
|
-
const finalHandlerCbIndex = AsyncStorage.get(KEYS.FINALHANDLER_CB_INDEX);
|
|
510
|
-
if (finalHandlerCbIndex || finalHandlerCbIndex == 0) {
|
|
511
|
-
const req = AsyncStorage.get(KEYS.REQ);
|
|
512
|
-
req.__onFinished && req.__onFinished.queue && req.__onFinished.queue.splice(finalHandlerCbIndex, 1);
|
|
513
|
-
}
|
|
514
|
-
blockRequest(res);
|
|
515
|
-
// halts further execution of user code
|
|
516
|
-
return false;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* When results are returned from S-R, save them for input tracing.
|
|
521
|
-
*
|
|
522
|
-
* @param {AsyncContext} asyncContext
|
|
523
|
-
* @param {[Object]} resultsList SR-format results list (see handleAgentLibAnalysis)
|
|
524
|
-
* @param {ApplicationContext} appContext request is added to this if not present
|
|
525
|
-
* @param {Object} agentLibResults used only for securityException
|
|
526
|
-
*/
|
|
527
|
-
collectSamples(asyncContext, resultsList, appContext, agentLibResults) {
|
|
528
|
-
if (!resultsList || !resultsList.length) {
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
// this shouldn't happen as this is retrieved when the request event
|
|
533
|
-
// is processed, and will be available.
|
|
534
|
-
if (!asyncContext) {
|
|
535
|
-
logger.error('StorageContext not found - Unable to create samples from results list');
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
const { request, defend } = asyncContext;
|
|
540
|
-
|
|
541
|
-
if (!appContext.request) {
|
|
542
|
-
appContext.request = request;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
this._collectSamples(defend.samples, resultsList, appContext, agentLibResults);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Collect samples from already checked and present arguments
|
|
550
|
-
*/
|
|
551
|
-
_collectSamples(samples, resultsList, appContext, agentLibResults) {
|
|
552
|
-
let blocked = false;
|
|
553
|
-
|
|
554
|
-
if (agentLibResults) {
|
|
555
|
-
blocked = !!agentLibResults.securityException;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
for (const result of resultsList) {
|
|
559
|
-
// Coerce custom rule id
|
|
560
|
-
if (result.ruleId === RULES.NOSQL_EXPANSION) {
|
|
561
|
-
result.ruleId = RULES.NOSQL_INJECTION;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// don't bind all the following vars unless we need to
|
|
565
|
-
if (result.scoreLevel === IMPORTANCE.NONE) {
|
|
566
|
-
continue;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
const {
|
|
570
|
-
scoreLevel,
|
|
571
|
-
ruleId,
|
|
572
|
-
inputType: type,
|
|
573
|
-
path,
|
|
574
|
-
key: name,
|
|
575
|
-
value,
|
|
576
|
-
idsList
|
|
577
|
-
} = result;
|
|
578
|
-
|
|
579
|
-
const sample = samples.addRuleSample({
|
|
580
|
-
id: ruleId,
|
|
581
|
-
input: UserInputFactory.makeOne({ name, path, type, value }),
|
|
582
|
-
evaluation: { results: { importance: scoreLevel } },
|
|
583
|
-
appContext
|
|
584
|
-
});
|
|
585
|
-
|
|
586
|
-
sample.blocked = blocked;
|
|
587
|
-
|
|
588
|
-
// copy over custom info for sink.
|
|
589
|
-
if (result.inputInfo) {
|
|
590
|
-
Object.assign(sample._inputInfoForSink, result.inputInfo);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
sample.filters.push(...idsList);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
updateRules(settings) {
|
|
598
|
-
if (settings) {
|
|
599
|
-
this._ruleFactory.updateSettings(settings, this.enabled);
|
|
600
|
-
this.rules = this._ruleFactory.getRules();
|
|
601
|
-
if (this.agentLibAnalysis) {
|
|
602
|
-
this.addAgentLibBitToRules();
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
addAgentLibBitToRules() {
|
|
608
|
-
for (const rule of this.rules) {
|
|
609
|
-
rule.agentLibBit = this.agentLib.RuleType[rule.id];
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
updateExclusions(settings) {
|
|
614
|
-
if (settings) {
|
|
615
|
-
this._exclusionFactory.updateSettings({
|
|
616
|
-
settings,
|
|
617
|
-
assess: this.assessEnabled,
|
|
618
|
-
protect: this.protectEnabled
|
|
619
|
-
});
|
|
620
|
-
this.urlExclusions = this._exclusionFactory.getUrlExclusions();
|
|
621
|
-
this.inputExclusions = this._exclusionFactory.getInputExclusions();
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Checks if the IP matches the current IP allowlist
|
|
627
|
-
*
|
|
628
|
-
* @param {UserInput} ipInput
|
|
629
|
-
* @return {boolean}
|
|
630
|
-
*/
|
|
631
|
-
checkIpAllowList(ipEvent) {
|
|
632
|
-
if (!(this.ipAllowlist && ipEvent)) {
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
const inputKit = new UserInputKit();
|
|
637
|
-
const { data } = ipEvent;
|
|
638
|
-
// hack; we don't have a proper rule to create the inputs from
|
|
639
|
-
const inputs = inputKit.create({}, data, ipEvent.type);
|
|
640
|
-
// length should always just be 1
|
|
641
|
-
const [input] = inputs;
|
|
642
|
-
return this.ipAllowlist.evaluate(input);
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* Loads IP analyzer for allowist analysis given TS settings.
|
|
647
|
-
*/
|
|
648
|
-
updateIpAllowlist(settings) {
|
|
649
|
-
const list = _.get(settings, 'defend.ipAllowlistsList');
|
|
650
|
-
if (list && list.length) {
|
|
651
|
-
this.ipAllowlist = new IpAnalyzer(list);
|
|
652
|
-
this.ipAllowlist.on('expired', (dtm) => {
|
|
653
|
-
const dtms = this.ipAllowlist.dtms.filter((item) => item.id !== dtm.id);
|
|
654
|
-
logger.info(`Defend allowlist item expired: ${dtm.id}.`);
|
|
655
|
-
this.ipAllowlist = new IpAnalyzer(dtms);
|
|
656
|
-
});
|
|
657
|
-
} else {
|
|
658
|
-
this.ipAllowlist = null;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* Loads the rules for context storage based on current url exclusions.
|
|
664
|
-
* This is only called by protect/listeners.js and probably belongs there
|
|
665
|
-
* rather than here, but it's here. In any case, listeners sets async
|
|
666
|
-
* context rules based on the return value of this function.
|
|
667
|
-
*
|
|
668
|
-
* @param {string} path
|
|
669
|
-
* @param {SourceEvent} ipEvent created when an http 'request' event occurs
|
|
670
|
-
* @returns {[Rule]} the array of rules that applies to this URL
|
|
671
|
-
*
|
|
672
|
-
* exclusions are an array of exclusion objects.
|
|
673
|
-
* [{
|
|
674
|
-
* assess: boolean,
|
|
675
|
-
* assessmentRulesList: [],
|
|
676
|
-
* defend: boolean,
|
|
677
|
-
* inputName: string,
|
|
678
|
-
* inputType: string enum 'PARAMETER', ? (<= querystring & parameter)
|
|
679
|
-
* isNamed: boolean,
|
|
680
|
-
* matchStrategy: string enum 'ALL', ?,
|
|
681
|
-
* name: 'parameter-input', // name of exclusion
|
|
682
|
-
* urls: [],
|
|
683
|
-
* }]
|
|
684
|
-
*
|
|
685
|
-
* exclusion inputTypes: BODY, COOKIE, HEADER, PARAMETER - all input types
|
|
686
|
-
* are mapped to one of these four.
|
|
687
|
-
*
|
|
688
|
-
*/
|
|
689
|
-
getEnabledRules(path, ipEvent) {
|
|
690
|
-
if (!this.enabled) {
|
|
691
|
-
return [];
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
if (this.checkIpAllowList(ipEvent)) {
|
|
695
|
-
return [];
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
return this.rules.filter((rule) => {
|
|
699
|
-
const { id } = rule;
|
|
700
|
-
|
|
701
|
-
for (const exclusion of this.urlExclusions) {
|
|
702
|
-
if (exclusion.appliesToProtectRule(id) && exclusion.matchesUrl(path)) {
|
|
703
|
-
return false;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
return true;
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
/**
|
|
712
|
-
* returns an array of the input exclusions applicable to the current url
|
|
713
|
-
*
|
|
714
|
-
* @param {string} path
|
|
715
|
-
*/
|
|
716
|
-
getEnabledInputExclusions(path) {
|
|
717
|
-
if (!this.enabled) {
|
|
718
|
-
return [];
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
const { inputExclusions } = this;
|
|
722
|
-
|
|
723
|
-
return inputExclusions.filter(
|
|
724
|
-
(exclusion) => exclusion.defend && exclusion.matchesUrl(path)
|
|
725
|
-
);
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* Dispatches to the appropriate preFilter handler based on the SourceEvent
|
|
730
|
-
* input type. If the event type is an URL_PARAMETER and agent-lib analysis
|
|
731
|
-
* is being used, dispatches to a different handler because agent-lib needs
|
|
732
|
-
* to check url params after the framework has parsed them.
|
|
733
|
-
*
|
|
734
|
-
* @param {SourceEvent} event Source event providing data and context (from lib/protect/listeners).
|
|
735
|
-
* @param {[Rule]} rules enabled rules
|
|
736
|
-
* @param {[InputExclusions]} inputExclusions input exclusions
|
|
737
|
-
* @param {Samples} samples Samples object for this request
|
|
738
|
-
*/
|
|
739
|
-
// eslint-disable-next-line complexity
|
|
740
|
-
handleSourceEvent(event, rules, inputExclusions, samples) {
|
|
741
|
-
// reduce the number of rules and exclusions that need to be checked because
|
|
742
|
-
// the event.type does not change.
|
|
743
|
-
rules = rules.filter((rule) => rule.appliesToInputType(event.type));
|
|
744
|
-
if (rules.length === 0) {
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
inputExclusions = inputExclusions.filter((iex) => iex.appliesToInputType(event.type));
|
|
748
|
-
|
|
749
|
-
// agent-lib handles raw URLs, bodies, querystrings, headers, etc. but cannot
|
|
750
|
-
// handle URL parameter (e.g., /path/:param/action) because only the framework
|
|
751
|
-
// is aware of them. this function is invoked after the framework has parsed
|
|
752
|
-
// the URL and created the params object. this is important because the params,
|
|
753
|
-
// as represented in the URL, is URI encoded so the normal regexes will not
|
|
754
|
-
// match until the framework has decoded the param.
|
|
755
|
-
if (this.agentLibAnalysis) {
|
|
756
|
-
switch (event.type) {
|
|
757
|
-
case 'URL_PARAMETER': {
|
|
758
|
-
this.handleUrlParametersWithAgentLib(event, rules, inputExclusions, samples);
|
|
759
|
-
break;
|
|
760
|
-
}
|
|
761
|
-
case 'MULTIPART_NAME': {
|
|
762
|
-
this.handleMultipartFilenameWithAgentLib(event, rules, inputExclusions, samples);
|
|
763
|
-
break;
|
|
764
|
-
}
|
|
765
|
-
case 'MULTIPART_VALUE':
|
|
766
|
-
case 'BODY': {
|
|
767
|
-
this.handleMultipartBodyWithAgentLib(event, rules, inputExclusions, samples);
|
|
768
|
-
break;
|
|
769
|
-
}
|
|
770
|
-
case 'COOKIE_VALUE': {
|
|
771
|
-
this.handleCookiesWithAgentLib(event, rules, inputExclusions, samples);
|
|
772
|
-
break;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
// remove agent-lib rules from the list to be handled by node. node handles rules
|
|
778
|
-
// that are not implemented by agent-lib. remove the agent-lib rules so those rules
|
|
779
|
-
// are not executed by both agent-lib and node.
|
|
780
|
-
rules = rules.filter((r) => !r.agentLibBit);
|
|
781
|
-
if (rules.length === 0) {
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
const data = this.filterSafeData(event);
|
|
786
|
-
if (data.length === 0) {
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
const inputKit = new UserInputKit();
|
|
791
|
-
|
|
792
|
-
for (const rule of rules) {
|
|
793
|
-
const inputs = inputKit.create(rule, data, event.type);
|
|
794
|
-
for (const input of inputs) {
|
|
795
|
-
if (this.isUserInputExcluded({ inputExclusions, rule, event, input })) {
|
|
796
|
-
continue;
|
|
797
|
-
}
|
|
798
|
-
// for all rules that do not use library input analysis.
|
|
799
|
-
if (!(rule.usesLibInputAnalysis && this.agentLibAnalysis)) {
|
|
800
|
-
logger.debug(`Starting rule analysis: ${input.type} ${input.name}`);
|
|
801
|
-
rule.preFilterUserInput(input, event, samples);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
/**
|
|
808
|
-
* handle protect.source events for URL parameters when agent lib is enabled.
|
|
809
|
-
*
|
|
810
|
-
* @param {SourceEvent} event Source event providing data and context (from lib/protect/listeners).
|
|
811
|
-
* @param {[Rule]} rules enabled rules
|
|
812
|
-
* @param {[InputExclusions]} inputExclusions input exclusions
|
|
813
|
-
* @param {Samples} samples Samples object for this request
|
|
814
|
-
*/
|
|
815
|
-
// eslint-disable-next-line complexity
|
|
816
|
-
handleUrlParametersWithAgentLib(event, rules, inputExclusions, samples) {
|
|
817
|
-
const res = event._serverResponse;
|
|
818
|
-
const params = event.data;
|
|
819
|
-
// if it's URL_PARAMETER and there are not params, then why are
|
|
820
|
-
// we here?
|
|
821
|
-
if (!params) {
|
|
822
|
-
logger.debug('handleUrlParametersWithAgentLib - no params found');
|
|
823
|
-
return;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
const srResultsList = [];
|
|
827
|
-
let securityException = false;
|
|
828
|
-
const type = this.agentLib.InputType.UrlParameter;
|
|
829
|
-
const libRules = this.getRulesMask(rules);
|
|
830
|
-
|
|
831
|
-
if (!libRules) {
|
|
832
|
-
logger.debug('handleUrlParametersWithAgentLib - no rules');
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
// for each key, check out the value. the key is set in the code so
|
|
837
|
-
// is not vulnerable.
|
|
838
|
-
for (const key in params) {
|
|
839
|
-
// items from scoreAtom() return only [{ruleId, score}, ...] because the key
|
|
840
|
-
// and inputType are already known and there is no path.
|
|
841
|
-
const items = this.agentLib.scoreAtom(libRules, params[key], type);
|
|
842
|
-
if (!items) {
|
|
843
|
-
continue;
|
|
844
|
-
}
|
|
845
|
-
for (const item of items) {
|
|
846
|
-
item.inputType = type;
|
|
847
|
-
const resultItem = Object.assign({ path: [key], value: params[key] }, item);
|
|
848
|
-
const mapped = this.resultItemToSrResultItem(resultItem);
|
|
849
|
-
const input = { type, name: key };
|
|
850
|
-
if (this.isUserInputExcluded({ inputExclusions, rule: { id: mapped.ruleId }, event, input })) {
|
|
851
|
-
continue;
|
|
852
|
-
}
|
|
853
|
-
if (mapped.scoreLevel === 'DEFINITE' && this.getRuleMode(mapped.ruleId) === 'BLOCK_AT_PERIMETER') {
|
|
854
|
-
securityException = true;
|
|
855
|
-
}
|
|
856
|
-
srResultsList.push(mapped);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
this._collectSamples(samples, srResultsList, {}, { securityException });
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
if (securityException) {
|
|
864
|
-
this.handleBlockAtPerimeter(res);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
// event.type === MULTIPART_NAME, data: {newrelic.js: 'newrelic.js'}
|
|
869
|
-
handleMultipartFilenameWithAgentLib(event, rules, inputExclusions, samples) {
|
|
870
|
-
const res = event._serverResponse;
|
|
871
|
-
const srResultsList = [];
|
|
872
|
-
let securityException = false;
|
|
873
|
-
// 'MULTIPART_NAME' is apparently used only for filenames; 'MULTIPART_VALUE'
|
|
874
|
-
// is used for multipart KV pairs (and we can just use PARAMETER_KEY/PARAMETER_VALUE).
|
|
875
|
-
const type = this.agentLib.InputType.MultipartName;
|
|
876
|
-
const libRules = this.getRulesMask(rules);
|
|
877
|
-
|
|
878
|
-
if (!libRules) {
|
|
879
|
-
logger.debug('handleUrlParametersWithAgentLib - no rules');
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
// why these aren't {filename: 'newrelic.js'} instead of {newrelic.js: 'newrelic.js'}
|
|
884
|
-
// escapes me.
|
|
885
|
-
if (typeof event.data !== 'object') {
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
const filenames = Object.keys(event.data);
|
|
889
|
-
|
|
890
|
-
for (const filename of filenames) {
|
|
891
|
-
const items = this.agentLib.scoreAtom(libRules, filename, type);
|
|
892
|
-
if (!items) {
|
|
893
|
-
continue;
|
|
894
|
-
}
|
|
895
|
-
for (const item of items) {
|
|
896
|
-
item.inputType = type;
|
|
897
|
-
const resultItem = Object.assign({ path: [filename], value: filename }, item);
|
|
898
|
-
const mapped = this.resultItemToSrResultItem(resultItem);
|
|
899
|
-
if (mapped.scoreLevel === 'DEFINITE' && this.getRuleMode(mapped.ruleId) === 'BLOCK_AT_PERIMETER') {
|
|
900
|
-
securityException = true;
|
|
901
|
-
}
|
|
902
|
-
srResultsList.push(mapped);
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
this._collectSamples(samples, srResultsList, {}, { securityException });
|
|
907
|
-
|
|
908
|
-
if (securityException) {
|
|
909
|
-
this.handleBlockAtPerimeter(res);
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
handleMultipartBodyWithAgentLib(event, rules, inputExclusions, samples) {
|
|
914
|
-
const rulesMask = this.getRulesMask(rules);
|
|
915
|
-
if (!rulesMask || typeof event.data !== 'object' || !event._ctxt) {
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
// just treat these as an array of query params.
|
|
919
|
-
const queries = Object.entries(event.data)
|
|
920
|
-
.filter(i => typeof i[1] === 'string')
|
|
921
|
-
.reduce((queries, q) => {
|
|
922
|
-
queries.unshift(...q); return queries;
|
|
923
|
-
}, []);
|
|
924
|
-
|
|
925
|
-
const arg = { queries };
|
|
926
|
-
|
|
927
|
-
const findings = this.agentLib.scoreRequestConnect(rulesMask, arg, evalOptions);
|
|
928
|
-
|
|
929
|
-
this.handleAgentLibAnalysis({
|
|
930
|
-
asyncStorageContext: event._ctxt,
|
|
931
|
-
appContext: {},
|
|
932
|
-
agentSettings: findings,
|
|
933
|
-
req: event._incomingMessage,
|
|
934
|
-
res: event._serverResponse,
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
handleCookiesWithAgentLib(event, rules, inputExclusions, samples) {
|
|
939
|
-
const cookies = Object.entries(event.data).reduce((acc, [key, value]) => {
|
|
940
|
-
acc.unshift(key, value);
|
|
941
|
-
return acc;
|
|
942
|
-
}, []);
|
|
943
|
-
const rulesMask = this.getRulesMask(rules);
|
|
944
|
-
const arg = { cookies };
|
|
945
|
-
const findings = this.agentLib.scoreRequestConnect(rulesMask, arg, evalOptions);
|
|
946
|
-
this.handleAgentLibAnalysis({
|
|
947
|
-
asyncStorageContext: event._ctxt,
|
|
948
|
-
appContext: {},
|
|
949
|
-
agentSettings: findings,
|
|
950
|
-
req: event._incomingMessage,
|
|
951
|
-
res: event._serverResponse,
|
|
952
|
-
});
|
|
953
|
-
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* check a rule/input combination against the specified exclusions.
|
|
958
|
-
*
|
|
959
|
-
* @param {[Exclusion]} exclusions array of exclusions to check against
|
|
960
|
-
* @param {String} ruleId the rule ID
|
|
961
|
-
* @param {String} inputType the type of the input
|
|
962
|
-
* @param {String} inputName the key for JSON objects and KV pairs
|
|
963
|
-
*
|
|
964
|
-
* @returns {String|null} the name of the exclusion that applied, or null.
|
|
965
|
-
*/
|
|
966
|
-
shouldExclude(exclusions, ruleId, inputType, inputName) {
|
|
967
|
-
for (const exclusion of exclusions) {
|
|
968
|
-
if (exclusion.shouldExclude(ruleId, inputType, inputName)) {
|
|
969
|
-
return exclusion.name;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
return null;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
isUserInputExcluded({ inputExclusions, rule, event, input }) {
|
|
976
|
-
let excluded;
|
|
977
|
-
for (const exclusion of inputExclusions) {
|
|
978
|
-
excluded = exclusion.shouldExclude(rule.id, input.type, input.name);
|
|
979
|
-
if (excluded) {
|
|
980
|
-
logger.debug(`EXCLUSION: ${exclusion.name} - ${input.type} '${input.name}'`);
|
|
981
|
-
break;
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
return excluded;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
skipEventHandling(rules) {
|
|
988
|
-
return _.isEmpty(rules);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
/**
|
|
992
|
-
* Given a SinkEvent, will run applicable rule evaluations.
|
|
993
|
-
* @param {Object} params
|
|
994
|
-
* @param {SinkEvent} params.event
|
|
995
|
-
* @param {[Rule]} params.rules
|
|
996
|
-
* @param {[Samples]} params.samples worthWatching/definite
|
|
997
|
-
*/
|
|
998
|
-
handleSinkEvent({ event, rules, samples }) {
|
|
999
|
-
if (_.isEmpty(rules)) {
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
const { request } = event;
|
|
1004
|
-
for (const rule of rules) {
|
|
1005
|
-
if (!rule.appliesToSink(event.type)) {
|
|
1006
|
-
continue;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
const applicableSamples = samples.getAll(rule.id);
|
|
1010
|
-
// this should be tested here as opposed to constructing an object
|
|
1011
|
-
// and passing it to evaluateAtSink*(). but tests expect that
|
|
1012
|
-
// evaluateAtSink*() gets called and they don't bother to set up
|
|
1013
|
-
// appopriate samples and event data. so, comment it out for now.
|
|
1014
|
-
//if (applicableSamples.size === 0 || !event.data) {
|
|
1015
|
-
// continue;
|
|
1016
|
-
//}
|
|
1017
|
-
|
|
1018
|
-
// Do we want to use the standard node evaluator or the library sink
|
|
1019
|
-
// evaluation (which requires data from the library's input analysis stage)?
|
|
1020
|
-
const args = { event, samples, applicableSamples, request };
|
|
1021
|
-
|
|
1022
|
-
if (!this.agentLibAnalysis || !rule.evaluateAtSinkForLib) {
|
|
1023
|
-
rule.evaluateAtSink(args);
|
|
1024
|
-
} else {
|
|
1025
|
-
rule.evaluateAtSinkForLib(args);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
/**
|
|
1031
|
-
* Filters out data that is "safe" meaning not applicable to any
|
|
1032
|
-
* protect rule evaluations
|
|
1033
|
-
*
|
|
1034
|
-
* Related Ticket: https://contrast.atlassian.net/browse/CONTRAST-35257
|
|
1035
|
-
*
|
|
1036
|
-
* @param {event.type} type This is an INPUT_TYPE
|
|
1037
|
-
* @param {event.data} data Data pertaining to the SourceEvent
|
|
1038
|
-
*/
|
|
1039
|
-
filterSafeData({ type, data }) {
|
|
1040
|
-
switch (type) {
|
|
1041
|
-
case INPUT_TYPES.HEADER:
|
|
1042
|
-
return this.filterSafeHeaders(data);
|
|
1043
|
-
default:
|
|
1044
|
-
return data;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
/**
|
|
1049
|
-
*
|
|
1050
|
-
* Filters out any headers that either match a list of "safe" values
|
|
1051
|
-
* or match the specification for specific header see ./validators
|
|
1052
|
-
* for info on each header validator
|
|
1053
|
-
*
|
|
1054
|
-
* @param {Object} data key/value of request headers
|
|
1055
|
-
* @returns {Object} A headers object with safe headers filtered out
|
|
1056
|
-
*/
|
|
1057
|
-
filterSafeHeaders(data) {
|
|
1058
|
-
return _.reduce(
|
|
1059
|
-
data,
|
|
1060
|
-
(accum, value, key) => {
|
|
1061
|
-
const headerName = key.toLowerCase();
|
|
1062
|
-
|
|
1063
|
-
if (SAFE_HEADER_VALUES.indexOf(value) !== -1) {
|
|
1064
|
-
return accum;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
const isSafeHeader = headerValidators[headerName];
|
|
1068
|
-
|
|
1069
|
-
if (typeof isSafeHeader === 'function' && isSafeHeader(value)) {
|
|
1070
|
-
return accum;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
accum[headerName] = value;
|
|
1074
|
-
return accum;
|
|
1075
|
-
},
|
|
1076
|
-
{}
|
|
1077
|
-
);
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
/**
|
|
1081
|
-
* Samples collected for the current request will be processed.
|
|
1082
|
-
* The security logger will make an entry for each sample collected;
|
|
1083
|
-
*
|
|
1084
|
-
* @param {Array<Rule>} rules
|
|
1085
|
-
* @param {Samples} samples
|
|
1086
|
-
*/
|
|
1087
|
-
submitFindings(rules, samples) {
|
|
1088
|
-
const findings = this.createFindings(rules, samples);
|
|
1089
|
-
const aggregated = SampleAggregator.aggregate(findings, (finding) => this.wwFilter(finding));
|
|
1090
|
-
for (const finding of aggregated) {
|
|
1091
|
-
agentEmitter.emit('attack', finding);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
/**
|
|
1096
|
-
* See: https://contrast.atlassian.net/browse/NODE-670
|
|
1097
|
-
* The way we collect findings in SR vs node
|
|
1098
|
-
* input analysis differs. It may be because of bugs in
|
|
1099
|
-
* node input analysis but since that is going away soon
|
|
1100
|
-
* we have forked how we add findings from SR input analysis
|
|
1101
|
-
* from node agent
|
|
1102
|
-
*
|
|
1103
|
-
* @param {Object} params
|
|
1104
|
-
* @param {Array} findings to report
|
|
1105
|
-
* @param {Set} ruleSamples of all samples for a given rule
|
|
1106
|
-
* @param {Rule} protect rule object
|
|
1107
|
-
* @param {Boolean} speedracer speedracer analysis is being used. this
|
|
1108
|
-
* includes agent-lib, which uses the speedracer logic.
|
|
1109
|
-
*/
|
|
1110
|
-
addFindings({ findings, ruleSamples, rule, speedracer }) {
|
|
1111
|
-
const qsSamples = [];
|
|
1112
|
-
let hasEffectiveParamInputs = false;
|
|
1113
|
-
|
|
1114
|
-
for (const sample of ruleSamples) {
|
|
1115
|
-
if (sample.input.type === INPUT_TYPES.URI) {
|
|
1116
|
-
// forget about URL things
|
|
1117
|
-
continue;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
// is the sample a parameter name or value?
|
|
1121
|
-
hasEffectiveParamInputs = hasEffectiveParamInputs ||
|
|
1122
|
-
INPUT_TYPES.PARAMETER_VALUE === sample.input.type ||
|
|
1123
|
-
INPUT_TYPES.PARAMETER_NAME === sample.input.type;
|
|
1124
|
-
|
|
1125
|
-
// saving reference to QUERYSTRING sample in case
|
|
1126
|
-
// there are no Parameter type samples for rule
|
|
1127
|
-
if (sample.input.type === INPUT_TYPES.QUERYSTRING) {
|
|
1128
|
-
qsSamples.push(sample);
|
|
1129
|
-
} else {
|
|
1130
|
-
findings.push({
|
|
1131
|
-
rule,
|
|
1132
|
-
ruleId: rule.id,
|
|
1133
|
-
sample,
|
|
1134
|
-
status: sample.getStatus()
|
|
1135
|
-
});
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
// https://contrast.atlassian.net/browse/NODE-660 - only report one attack
|
|
1140
|
-
// when there are both QUERYSTRING and PARAMETER_VALUE types for a given rule.
|
|
1141
|
-
if (qsSamples.length > 0 && !hasEffectiveParamInputs) {
|
|
1142
|
-
for (const qsSample of qsSamples) {
|
|
1143
|
-
findings.push({
|
|
1144
|
-
rule,
|
|
1145
|
-
ruleId: rule.id,
|
|
1146
|
-
sample: qsSample,
|
|
1147
|
-
status: qsSample.getStatus()
|
|
1148
|
-
});
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
/**
|
|
1154
|
-
* From a set of rules, it creates a collection "findings"
|
|
1155
|
-
* for all samples collected from each rule.
|
|
1156
|
-
*
|
|
1157
|
-
* @param {Rule[]} rules Rules from which to build findings
|
|
1158
|
-
* @returns {Object[]} The findings from the rules
|
|
1159
|
-
*/
|
|
1160
|
-
// eslint-disable-next-line default-param-last
|
|
1161
|
-
createFindings(rules = [], samples) {
|
|
1162
|
-
const findings = [];
|
|
1163
|
-
const speedracer = this.reporter.speedracer &&
|
|
1164
|
-
this.config.agent.node.speedracer_input_analysis;
|
|
1165
|
-
|
|
1166
|
-
for (const rule of rules) {
|
|
1167
|
-
const { id } = rule;
|
|
1168
|
-
const ruleSamples = samples.getAll(id);
|
|
1169
|
-
// no need to call add findings if no samples
|
|
1170
|
-
if (ruleSamples.size === 0) {
|
|
1171
|
-
continue;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
// only support SR format now; previously there was logic to handle node
|
|
1175
|
-
// analysis differently than SR analysis. agent-lib mimics SR, so both
|
|
1176
|
-
// should be the same now.
|
|
1177
|
-
this.addFindings({ findings, ruleSamples, rule, speedracer });
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
return findings;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
// worth-watching filter. this is located here so agent-lib isn't exposed to the
|
|
1184
|
-
// sample aggregator any more than necessary (agentLibBit is exposed).
|
|
1185
|
-
//
|
|
1186
|
-
// returns true if the finding should be reported as a probe, else false
|
|
1187
|
-
wwFilter(finding) {
|
|
1188
|
-
const { agentLibBit } = finding.rule;
|
|
1189
|
-
const { _type, _value: input } = finding.sample.input;
|
|
1190
|
-
const type = this.agentLib.InputType[_type];
|
|
1191
|
-
|
|
1192
|
-
const alFinding = this.agentLib.scoreAtom(agentLibBit, input, type);
|
|
1193
|
-
if (!alFinding) {
|
|
1194
|
-
return false;
|
|
1195
|
-
}
|
|
1196
|
-
if (alFinding.length > 1) {
|
|
1197
|
-
logger.debug(`scoreAtom() returned ${alFinding.length} findings`);
|
|
1198
|
-
}
|
|
1199
|
-
return alFinding[0].score >= 90;
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
module.exports = ProtectService;
|