DC-084/085/089/090: Quick wins batch
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s

DC-084: Add .dockerignore (excludes __tests__/, .git/, node_modules/, coverage/)
DC-085: Replace Math.random() with crypto.randomUUID()/crypto.randomBytes() for IDs
DC-089: Add dedicated rate limiter on POST /license/activate (10 attempts/15min)
DC-090: Pin Node.js to 20.11.1-alpine3.19 + add engines field to package.json

All 1539 tests pass. ESLint: 0 errors.
This commit is contained in:
Hermes
2026-08-12 02:24:28 -07:00
parent bb20f02cbf
commit 5c02bfba1d
6 changed files with 33 additions and 11 deletions
@@ -10,6 +10,7 @@
const { execFile } = require('child_process');
const { promisify } = require('util');
const crypto = require('crypto');
const dns = require('dns');
const os = require('os');
const path = require('path');
@@ -117,7 +118,7 @@ class RFC2136Provider extends BaseDNSProvider {
*/
async _runNsupdate(commands) {
const script = commands.join('\n') + '\n';
const tmpFile = path.join(os.tmpdir(), `nsupdate-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.cmd`);
const tmpFile = path.join(os.tmpdir(), `nsupdate-${crypto.randomBytes(4).toString('hex')}.cmd`);
try {
await fs.promises.writeFile(tmpFile, script, { mode: 0o600 });
@@ -6,6 +6,7 @@
const https = require('https');
const http = require('http');
const crypto = require('crypto');
const EventEmitter = require('events');
const fs = require('fs');
const path = require('path');
@@ -349,7 +350,7 @@ class HealthChecker extends EventEmitter {
// Create new incident
const incident = {
id: `incident-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
id: `incident-${crypto.randomUUID()}`,
serviceId,
type,
message,