export function useScanner(target) {
const [findings, set] = useState([])
useEffect(() => {
// re-test after remediation
scan(target).then(set)
}, [target])
return findings
}# .github/workflows/deploy.yml
build: npm ci && npm run build
test: vitest run --coverage
scan: trivy fs --severity HIGH,CRITICAL .
ship: pm2 reload ecosystem.config.js
def audit(host, depth=3):
# map the attack surface
results = []
for route in crawl(host, depth):
if route.exposes_secrets():
results.append(route)
return sorted(results, key=risk)interface Deployment {
service: string
region: 'eu-central-1'
replicas: number
healthcheck: () => Promise<boolean>
}SELECT
client_id,
COUNT(*) AS requests,
ROUND(AVG(duration_ms), 1) AS avg_ms
FROM events
WHERE created_at >= NOW() - INTERVAL '30 days'
AND status <> 'cancelled'
GROUP BY client_id
HAVING COUNT(*) > 100
ORDER BY avg_ms DESC;
const res = await fetch('/api/contact', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
})
if (!res.ok) throw new Error('send failed')