
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
@aspecto/privacy-rules
Advanced tools
Privacy rules allow to specify which requests or fields need to be blocked or scrambled. Rules are described in a JSON with a certain structure and can be executed by PrivacyEngine.
// specify some rules
const blockRule: PrivacyRuleDef = {
conditions: [{ conditionType: 'always' }],
actions: [{ actionType: 'block-request' }],
};
const scrambleFieldRule: PrivacyRuleDef = {
conditions: [{ conditionType: 'route', conditionData: { filterType: 'by-value', filterValue: '/users/' } }],
actions: [
{
actionType: 'scramble-field',
actionData: {
fieldTypes: ['header', 'body-json', 'query-param'],
filter: { filterType: 'by-key', filterValue: 'Authentication' },
},
},
{
actionType: 'scramble-field',
actionData: {
fieldTypes: ['header', 'body-json', 'query-param'],
filter: { filterType: 'by-key', filterValue: 'Bearer' },
},
},
],
};
const blockFieldRule: PrivacyRuleDef = {
conditions: [{ conditionType: 'service', conditionData: { filterType: 'by-value', filterValue: 'user-service' } }],
actions: [
{
actionType: 'block-field',
actionData: {
fieldTypes: ['header', 'body-json', 'query-param'],
filter: { filterType: 'by-key', filterValue: 'Authentication' },
},
},
{
actionType: 'block-field',
actionData: {
fieldTypes: ['header', 'body-json', 'query-param'],
filter: { filterType: 'by-key', filterValue: 'Bearer' },
},
},
],
};
// example message (http request-response)
export const sampleMessage: AspectoMessage = {
packageName: 'user-service',
HTTP_REQUEST: {
route: { path: '/users/' },
body: { user: 'daniel', password: 'craig' },
query: {
auth: 'token',
param1: 'notprivate',
},
requestHeaders: {
Bearer: 'req-token',
},
responseHeaders: {
Authentication: 'resp-token',
},
},
};
// create an instance of the engine, set rules and execute them
const privacyEngine = new PrivacyEngine();
const rules: any[] = [blockRule, blockFieldRule, scrambleFieldRule];
privacyEngine.setRules(rules);
// this will mutate the message, blocking or scrambling certain fields
const result = privacyEngine.executeRules(sampleMessage);
FAQs
Aspecto Privacy Rules Engine
We found that @aspecto/privacy-rules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.