ieeeColors = ({
navy: "#2C3E50",
teal: "#16A085",
orange: "#E67E22",
gray: "#7F8C8D",
lightGray: "#ECF0F1",
darkGray: "#34495E",
green: "#27AE60",
red: "#E74C3C",
purple: "#9B59B6",
blue: "#3498DB",
yellow: "#F1C40F"
})
// Provisioning Methods for Analysis
provisioningMethods = [
{
id: "ztp",
name: "Zero-Touch Provisioning (ZTP)",
shortName: "ZTP",
standards: ["RFC 8572", "SZTP", "Cisco ZTP"],
steps: [
{ id: 1, name: "Factory Configuration", secure: true, attackSurface: "Supply chain compromise", credentials: ["Bootstrap Certificate", "Vendor Root CA"] },
{ id: 2, name: "Device Powers On", secure: true, attackSurface: "Physical tampering", credentials: [] },
{ id: 3, name: "DHCP/DNS Discovery", secure: false, attackSurface: "DNS spoofing, DHCP hijacking", credentials: [] },
{ id: 4, name: "TLS Connection", secure: true, attackSurface: "Certificate validation bypass", credentials: ["Bootstrap Certificate", "Server Certificate"] },
{ id: 5, name: "Device Authentication", secure: true, attackSurface: "Credential theft", credentials: ["Device Serial", "Bootstrap Certificate"] },
{ id: 6, name: "Configuration Download", secure: true, attackSurface: "Configuration injection", credentials: ["Operational Certificate", "Cloud Credentials", "Config File"] },
{ id: 7, name: "Cloud Registration", secure: true, attackSurface: "Registration hijacking", credentials: ["Operational Certificate", "Device Token"] },
{ id: 8, name: "Activation Complete", secure: true, attackSurface: "Session hijacking", credentials: ["Session Keys"] }
]
},
{
id: "qrcode",
name: "QR Code / App-based",
shortName: "QR/App",
standards: ["Matter", "HomeKit", "SmartThings"],
steps: [
{ id: 1, name: "Device Setup Mode", secure: true, attackSurface: "Unauthorized pairing window", credentials: [] },
{ id: 2, name: "QR Code Scan", secure: true, attackSurface: "QR code cloning", credentials: ["Setup Code", "Device ID", "Vendor ID"] },
{ id: 3, name: "BLE/Wi-Fi Discovery", secure: false, attackSurface: "Nearby attacker interception", credentials: ["Discriminator"] },
{ id: 4, name: "PASE Session", secure: true, attackSurface: "Brute force (mitigated by code entropy)", credentials: ["Setup Code", "PASE Keys"] },
{ id: 5, name: "Network Credentials", secure: true, attackSurface: "Credential extraction from app", credentials: ["Wi-Fi SSID/Password", "Thread Network Key"] },
{ id: 6, name: "Operational Certificate", secure: true, attackSurface: "Certificate injection", credentials: ["Node Operational Certificate", "Fabric Credentials"] },
{ id: 7, name: "Cloud Registration", secure: true, attackSurface: "Account takeover", credentials: ["Device ID", "User Token"] },
{ id: 8, name: "Setup Complete", secure: true, attackSurface: "None (secured)", credentials: ["Session Keys"] }
]
},
{
id: "x509",
name: "Certificate-based (X.509)",
shortName: "X.509",
standards: ["X.509", "IEEE 802.1AR", "IDevID"],
steps: [
{ id: 1, name: "Certificate Embedding", secure: true, attackSurface: "Manufacturing compromise", credentials: ["Device Certificate", "Private Key", "CA Chain"] },
{ id: 2, name: "Device Powers On", secure: true, attackSurface: "Secure element extraction", credentials: ["Device Certificate"] },
{ id: 3, name: "DNS Resolution", secure: false, attackSurface: "DNS hijacking", credentials: [] },
{ id: 4, name: "TLS Client Hello", secure: true, attackSurface: "Downgrade attack", credentials: ["Device Certificate"] },
{ id: 5, name: "Server Certificate", secure: true, attackSurface: "Rogue server", credentials: ["Server Certificate", "Root CA"] },
{ id: 6, name: "Client Certificate Validation", secure: true, attackSurface: "Revocation check bypass", credentials: ["Device Certificate", "Manufacturer CA", "CRL/OCSP"] },
{ id: 7, name: "mTLS Established", secure: true, attackSurface: "Side-channel attacks", credentials: ["Session Keys", "ECDHE Parameters"] },
{ id: 8, name: "Device Registration", secure: true, attackSurface: "Authorization bypass", credentials: ["Device Token", "Config"] }
]
},
{
id: "psk",
name: "Token-based (Pre-shared Keys)",
shortName: "PSK",
standards: ["TLS-PSK", "DTLS-PSK", "CoAP"],
steps: [
{ id: 1, name: "Key Generation", secure: true, attackSurface: "Admin account compromise", credentials: ["Device ID", "Pre-shared Key"] },
{ id: 2, name: "Key Programming", secure: false, attackSurface: "Key exposure during transfer", credentials: ["Device ID", "Pre-shared Key"] },
{ id: 3, name: "Device Powers On", secure: true, attackSurface: "Key extraction from device", credentials: ["Device ID", "Pre-shared Key"] },
{ id: 4, name: "Connect to Cloud", secure: false, attackSurface: "Endpoint spoofing", credentials: [] },
{ id: 5, name: "PSK Authentication", secure: true, attackSurface: "Offline brute force", credentials: ["Device ID", "Pre-shared Key"] },
{ id: 6, name: "Session Established", secure: true, attackSurface: "Key reuse across sessions", credentials: ["Session Keys"] }
]
},
{
id: "manufacturer",
name: "Manufacturer Certificate",
shortName: "Mfr Cert",
standards: ["AWS IoT", "Azure IoT Hub", "Google Cloud IoT"],
steps: [
{ id: 1, name: "CA Registration", secure: true, attackSurface: "CA private key compromise", credentials: ["Manufacturer CA Certificate", "Verification Certificate"] },
{ id: 2, name: "Device Manufacturing", secure: true, attackSurface: "Manufacturing security", credentials: ["Device Certificate", "Private Key"] },
{ id: 3, name: "Device Provisioning Record", secure: true, attackSurface: "Data tampering", credentials: ["Device Inventory", "Certificate Fingerprints"] },
{ id: 4, name: "Device First Boot", secure: true, attackSurface: "Physical tampering", credentials: ["Device Certificate"] },
{ id: 5, name: "TLS Connection", secure: true, attackSurface: "Certificate validation", credentials: ["Device Certificate", "Cloud Certificate"] },
{ id: 6, name: "Certificate Chain Validation", secure: true, attackSurface: "Revocation bypass", credentials: ["Certificate Chain", "CRL"] },
{ id: 7, name: "Auto-Registration", secure: true, attackSurface: "Policy misconfiguration", credentials: ["Device Identity", "IoT Policies"] },
{ id: 8, name: "Operational", secure: true, attackSurface: "None", credentials: ["Session Credentials"] }
]
},
{
id: "jitp",
name: "Just-in-Time Provisioning (JITP)",
shortName: "JITP",
standards: ["AWS IoT JITP", "Azure DPS", "Cloud-native IoT"],
steps: [
{ id: 1, name: "Template Configuration", secure: true, attackSurface: "Template injection", credentials: ["Template ID", "Policy Templates"] },
{ id: 2, name: "CA Registration", secure: true, attackSurface: "Unauthorized CA registration", credentials: ["CA Certificate"] },
{ id: 3, name: "Device First Connection", secure: true, attackSurface: "Certificate theft", credentials: ["Device Certificate"] },
{ id: 4, name: "Certificate Validation", secure: true, attackSurface: "Validation bypass", credentials: ["Certificate Chain"] },
{ id: 5, name: "JITP Trigger", secure: true, attackSurface: "Resource exhaustion", credentials: ["Certificate CN/Subject"] },
{ id: 6, name: "Template Execution", secure: true, attackSurface: "Privilege escalation", credentials: ["Thing Name", "Policy ARN"] },
{ id: 7, name: "Registration Complete", secure: true, attackSurface: "Overprivileged access", credentials: ["Device Token", "MQTT Topics"] },
{ id: 8, name: "Operational", secure: true, attackSurface: "None", credentials: ["Session Credentials"] }
]
}
]
// Method selector
selectedMethodId = Inputs.select(
provisioningMethods.map(m => m.id),
{
label: "Select Provisioning Method",
format: id => provisioningMethods.find(m => m.id === id).name,
value: "ztp"
}
)
selectedMethod = provisioningMethods.find(m => m.id === selectedMethodId)
// Step selector
currentStepInput = Inputs.range([1, selectedMethod.steps.length], {
label: "Analyze Step",
value: 1,
step: 1
})
currentStep = currentStepInput - 1
// Security Analysis Panel
securityAnalysisPanel = {
const method = selectedMethod;
const step = method.steps[currentStep];
return html`
<div style="
background: linear-gradient(135deg, ${ieeeColors.lightGray}, white);
border: 1px solid ${ieeeColors.gray};
border-radius: 12px;
padding: 20px;
margin-top: 20px;
">
<h3 style="margin: 0 0 15px 0; color: ${ieeeColors.navy}; font-size: 16px;">
Security Analysis: ${method.shortName} - Step ${currentStep + 1}
</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;">
<!-- Attack Surface -->
<div style="
background: white;
border-radius: 8px;
padding: 15px;
border-left: 4px solid ${ieeeColors.orange};
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 8px;">
Attack Surface
</div>
<div style="font-size: 13px; color: ${ieeeColors.darkGray};">
${step.attackSurface}
</div>
</div>
<!-- Trust Anchors -->
<div style="
background: white;
border-radius: 8px;
padding: 15px;
border-left: 4px solid ${ieeeColors.teal};
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 8px;">
Required Trust Anchors
</div>
<div style="font-size: 13px; color: ${ieeeColors.darkGray};">
${getTrustAnchors(method.id, currentStep)}
</div>
</div>
<!-- Channel Security -->
<div style="
background: white;
border-radius: 8px;
padding: 15px;
border-left: 4px solid ${step.secure ? ieeeColors.green : ieeeColors.red};
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 8px;">
Channel Security
</div>
<div style="font-size: 13px; color: ${ieeeColors.darkGray};">
${step.secure ? "Encrypted/Authenticated" : "Unprotected - Requires additional security measures"}
</div>
</div>
<!-- Credentials in Transit -->
<div style="
background: white;
border-radius: 8px;
padding: 15px;
border-left: 4px solid ${ieeeColors.purple};
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 8px;">
Credentials Exchanged
</div>
<div style="font-size: 13px; color: ${ieeeColors.darkGray};">
${step.credentials.length > 0 ? step.credentials.join(", ") : "None"}
</div>
</div>
</div>
<!-- Revocation & Key Rotation -->
<div style="margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
<div style="
background: white;
border-radius: 8px;
padding: 15px;
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 8px;">
Revocation Handling
</div>
<div style="font-size: 12px; color: ${ieeeColors.darkGray};">
${getRevocationInfo(method.id)}
</div>
</div>
<div style="
background: white;
border-radius: 8px;
padding: 15px;
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 8px;">
Key Rotation Implications
</div>
<div style="font-size: 12px; color: ${ieeeColors.darkGray};">
${getKeyRotationInfo(method.id)}
</div>
</div>
</div>
<!-- Compliance Mapping -->
<div style="
margin-top: 15px;
background: white;
border-radius: 8px;
padding: 15px;
">
<div style="font-weight: 600; color: ${ieeeColors.navy}; margin-bottom: 10px;">
Compliance & Standards Mapping
</div>
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
${method.standards.map(std => html`
<span style="
background: ${ieeeColors.navy};
color: white;
padding: 4px 10px;
border-radius: 15px;
font-size: 11px;
font-weight: 500;
">${std}</span>
`)}
${getComplianceStandards(method.id).map(std => html`
<span style="
background: ${ieeeColors.teal};
color: white;
padding: 4px 10px;
border-radius: 15px;
font-size: 11px;
font-weight: 500;
">${std}</span>
`)}
</div>
</div>
</div>
`;
function getTrustAnchors(methodId, step) {
const anchors = {
ztp: ["Manufacturer Root CA", "Provisioning Server Certificate", "DHCP/DNS Infrastructure"],
qrcode: ["Setup Code (Physical)", "App Store Certificate", "Cloud Platform Root CA"],
x509: ["Manufacturer CA Certificate", "Cloud Platform Root CA", "CRL/OCSP Responder"],
psk: ["Pre-shared Key (Symmetric)", "Cloud Platform Identity", "Admin Trust"],
manufacturer: ["Manufacturer CA Certificate", "Cloud Platform Root CA", "Device Secure Element"],
jitp: ["Registered CA Certificate", "Provisioning Template", "Cloud Platform IAM"]
};
return anchors[methodId]?.[Math.min(step, anchors[methodId].length - 1)] || "Platform-specific";
}
function getRevocationInfo(methodId) {
const info = {
ztp: "CRL distribution points configured during provisioning. OCSP stapling supported for real-time validation.",
qrcode: "Device can be removed from fabric via app. Certificate revocation handled by fabric administrator.",
x509: "Standard X.509 CRL/OCSP. Devices must periodically check revocation status. Short-lived certificates preferred.",
psk: "Key revocation requires device re-provisioning. No automated revocation mechanism.",
manufacturer: "Manufacturer maintains CRL. Cloud platform caches revocation data. Batch revocation supported.",
jitp: "Cloud platform maintains device registry. Certificates can be deactivated immediately in IoT Core."
};
return info[methodId] || "Method-specific revocation";
}
function getKeyRotationInfo(methodId) {
const info = {
ztp: "Operational certificates rotated on schedule. Bootstrap credentials remain static. Requires secure re-provisioning for root key updates.",
qrcode: "NOC rotation handled by fabric. Setup codes are one-time use. Re-commissioning required for major updates.",
x509: "Certificate rotation via EST or CMP protocols. Device must maintain connectivity for renewal. Grace period for expiring certificates.",
psk: "Manual key rotation required. Coordinated update across device and cloud. High operational overhead.",
manufacturer: "Manufacturer issues new certificates. Fleet-wide rotation challenging. Consider certificate pinning implications.",
jitp: "Template-based automatic rotation possible. Device initiates rotation using existing credentials."
};
return info[methodId] || "Consult vendor documentation";
}
function getComplianceStandards(methodId) {
const compliance = {
ztp: ["NIST SP 800-183", "IEC 62443"],
qrcode: ["Matter 1.0", "Thread 1.3", "HomeKit"],
x509: ["IEEE 802.1AR", "IEC 62443-4-2", "FIPS 140-2"],
psk: ["RFC 4279", "CoAP Security"],
manufacturer: ["AWS IoT Core", "Azure IoT DPS", "ETSI EN 303 645"],
jitp: ["AWS Well-Architected", "Cloud Security Alliance"]
};
return compliance[methodId] || [];
}
}