@contrast/reporter
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -1,3 +0,2 @@ | ||
import { Core } from '@contrast/core'; | ||
import BaseReporter from './reporters/base'; | ||
import BaseReporter, { Core } from './reporters/base'; | ||
export interface ReporterBus { | ||
@@ -7,2 +6,4 @@ reporters: BaseReporter[]; | ||
} | ||
export default function init(core: Core): ReporterBus; | ||
export default function init(core: Core & { | ||
reporter: ReporterBus; | ||
}): ReporterBus; |
@@ -41,3 +41,3 @@ "use strict"; | ||
function init(core) { | ||
const { config: { agent: { reporters } } } = core; | ||
const { reporters } = core.config.agent; | ||
return core.reporter = { | ||
@@ -58,2 +58,8 @@ reporters: [], | ||
} | ||
const { path, syslog } = core.config.agent.security_logger; | ||
if (path || syslog.enable) { | ||
core.logger.trace('enabling security logger'); | ||
const { default: SyslogReporter } = await Promise.resolve().then(() => __importStar(require('./reporters/security-logger'))); | ||
this.reporters.push(new SyslogReporter(core)); | ||
} | ||
}, | ||
@@ -60,0 +66,0 @@ }; |
@@ -1,4 +0,14 @@ | ||
import { RequestStore } from '@contrast/common'; | ||
import { Core } from '@contrast/core'; | ||
import { AppInfo, Messages, RequestStore } from '@contrast/common'; | ||
import { Config } from '@contrast/config'; | ||
import { Scopes } from '@contrast/scopes'; | ||
import { Logger } from '@contrast/logger'; | ||
import { Protect } from '@contrast/protect'; | ||
export interface Core { | ||
readonly appInfo: AppInfo; | ||
readonly config: Config; | ||
readonly logger: Logger; | ||
readonly messages: Messages; | ||
readonly protect: Protect; | ||
readonly scopes: Scopes; | ||
} | ||
export default abstract class BaseReporter { | ||
@@ -5,0 +15,0 @@ name: string; |
@@ -67,2 +67,5 @@ "use strict"; | ||
function default_1() { | ||
const untrustedDeserializationDetailsBuilder = (el) => el.details?.[0]; | ||
const virtualPatchDetailsBuilder = (el) => el.details?.[0] || {}; | ||
const ipDenylistDetailsBuilder = (el) => el.details?.[0] || {}; | ||
const ssjsDetailsBuilder = (el) => { | ||
@@ -132,5 +135,2 @@ if (!el.details || el.details.length === 0) { | ||
}; | ||
const untrustedDeserializationDetailsBuilder = (el) => el.details?.[0]; | ||
const virtualPatchDetailsBuilder = (el) => el.details?.[0] || {}; | ||
const ipDenylistDetailsBuilder = (el) => el.details?.[0] || {}; | ||
const buildRequestObject = (reqData) => { | ||
@@ -137,0 +137,0 @@ const searchParams = new URLSearchParams(reqData.queries); |
/// <reference types="node" /> | ||
import { RequestStore, Messages } from '@contrast/common'; | ||
import { AppInfo, RequestStore, Messages } from '@contrast/common'; | ||
import { AxiosInstance } from 'axios'; | ||
import { Core, AppInfo } from '@contrast/core'; | ||
import { Config } from '@contrast/config'; | ||
import { Logger } from '@contrast/logger'; | ||
import { Scopes } from '@contrast/scopes'; | ||
import BaseReporter from '../base'; | ||
import BaseReporter, { Core } from '../base'; | ||
import { AttackModel } from './types'; | ||
@@ -10,0 +9,0 @@ export default class ContrastUIReporter extends BaseReporter { |
@@ -89,2 +89,4 @@ "use strict"; | ||
.put('/api/ng/servers/', { | ||
environment: this.config.server.environment, | ||
tags: this.config.server.tags, | ||
version: this.protectVersion, | ||
@@ -91,0 +93,0 @@ }) |
import { RequestStore } from '@contrast/common'; | ||
import BaseReporter from './base'; | ||
import { Core } from '@contrast/core'; | ||
import BaseReporter, { Core } from './base'; | ||
export default class FileReporter extends BaseReporter { | ||
@@ -5,0 +4,0 @@ private stream; |
{ | ||
"name": "@contrast/reporter", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "Subscribes to agent messages and reports them", | ||
@@ -11,3 +11,2 @@ "license": "SEE LICENSE IN LICENSE", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"engines": { | ||
@@ -22,4 +21,7 @@ "npm": ">=6.13.7 <7 || >= 8.3.1", | ||
"dependencies": { | ||
"@contrast/common": "1.1.2", | ||
"@contrast/common": "1.1.3", | ||
"axios": "^0.27.2", | ||
"@contrast/pino-cef": "^1.0.0", | ||
"pino": "^8.6.1", | ||
"pino-socket": "^7.2.0", | ||
"safe-stable-stringify": "^2.3.1", | ||
@@ -26,0 +28,0 @@ "sonic-boom": "^2.8.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98902
33
1496
7
2
+ Added@contrast/pino-cef@^1.0.0
+ Addedpino@^8.6.1
+ Addedpino-socket@^7.2.0
+ Added@contrast/common@1.1.3(transitive)
+ Added@contrast/pino-cef@1.0.1(transitive)
+ Addedabbrev@2.0.0(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedbackoff@2.5.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-redact@3.5.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addednopt@7.2.1(transitive)
+ Addedon-exit-leak-free@2.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpino@8.21.0(transitive)
+ Addedpino-abstract-transport@1.2.0(transitive)
+ Addedpino-socket@7.4.0(transitive)
+ Addedpino-std-serializers@6.2.2(transitive)
+ Addedprecond@0.2.3(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedprocess-warning@3.0.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquick-format-unescaped@4.0.4(transitive)
+ Addedreadable-stream@3.6.24.5.2(transitive)
+ Addedreal-require@0.2.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsonic-boom@3.8.1(transitive)
+ Addedsplit2@4.2.0(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedthread-stream@2.7.0(transitive)
+ Addedthrough2@4.0.2(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removed@contrast/common@1.1.2(transitive)
Updated@contrast/common@1.1.3