-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for IP address blocking #447
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
…-blocking * 'beta' of github.com:AikidoSec/node-RASP: (38 commits) Remove console.log(...) Use fake credentials :) Add end2end test for n8n Upgrade to latest zen internals Use v4 of dd-trace (supports node v16 and higher) Add end2end test for compatibility with dd-trace Use fetch helper function instead of native Add comment why we use createServer Make non-owned props of express wrapped functions accessible Cleanup Preserve original handler name for Ghost Improve test Replace ULID Add test with operation name Add more tests Don't discover GraphQL queries from server-side rendering Fix tests (use createTestAgent utility fn) Fix lint Update comment Update comment ...
library/agent/Agent.ts
Outdated
@@ -341,6 +365,7 @@ export class Agent { | |||
lastUpdatedAt: this.serviceConfig.getLastUpdatedAt(), | |||
onConfigUpdate: (config) => { | |||
this.updateServiceConfig({ success: true, ...config }); | |||
this.updateBlockedIPAddresses().catch(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not swallow but log?
return undefined; | ||
} | ||
|
||
export function addIPAddressToBlocklist( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IP range?
import { escapeHTML } from "../../helpers/escapeHTML"; | ||
import { ipAllowedToAccessRoute } from "./ipAllowedToAccessRoute"; | ||
|
||
export function checkIfIPAddressIsBlocked(res: ServerResponse, agent: Agent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's state all kinds of checks performed by this function (it's goal) in comments
- eg route based
- geo/range list based
"Accept-Encoding": "gzip", | ||
Authorization: token.asString(), | ||
}, | ||
timeoutInMS: 10000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's set to 20s
No description provided.