Skip to content

Commit 141237a

Browse files
committed
Apply review suggestions
1 parent e98f3e5 commit 141237a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/agent/api-discovery/getStringFormat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const indicationChars = new Set<string>(["-", ":", "@", ".", "://"]);
2525
* https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings
2626
*/
2727
export function getStringFormat(str: string): StringFormat | undefined {
28-
// Skip if too short
29-
if (str.length < 5) {
28+
// Skip if too short or very long
29+
if (str.length < 5 || str.length > 1_000) {
3030
return undefined;
3131
}
3232

library/vulnerabilities/attack-wave-detection/AttackWaveDetector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export class AttackWaveDetector {
2323
maxLRUEntries?: number;
2424
} = {}
2525
) {
26-
this.attackWaveThreshold = options.attackWaveThreshold ?? 6; // Default: 6 requests
26+
this.attackWaveThreshold = options.attackWaveThreshold ?? 15; // Default: 15 requests
2727
this.attackWaveTimeFrame = options.attackWaveTimeFrame ?? 60 * 1000; // Default: 1 minute
28-
this.minTimeBetweenEvents = options.minTimeBetweenEvents ?? 60 * 60 * 1000; // Default: 1 hour
28+
this.minTimeBetweenEvents = options.minTimeBetweenEvents ?? 20 * 60 * 1000; // Default: 20 minutes
2929
this.maxLRUEntries = options.maxLRUEntries ?? 10_000; // Default: 10,000 entries
3030

3131
this.suspiciousRequestsMap = new LRUMap(

0 commit comments

Comments
 (0)