05ed037fe8
- DNS: pilot.landvex.com -> 16.170.83.169 - TLS: Let's Encrypt certificate (expires 2026-09-30) - Nginx: reverse proxy with SSL termination - API: https://pilot.landvex.com/api/v1/missions - UI: https://pilot.landvex.com/ - Upload: POST /api/v1/missions/import (multipart/form-data) Verified: ✅ https://pilot.landvex.com/health ✅ https://pilot.landvex.com/version ✅ https://pilot.landvex.com/api/v1/missions (list) ✅ https://pilot.landvex.com/api/v1/missions/:id (get) ✅ POST /api/v1/missions/import (video upload) ✅ UI loads with title 'LandveX Intelligence Lab' Next: Pilot 001 — Break the system!
64 lines
2.6 KiB
JavaScript
64 lines
2.6 KiB
JavaScript
#!/usr/bin/env node
|
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
// Vertical Slice: Otillåtna infra-förändringar blockeras (S-005) v2
|
|
// Med Policy Registry och Runtime Trace v2
|
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
|
|
import { AgentRuntimeV3 } from './agent-runtime-v3.mjs';
|
|
|
|
/**
|
|
* EOS Policy för infrastruktur med Policy Registry-integration
|
|
*/
|
|
function checkInfrastructurePolicy(task) {
|
|
const isInfrastructure = task.type === 'infrastructure' ||
|
|
task.description?.toLowerCase().includes('skapa') ||
|
|
task.description?.toLowerCase().includes('ändra') ||
|
|
task.description?.toLowerCase().includes('konfigurera');
|
|
|
|
const isProduction = task.target === 'production' ||
|
|
task.description?.toLowerCase().includes('produktion') ||
|
|
task.description?.toLowerCase().includes('aws-konsolen');
|
|
|
|
const isChange = task.action !== 'inventory' &&
|
|
task.action !== 'plan' &&
|
|
task.action !== 'validate' &&
|
|
task.action !== 'fmt' &&
|
|
task.action !== 'diff' &&
|
|
task.action !== 'read' &&
|
|
task.action !== 'health-check' &&
|
|
task.action !== 'log-analysis';
|
|
|
|
const hasApprovedProcess = task.terraform !== undefined ||
|
|
task.iac === true ||
|
|
task.approved === true ||
|
|
task.pipeline !== undefined;
|
|
|
|
if (isInfrastructure && isProduction && isChange && !hasApprovedProcess) {
|
|
return {
|
|
passed: false,
|
|
policyId: 'POL-INFRA-001',
|
|
rule: 'no-unapproved-infra-change',
|
|
reason: 'Förändring av produktionsinfrastruktur kräver godkänd Infrastructure-as-Code-process enligt EOS Policy POL-INFRA-001',
|
|
severity: 'CRITICAL',
|
|
action: 'STOP',
|
|
evidence: {
|
|
type: task.type,
|
|
target: task.target,
|
|
action: task.action,
|
|
hasApprovedProcess
|
|
}
|
|
};
|
|
}
|
|
|
|
return { passed: true };
|
|
}
|
|
|
|
class AgentRuntimeInfraSliceV2 extends AgentRuntimeV3 {
|
|
constructor(task) {
|
|
super(task);
|
|
this.policies = [checkInfrastructurePolicy];
|
|
}
|
|
}
|
|
|
|
export { AgentRuntimeInfraSliceV2, checkInfrastructurePolicy };
|