@ubiquious/backstage-plugin-audit-node
v0.1.2
Published
Node.js library for the audit plugin
Downloads
81
Readme
@ubiquious/backstage-plugin-audit-node
This library brings a middleware to audit every incoming request to Backstage.
Installation
// packages/backend/src/index.ts
import { auditMiddlware } from '@ubiquious/backstage-plugin-audit-node';
import { rootHttpRouterServiceFactory } from '@backstage/backend-app-api';
//
backend.add(
rootHttpRouterServiceFactory({
configure(context) {
context.app.use(auditMiddlware(context.config, context.logger));
context.applyDefaults();
},
}),
);
In the configuration, provider the URL of the audit backend. By default, it passes by localhost that is much secure.
# app-config.yaml
audit:
url: 'http://localhost:7007/api/audit/receive' # Mandatory
pluginName: 'audit' # Optional, default to "audit"
bypassPaths: ['/my-sensitive-route'] # Optionnal, default to []
bypassMethods: ['GET'] # Optionnal, default to []