draco-insomnis 0.1.29 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,6 +53,8 @@ export class CrowdSec {
53
53
  }
54
54
  async pull() {
55
55
  const out = { added: 0, removed: 0, error: '' };
56
+ // Any sync, also one called by hand, counts as this minute's.
57
+ await this.store.set('draco:crowdsec:sync', '1', EVERY);
56
58
  // The first call asks for everything in force; later ones only for changes.
57
59
  const startup = (await this.store.get('draco:crowdsec:started')) === null;
58
60
  const url = `${this.options.url.replace(/\/+$/, '')}/v1/decisions/stream?startup=${startup}&scopes=ip,range`;
@@ -16,6 +16,8 @@ export interface WafInput {
16
16
  userAgent?: string;
17
17
  }
18
18
  export type WafRule = 'scanner' | 'probe' | 'sqli' | 'traversal' | 'code' | 'xss';
19
+ export declare const SCANNERS: RegExp;
20
+ export declare const PROBES: RegExp;
19
21
  /** Byte-wise %XX decoding like PHP's rawurldecode (never throws on malformed input). */
20
22
  export declare function rawUrlDecode(value: string): string;
21
23
  /** The rule that matched, or null. */
package/dist/core/waf.js CHANGED
@@ -6,8 +6,8 @@
6
6
  * that real visitors never send are matched. Text bodies (forms) are only checked for SQL and code
7
7
  * injection shapes; HTML-looking input is only checked in the URL, where nobody types it by hand.
8
8
  */
9
- const SCANNERS = /\b(sqlmap|nikto|wpscan|nmap|masscan|zgrab|nuclei|acunetix|dirbuster|gobuster|ffuf|feroxbuster|wfuzz|whatweb|openvas|netsparker|jaeles|hydra)\b/i;
10
- const PROBES = /(^|\/)(\.env(\.[a-z0-9]+)?$|\.git(\/|$)|\.svn\/|\.hg\/|\.aws\/|\.ssh\/|\.ds_store$|wp-config\.php[^/]+$|wp-config\.(bak|old|txt|orig|save|swp)$|phpinfo\.php$|info\.php$|adminer[\w.-]*\.php$|eval-stdin\.php$|vendor\/phpunit\/|[\w.-]+\.sql(\.gz|\.zip)?$|debug\.log$|server-status$|cgi-bin\/|(wso|c99|r57|alfa[\w-]*|shell|webshell|b374k)\.php$)/i;
9
+ export const SCANNERS = /\b(sqlmap|nikto|wpscan|nmap|masscan|zgrab|nuclei|acunetix|dirbuster|gobuster|ffuf|feroxbuster|wfuzz|whatweb|openvas|netsparker|jaeles|hydra)\b/i;
10
+ export const PROBES = /(^|\/)(\.env(\.[a-z0-9]+)?$|\.git(\/|$)|\.svn\/|\.hg\/|\.aws\/|\.ssh\/|\.ds_store$|wp-config\.php[^/]+$|wp-config\.(bak|old|txt|orig|save|swp)$|phpinfo\.php$|info\.php$|adminer[\w.-]*\.php$|eval-stdin\.php$|vendor\/phpunit\/|[\w.-]+\.sql(\.gz|\.zip)?$|debug\.log$|server-status$|cgi-bin\/|(wso|c99|r57|alfa[\w-]*|shell|webshell|b374k)\.php$)/i;
11
11
  const SP = String.raw `(\s|\/\*.*?\*\/|\+)`;
12
12
  const SQLI = [
13
13
  // "union select" followed by a column list, not by a word: "European Union Select Committee" passes.
package/dist/index.d.ts CHANGED
@@ -7,4 +7,4 @@ export { clientIp, urlDecode, type DracoRequest, type ProxyMode } from './core/r
7
7
  export { Blocks, MemoryStore, validNet, type BlockEntry, type DracoEvent, type Store } from './core/store.ts';
8
8
  export { flatten, inspect, type WafInput, type WafRule } from './core/waf.ts';
9
9
  export type { Resolver } from './core/crawler.ts';
10
- export declare const VERSION = "0.1.29";
10
+ export declare const VERSION = "0.1.31";
package/dist/index.js CHANGED
@@ -6,4 +6,4 @@ export { CLOUDFLARE, LOCAL_PROXIES, contains, inNet, isIP, network, parse } from
6
6
  export { clientIp, urlDecode } from "./core/request.js";
7
7
  export { Blocks, MemoryStore, validNet } from "./core/store.js";
8
8
  export { flatten, inspect } from "./core/waf.js";
9
- export const VERSION = '0.1.29';
9
+ export const VERSION = '0.1.31';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draco-insomnis",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "Firewall, anti-copy pace and country rules for Node.js (Express, Koa, Strapi, Directus) and Cloudflare Workers. No dependencies.",
5
5
  "license": "GPL-2.0-or-later",
6
6
  "type": "module",