将 JSON 数据渲染到 Flask UI vs Django UI?
Render JSON data to Flask UI vs Django UI?
我的要求是找出通过 Flask 或 Django(最简单的方法)将数据呈现到 Web UI 的最简单方法,因为我认为我已经有了示例 JSON 对象。关于如何做到这一点的任何建议以及 Flask 与 Django 之间的 best/easy 是什么?
谢谢!
您可能需要美化 table。
const data = {
"modules": {
"Boundary Defense (#12, Foundational)": [
["2.8", "Ensure that 'Web application firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.waf'", "18.2 Deploy And Configure Web Application Firewalls", "1", "On", "No"],
["2.9", "Ensure that 'Next generation firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.ngfw'", "9.1 Limit Open Ports, Protocols, and Services", "1", "On", "Yes"],
["2.10", "Ensure that 'Vulnerability assessment' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] |select(.name==\"default\")'|jq '.properties.recommendations.vulnerabilityAssessment'", "4.1 Weekly Automated Vulnerability Scanning", "1", "On", "No"],
["2.11", "Ensure that 'Storage Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.storageEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.12", "Ensure that 'JIT Network Access' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.jitNetworkAccess'", "12 Boundary Defense", "1", "On", "Yes"],
["2.13", "Ensure that 'Adaptive Application Controls' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.appWhitelisting'", "2.2 Deploy Application Whitelisting", "1", "On", "Yes"],
["2.14", "Ensure that 'SQL auditing & Threat detection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlAuditing'", "2.2 Deploy Application Whitelisting", "1", "On", "No"],
["2.15", "Ensure that 'SQL Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlTde'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.16", "Ensure that 'Security contact emails' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.securityContactEmails'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.17", "Ensure that security contact 'Phone number' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.securityContactPhone'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.18", "Ensure that 'Send me emails about alerts' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.areNotificationsOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.19", "Ensure that 'Send email also to subscription owners' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type: application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.sendToAdminOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.8", "Ensure ASC Default policy setteng \"Monitor Web Application Firewall\" is not \"Disabled\"", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.webApplicationFirewallMonitoringEffect.value'", "Boundary Defense", "1", "Empty", "No"],
["2.9", " Ensure ASC Default policy setting \"Monitor Web Application Firewall\" is not \"Disabled\"", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.nextGenerationFirewallMonitoringEffect.value'", "11 Secure Configuration for Network Devices, such as Firewalls, Routers and Switches", "1", "Empty", "No"],
["2.2", "Ensure that 'Automatic provisioning of monitoring agent' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type: application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.logCollection'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.3", "Ensure that 'System updates' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.patch'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.4", "Ensure that 'Security Configurations' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.baseline'", "3.1 Establish Standard Secure Configurations For OS And Software", "1", "On", "Yes"],
["2.5", "Ensure that 'Endpoint protection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.antimalware'", "8.1 Deploy Automated Endpoint Protection Tools", "1", "On", "Yes"],
["2.6", "Ensure that 'Disk encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.diskEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "Yes"],
["2.7", "Ensure that 'Network security groups' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.nsgs'", "12 Boundary Defense", "1", "On", "No"]
],
"Limitation and Control of Network Ports, Protocols and Services (#9, Foundational))": [
[]
],
"Administrative_Privileges": [
["1.9", "Ensure that 'Users can consent to apps accessing company data on their behalf' is set to 'No' (Manual)", "", "", "2", ""],
["1.15", "Ensure that 'Restrict access to Azure AD administration portal' isset to 'Yes' (Manual)", "", "", "1", ""],
["1.6", "Ensure that 'Restrict user ability to access groups features in the Access Pane' is set to 'No' (Manual)", "", "", "2", ""],
["1.22", "Ensure Security Defaults is enabled on Azure Active Directory (Automated)", "", "", "1", ""]
],
"Malware Defenses (#8, Foundational)": [
["2.2", "Ensure that 'Automatic provisioning of monitoring agent' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type: application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.logCollection'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.3", "Ensure that 'System updates' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.patch'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.4", "Ensure that 'Security Configurations' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.baseline'", "3.1 Establish Standard Secure Configurations For OS And Software", "1", "On", "Yes"],
["2.5", "Ensure that 'Endpoint protection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.antimalware'", "8.1 Deploy Automated Endpoint Protection Tools", "1", "On", "Yes"],
["2.6", "Ensure that 'Disk encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.diskEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "Yes"],
["2.7", "Ensure that 'Network security groups' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.nsgs'", "12 Boundary Defense", "1", "On", "No"],
["2.8", "Ensure that 'Web application firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.waf'", "18.2 Deploy And Configure Web Application Firewalls", "1", "Yes", "No"],
["2.9", "Ensure that 'Next generation firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.ngfw'", "9.1 Limit Open Ports, Protocols, and Services", "1", "On", "Yes"],
["2.10", "Ensure that 'Vulnerability assessment' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.vulnerabilityAssessment'", "4.1 Weekly Automated Vulnerability Scanning", "1", "On", "No"],
["2.11", "Ensure that 'Storage Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.storageEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.12", "Ensure that 'JIT Network Access' is set to 'On' (Scored))", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.jitNetworkAccess'", "12 Boundary Defense", "1", "On", "Yes"],
["2.13", "Ensure that 'Adaptive Application Controls' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.appWhitelisting'", "2.2 Deploy Application Whitelisting", "1", "On", "Yes"],
["2.14", "Ensure that 'SQL auditing & Threat detection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlAuditing'", "18.7 Use Standard Database Hardening Templates", "1", "On", "No"],
["2.15", "Ensure that 'SQL Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlTde'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.16", "Ensure that 'Security contact emails' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'| jq '.properties.securityContactConfiguration.securityContactEmails'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.17", "Ensure that security contact 'Phone number' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.securityContactPhone'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.18", "Ensure that 'Send me emails about alerts' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] |select(.name==\"default\")'|jq '.properties.securityContactConfiguration.areNotificationsOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.19", "Ensure that 'Send email also to subscription owners' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.sendToAdminOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.4", "Ensure ASC Default policy setting 'Monitor OS Vulnerabilities' is not 'Disabled'", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.systemConfigurationsMonitoringEffect.value'", "3.1 Run Automated Vulnerability Scanning Tools", "1", "Empty", "No"],
["2.5", "Ensure ASC Default policy setting 'Monitor Endpoint Protection' is not 'Disabled'", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.endpointProtectionMonitoringEffect.value'", "Malware Defenses", "1", "Empty", "No"],
["2.6", "Ensure ASC Default policy setting 'Monitor Disk Encryption' is not 'Disabled'", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.diskEncryptionMonitoringEffect.value'", "14.8 Encrypt Sensitive Information at Rest", "1", "Empty", "No"],
["2.7", "Ensure ASC Default policy setting \"Monitor Network Security Groups\" is not \"Disabled\" ", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.networkSecurityGroupsMonitoringEffect.value'", "12 Boundary Defense", "1", "Empty", "No"]
]
}
}
const generateTblHeader = (data) => {
if (!data || data.length === 0 || data[0].length === 0) {
return "<thead><tr><th>no data</th></tr></thead>";
}
return "<thead><tr><th nowrap>" + data[0].map((_, i) => {
return `Title${i + 1}`
}).join("</th><th nowrap>") + "</th></tr></thead>";
}
const generateTblBody = (data) => {
if (!data || data.length === 0 || data[0].length === 0) {
return "";
}
return "<tbody>" + data.map(d => {
return "<tr><td>" + d.join("</td><td>") + "</td></tr>";
}).join("") + "</tbody>";
}
// remove ${generateTblHeader(data)} if you do not want header
const generateTblHTML = (data) => {
return `<table cellpadding=5 cellspacing=0 border=1>
${generateTblHeader(data)}
${generateTblBody(data)}
</table>`;
}
const generateHTML = (title, data) => {
return `
<div class="title">${title}</div>
${generateTblHTML(data)}
`;
}
document.getElementById("display").innerHTML = Object.entries(data.modules).map(([key, value]) => {
return generateHTML(key, value);
}).join("");
.title {
margin-top: 4px;
font-size: 1.25rem;
}
table {
margin-top: 4px;
margin-bottom: 12px;
border: 1px dotted #333;
}
tr {
font-size: 0.875rem;
font-weight: 500;
}
<div id="display"></div>
我的要求是找出通过 Flask 或 Django(最简单的方法)将数据呈现到 Web UI 的最简单方法,因为我认为我已经有了示例 JSON 对象。关于如何做到这一点的任何建议以及 Flask 与 Django 之间的 best/easy 是什么? 谢谢!
您可能需要美化 table。
const data = {
"modules": {
"Boundary Defense (#12, Foundational)": [
["2.8", "Ensure that 'Web application firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.waf'", "18.2 Deploy And Configure Web Application Firewalls", "1", "On", "No"],
["2.9", "Ensure that 'Next generation firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.ngfw'", "9.1 Limit Open Ports, Protocols, and Services", "1", "On", "Yes"],
["2.10", "Ensure that 'Vulnerability assessment' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] |select(.name==\"default\")'|jq '.properties.recommendations.vulnerabilityAssessment'", "4.1 Weekly Automated Vulnerability Scanning", "1", "On", "No"],
["2.11", "Ensure that 'Storage Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.storageEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.12", "Ensure that 'JIT Network Access' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.jitNetworkAccess'", "12 Boundary Defense", "1", "On", "Yes"],
["2.13", "Ensure that 'Adaptive Application Controls' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.appWhitelisting'", "2.2 Deploy Application Whitelisting", "1", "On", "Yes"],
["2.14", "Ensure that 'SQL auditing & Threat detection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlAuditing'", "2.2 Deploy Application Whitelisting", "1", "On", "No"],
["2.15", "Ensure that 'SQL Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlTde'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.16", "Ensure that 'Security contact emails' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.securityContactEmails'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.17", "Ensure that security contact 'Phone number' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.securityContactPhone'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.18", "Ensure that 'Send me emails about alerts' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.areNotificationsOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.19", "Ensure that 'Send email also to subscription owners' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type: application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.sendToAdminOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.8", "Ensure ASC Default policy setteng \"Monitor Web Application Firewall\" is not \"Disabled\"", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.webApplicationFirewallMonitoringEffect.value'", "Boundary Defense", "1", "Empty", "No"],
["2.9", " Ensure ASC Default policy setting \"Monitor Web Application Firewall\" is not \"Disabled\"", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.nextGenerationFirewallMonitoringEffect.value'", "11 Secure Configuration for Network Devices, such as Firewalls, Routers and Switches", "1", "Empty", "No"],
["2.2", "Ensure that 'Automatic provisioning of monitoring agent' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type: application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.logCollection'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.3", "Ensure that 'System updates' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.patch'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.4", "Ensure that 'Security Configurations' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.baseline'", "3.1 Establish Standard Secure Configurations For OS And Software", "1", "On", "Yes"],
["2.5", "Ensure that 'Endpoint protection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.antimalware'", "8.1 Deploy Automated Endpoint Protection Tools", "1", "On", "Yes"],
["2.6", "Ensure that 'Disk encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.diskEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "Yes"],
["2.7", "Ensure that 'Network security groups' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.nsgs'", "12 Boundary Defense", "1", "On", "No"]
],
"Limitation and Control of Network Ports, Protocols and Services (#9, Foundational))": [
[]
],
"Administrative_Privileges": [
["1.9", "Ensure that 'Users can consent to apps accessing company data on their behalf' is set to 'No' (Manual)", "", "", "2", ""],
["1.15", "Ensure that 'Restrict access to Azure AD administration portal' isset to 'Yes' (Manual)", "", "", "1", ""],
["1.6", "Ensure that 'Restrict user ability to access groups features in the Access Pane' is set to 'No' (Manual)", "", "", "2", ""],
["1.22", "Ensure Security Defaults is enabled on Azure Active Directory (Automated)", "", "", "1", ""]
],
"Malware Defenses (#8, Foundational)": [
["2.2", "Ensure that 'Automatic provisioning of monitoring agent' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type: application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.logCollection'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.3", "Ensure that 'System updates' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.patch'", "4.3 Vulnerability Scanning In Authenticated Mode", "1", "On", "Yes"],
["2.4", "Ensure that 'Security Configurations' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.baseline'", "3.1 Establish Standard Secure Configurations For OS And Software", "1", "On", "Yes"],
["2.5", "Ensure that 'Endpoint protection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.antimalware'", "8.1 Deploy Automated Endpoint Protection Tools", "1", "On", "Yes"],
["2.6", "Ensure that 'Disk encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.diskEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "Yes"],
["2.7", "Ensure that 'Network security groups' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.nsgs'", "12 Boundary Defense", "1", "On", "No"],
["2.8", "Ensure that 'Web application firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.waf'", "18.2 Deploy And Configure Web Application Firewalls", "1", "Yes", "No"],
["2.9", "Ensure that 'Next generation firewall' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.ngfw'", "9.1 Limit Open Ports, Protocols, and Services", "1", "On", "Yes"],
["2.10", "Ensure that 'Vulnerability assessment' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.vulnerabilityAssessment'", "4.1 Weekly Automated Vulnerability Scanning", "1", "On", "No"],
["2.11", "Ensure that 'Storage Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.storageEncryption'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.12", "Ensure that 'JIT Network Access' is set to 'On' (Scored))", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.jitNetworkAccess'", "12 Boundary Defense", "1", "On", "Yes"],
["2.13", "Ensure that 'Adaptive Application Controls' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.appWhitelisting'", "2.2 Deploy Application Whitelisting", "1", "On", "Yes"],
["2.14", "Ensure that 'SQL auditing & Threat detection' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlAuditing'", "18.7 Use Standard Database Hardening Templates", "1", "On", "No"],
["2.15", "Ensure that 'SQL Encryption' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.recommendations.sqlTde'", "14.5 Encrypt At Rest Sensitive Information", "1", "On", "No"],
["2.16", "Ensure that 'Security contact emails' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'| jq '.properties.securityContactConfiguration.securityContactEmails'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.17", "Ensure that security contact 'Phone number' is set (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.securityContactPhone'", "19 Incident Response and Management", "1", "Empty", "No"],
["2.18", "Ensure that 'Send me emails about alerts' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] |select(.name==\"default\")'|jq '.properties.securityContactConfiguration.areNotificationsOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.19", "Ensure that 'Send email also to subscription owners' is set to 'On' (Scored)", "az account get-access-token --query \"{subscripton:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/microsoft.Security/policies?api-version=2015-06-01-preview' | jq '.|.value[] | select(.name==\"default\")'|jq '.properties.securityContactConfiguration.sendToAdminOn'", "19 Incident Response and Management", "1", "true", "No"],
["2.4", "Ensure ASC Default policy setting 'Monitor OS Vulnerabilities' is not 'Disabled'", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.systemConfigurationsMonitoringEffect.value'", "3.1 Run Automated Vulnerability Scanning Tools", "1", "Empty", "No"],
["2.5", "Ensure ASC Default policy setting 'Monitor Endpoint Protection' is not 'Disabled'", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.endpointProtectionMonitoringEffect.value'", "Malware Defenses", "1", "Empty", "No"],
["2.6", "Ensure ASC Default policy setting 'Monitor Disk Encryption' is not 'Disabled'", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.diskEncryptionMonitoringEffect.value'", "14.8 Encrypt Sensitive Information at Rest", "1", "Empty", "No"],
["2.7", "Ensure ASC Default policy setting \"Monitor Network Security Groups\" is not \"Disabled\" ", "az account get-access-token --query \"{subscription:subscription,accessToken:accessToken}\" --out tsv | xargs -L1 bash -c 'curl -X GET -H \"Authorization: Bearer \" -H \"Content-Type:application/json\" https://management.azure.com/subscriptions/[=10=]/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn?api-version=2018-05-01' | jq 'select(.name==\"SecurityCenterBuiltIn\")'|jq '.properties.parameters.networkSecurityGroupsMonitoringEffect.value'", "12 Boundary Defense", "1", "Empty", "No"]
]
}
}
const generateTblHeader = (data) => {
if (!data || data.length === 0 || data[0].length === 0) {
return "<thead><tr><th>no data</th></tr></thead>";
}
return "<thead><tr><th nowrap>" + data[0].map((_, i) => {
return `Title${i + 1}`
}).join("</th><th nowrap>") + "</th></tr></thead>";
}
const generateTblBody = (data) => {
if (!data || data.length === 0 || data[0].length === 0) {
return "";
}
return "<tbody>" + data.map(d => {
return "<tr><td>" + d.join("</td><td>") + "</td></tr>";
}).join("") + "</tbody>";
}
// remove ${generateTblHeader(data)} if you do not want header
const generateTblHTML = (data) => {
return `<table cellpadding=5 cellspacing=0 border=1>
${generateTblHeader(data)}
${generateTblBody(data)}
</table>`;
}
const generateHTML = (title, data) => {
return `
<div class="title">${title}</div>
${generateTblHTML(data)}
`;
}
document.getElementById("display").innerHTML = Object.entries(data.modules).map(([key, value]) => {
return generateHTML(key, value);
}).join("");
.title {
margin-top: 4px;
font-size: 1.25rem;
}
table {
margin-top: 4px;
margin-bottom: 12px;
border: 1px dotted #333;
}
tr {
font-size: 0.875rem;
font-weight: 500;
}
<div id="display"></div>