Skip to content

Commit a06aa62

Browse files
committed
Exclude some releases without SBOM support
1 parent c8a17f9 commit a06aa62

File tree

2 files changed

+57
-24
lines changed

2 files changed

+57
-24
lines changed

index.html

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ <h4>Overall Summary</h4>
10951095
const data = await response.json();
10961096

10971097
// Separate releases from release branches
1098-
if (version.startsWith('release_') || version.startsWith('release/')) {
1098+
if (version.startsWith('release_') || version.startsWith('release/') || version.startsWith('master-')) {
10991099
branches[version] = data;
11001100
} else {
11011101
releases[version] = data;
@@ -1289,7 +1289,7 @@ <h4>Overall Summary</h4>
12891289

12901290
function updateBranchFilter() {
12911291
const select = document.getElementById('branchFilter');
1292-
const branches = Object.keys(dashboardData.branches || {}).sort();
1292+
const branches = Object.keys(dashboardData.branches || {}).sort().reverse();
12931293

12941294
// Clear existing options except "All Branches"
12951295
select.innerHTML = '<option value="all">All Branches</option>';
@@ -1363,6 +1363,13 @@ <h4>Overall Summary</h4>
13631363
const severity = summary.by_severity || {};
13641364
const scanDate = new Date(data.scan_date).toLocaleDateString();
13651365

1366+
// Check if this is a v5.0 version (including release branch)
1367+
const isV50 = version.startsWith('v5.0') || version.includes('release/v5.0') || version.includes('release_v5.0');
1368+
1369+
// Check if this version has no SBOM support
1370+
const unsupportedSBOMVersions = ['v5.1', 'v5.0.3', 'v5.0.2', 'v5.0.1', 'v5.0'];
1371+
const hasNoSBOMSupport = unsupportedSBOMVersions.includes(version);
1372+
13661373
const vulnSummaryHtml = [
13671374
severity.CRITICAL && `<span class="vuln-badge critical">Critical: ${severity.CRITICAL}</span>`,
13681375
severity.HIGH && `<span class="vuln-badge high">High: ${severity.HIGH}</span>`,
@@ -1399,8 +1406,12 @@ <h4>Overall Summary</h4>
13991406
</div>
14001407
</div>
14011408
<div class="vulnerability-summary">
1402-
${vulnSummaryHtml || '<span class="vuln-badge" style="background: rgba(40, 167, 69, 0.1); color: var(--success-color);">No known vulnerabilities</span>'}
1403-
${vulnerabilities.length > 0 ? `<button class="toggle-btn" onclick="toggleDetails('${version}')">Show Details</button>` : ''}
1409+
${hasNoSBOMSupport
1410+
? '<span class="vuln-badge" style="background: rgba(108, 117, 125, 0.1); color: var(--dark-gray);">No SBOM support available</span>'
1411+
: (vulnSummaryHtml || '<span class="vuln-badge" style="background: rgba(40, 167, 69, 0.1); color: var(--success-color);">No known vulnerabilities</span>')
1412+
}
1413+
${isV50 ? '<span class="vuln-badge" style="background: rgba(220, 53, 69, 0.1); color: var(--danger-color); font-size: 0.7rem;">EOL</span>' : ''}
1414+
${vulnerabilities.length > 0 && !hasNoSBOMSupport ? `<button class="toggle-btn" onclick="toggleDetails('${version}')">Show Details</button>` : ''}
14041415
</div>
14051416
<div class="vulnerability-details" id="details-${version}">
14061417
${vulnerabilityDetailsHtml}
@@ -1447,7 +1458,7 @@ <h4>Overall Summary</h4>
14471458
branches = branches.filter(([version, data]) => version === branchFilter);
14481459
}
14491460

1450-
branches.sort(([a], [b]) => a.localeCompare(b));
1461+
branches.sort(([a], [b]) => b.localeCompare(a));
14511462

14521463
const branchesHtml = branches.map(([version, data]) => {
14531464
const vulnerabilities = data.vulnerabilities || [];
@@ -1501,7 +1512,7 @@ <h4>Overall Summary</h4>
15011512

15021513
// Generate cross-reference content similar to releases
15031514
const content = document.getElementById('branchCveAnalysisContent');
1504-
const allVersions = Object.keys(dashboardData.branches || {}).sort();
1515+
const allVersions = Object.keys(dashboardData.branches || {}).sort().reverse();
15051516

15061517
if (cveMap.size === 0) {
15071518
content.innerHTML = '<p>No CVE data available for branch analysis.</p>';
@@ -1599,12 +1610,21 @@ <h5>${cveId}
15991610
// Find ESP-IDF versions where this CVE is NOT present (i.e., fixed)
16001611
const allVersions = Object.keys(dashboardData.releases).sort((a, b) => compareVersions(a, b));
16011612
const affectedVersions = cveData.affectedVersions;
1602-
const fixedInVersions = allVersions.filter(version => !affectedVersions.includes(version));
1613+
const allFixedVersions = allVersions.filter(version => !affectedVersions.includes(version));
1614+
1615+
// Only show incremental releases (newer than the latest affected version)
1616+
const latestAffectedVersion = affectedVersions.length > 0
1617+
? affectedVersions.sort((a, b) => compareVersions(b, a))[0] // Get newest affected
1618+
: null;
1619+
1620+
const fixedInVersions = latestAffectedVersion
1621+
? allFixedVersions.filter(version => compareVersions(version, latestAffectedVersion) > 0)
1622+
: allFixedVersions;
16031623

16041624
if (fixedInVersions.length === 0) {
16051625
return `
16061626
<div class="no-fix-info">
1607-
⚠️ CVE ${cveId} appears to be present in all scanned ESP-IDF releases.
1627+
⚠️ CVE ${cveId} is not fixed in any ESP-IDF release newer than the latest affected version.
16081628
Consider updating component to version: ${cveData.fixedVersions.join(', ') || 'Check component documentation'}
16091629
</div>
16101630
`;
@@ -1677,13 +1697,24 @@ <h5>${cveId}
16771697

16781698
const crossRefHtml = `
16791699
<div style="margin-bottom: 1rem; color: var(--dark-gray);">
1680-
This analysis shows which ESP-IDF releases contain each CVE and which releases have fixes.
1700+
This analysis shows which ESP-IDF releases contain each CVE and which newer releases have fixes.
1701+
Only incremental releases (newer than the latest affected version) are shown as fix targets.
16811702
Use this information to plan migrations and understand security improvements across versions.
16821703
</div>
16831704
16841705
${cveList.map(([cveId, cveData]) => {
16851706
const affectedVersions = cveData.affectedVersions.sort((a, b) => compareVersions(a, b));
1686-
const fixedVersions = allVersions.filter(v => !affectedVersions.includes(v));
1707+
const allFixedVersions = allVersions.filter(v => !affectedVersions.includes(v));
1708+
1709+
// Only show incremental releases (newer than the latest affected version)
1710+
const latestAffectedVersion = affectedVersions.length > 0
1711+
? affectedVersions.sort((a, b) => compareVersions(b, a))[0] // Get newest affected
1712+
: null;
1713+
1714+
const fixedVersions = latestAffectedVersion
1715+
? allFixedVersions.filter(version => compareVersions(version, latestAffectedVersion) > 0)
1716+
: allFixedVersions;
1717+
16871718
const severityClass = (cveData.severity || 'unknown').toLowerCase();
16881719
16891720
return `
@@ -1708,7 +1739,7 @@ <h5>${cveId}
17081739
<div style="margin-top: 0.5rem;">
17091740
${fixedVersions.length > 0
17101741
? fixedVersions.map(v => `<span class="idf-version-badge">${v}</span>`).join(' ')
1711-
: '<span style="color: var(--danger-color);">Not fixed in scanned releases</span>'
1742+
: '<span style="color: var(--danger-color);">No newer releases with fix available</span>'
17121743
}
17131744
</div>
17141745
</div>
@@ -1726,7 +1757,7 @@ <h5>${cveId}
17261757
<div style="margin-top: 2rem; padding: 1rem; background: #f8f9fa; border-radius: 4px; font-size: 0.9rem; color: var(--dark-gray);">
17271758
<strong>Legend:</strong><br>
17281759
• <span style="color: var(--danger-color);">Affected Releases</span>: ESP-IDF versions where the CVE is present<br>
1729-
• <span style="color: var(--success-color);">Fixed Releases</span>: ESP-IDF versions where the CVE has been resolved<br>
1760+
• <span style="color: var(--success-color);">Fixed Releases</span>: ESP-IDF versions newer than the latest affected version where the CVE has been resolved<br>
17301761
• Component fixes refer to the specific library version that resolves the CVE
17311762
</div>
17321763
`;

scan_releases.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@
4343
'v5.1.3': 'espressif/idf:v5.1.3',
4444
'v5.1.2': 'espressif/idf:v5.1.2',
4545
'v5.1.1': 'espressif/idf:v5.1.1',
46+
# Note: v5.1, v5.0.3, v5.0.2, v5.0.1, v5.0 excluded due to limited SBOM support
4647
'v5.0.9': 'espressif/idf:v5.0.9',
4748
'v5.0.8': 'espressif/idf:v5.0.8',
4849
'v5.0.7': 'espressif/idf:v5.0.7',
4950
'v5.0.6': 'espressif/idf:v5.0.6',
5051
'v5.0.5': 'espressif/idf:v5.0.5',
51-
'v5.0.4': 'espressif/idf:v5.0.4',
52-
'v5.0.3': 'espressif/idf:v5.0.3',
53-
'v5.0.2': 'espressif/idf:v5.0.2',
54-
'v5.0.1': 'espressif/idf:v5.0.1'
52+
'v5.0.4': 'espressif/idf:v5.0.4'
53+
# Note: v5.0.3, v5.0.2, v5.0.1, v5.0 excluded due to limited SBOM support
5554
}
5655

5756
# Default releases to scan (most recent stable versions)
@@ -65,12 +64,13 @@
6564

6665
# ESP-IDF release branches to scan
6766
ESP_IDF_RELEASE_BRANCHES = [
68-
'release/v5.0',
69-
'release/v5.1',
70-
'release/v5.2',
71-
'release/v5.3',
67+
'master',
68+
'release/v5.5',
7269
'release/v5.4',
73-
'release/v5.5'
70+
'release/v5.3',
71+
'release/v5.2',
72+
'release/v5.1',
73+
'release/v5.0'
7474
]
7575

7676
class ESPIDFSecurityScanner:
@@ -407,7 +407,7 @@ def scan_multiple_targets_with_single_clone(self, targets, repository_url="https
407407
scan_method = "git-tag"
408408
else:
409409
version_id = f"{target}-{commit_hash}" # Use branch-hash for branches
410-
scan_method = "git-branch" if not target.startswith("release/") else "git-release-branch"
410+
scan_method = "git-branch" if not target.startswith("release/") and target != "master" else "git-release-branch"
411411

412412
# Run vulnerability scan
413413
logger.info(f"Running vulnerability scan for {target}...")
@@ -782,9 +782,11 @@ def scan_all_v5_releases(self, use_unified_mode=True, prefer_git_over_docker=Fal
782782
tags, branches = self.get_available_targets(target_patterns=["v5."])
783783
release_branches = [b for b in branches if b.startswith("release/v5.")]
784784

785-
# Filter to v5.x tags only, excluding rc, dev, beta versions
785+
# Filter to v5.x tags only, excluding rc, dev, beta versions and unsupported SBOM versions
786+
unsupported_versions = ["v5.1", "v5.0.3", "v5.0.2", "v5.0.1", "v5.0"]
786787
v5_tags = [tag for tag in tags if tag.startswith("v5.") and
787-
not any(exclude in tag.lower() for exclude in ["rc", "dev", "beta"])]
788+
not any(exclude in tag.lower() for exclude in ["rc", "dev", "beta"]) and
789+
tag not in unsupported_versions]
788790

789791
logger.info(f"Found {len(v5_tags)} v5.x tags and {len(release_branches)} v5.x release branches")
790792

0 commit comments

Comments
 (0)