You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: markdown/cve_data_stories/vendor_cve_trends/05_visualizations.md
+73-80Lines changed: 73 additions & 80 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ jupyter:
16
16
17
17
18
18
19
-
## Bar Chart Race: Top 10 Vendors by CVE Count (2002–2024)
19
+
## Bar Chart Race: Top 10 CVE Vendors (1996–2024)
20
20
21
-
This script generates a dynamic bar chart race showcasing the top 5 vendors by CVE count over time (2002–2024). The visualization highlights trends and shifts in vulnerability disclosures across two decades in an engaging video format.
21
+
This script generates a dynamic bar chart race showcasing the top 10 vendors by cumulative CVE count over time (1996–2024). CVE data offers critical insights into vendor-specific trends in cybersecurity vulnerabilities, highlighting shifts in the security landscape across two decades.
22
22
23
23
---
24
24
@@ -27,67 +27,64 @@ This script generates a dynamic bar chart race showcasing the top 5 vendors by C
27
27
1.**Import Necessary Libraries**:
28
28
-`pandas`: For efficient data manipulation and preprocessing.
29
29
-`bar_chart_race`: To create the bar chart race animation.
30
-
-`matplotlib`: For additional customizations like font handling and color palettes.
30
+
-`matplotlib`: For additional visual customizations, including fonts and color palettes.
31
31
32
32
2.**Load and Preprocess Data**:
33
-
- Reads a CSV file (`vendor_top_20.csv`) containing cumulative CVE counts for each vendor by year and month.
34
-
- Normalizes vendor names to ensure consistency.
35
-
- Ensures all vendors that have ever been in the top 20 are included.
33
+
- Reads a CSV file (`vendor_top_20.csv`) containing cumulative CVE counts for vendors by year and month.
34
+
- Normalizes vendor names for consistency.
35
+
- Ensures inclusion of all vendors that appeared in the top 20 during the analyzed period.
36
36
37
37
3.**Pivot and Format Data**:
38
-
-Transforms the dataset into a suitable format for visualization:
39
-
-**Rows**: Represent time (`Year`, `Month`).
40
-
-**Columns**: Represent vendors.
41
-
-**Values**: Represent cumulative CVE counts.
42
-
- Combines `Year` and `Month` into a single `Date` column (`YYYY-MM`) to create a continuous time index.
38
+
-Prepares the dataset for visualization by transforming it into a pivot table:
39
+
-**Rows**: Time (`Year`, `Month`).
40
+
-**Columns**: Vendors.
41
+
-**Values**: Cumulative CVE counts.
42
+
- Combines `Year` and `Month` into a `Date` column (`YYYY-MM`) for a continuous time index.
43
43
44
44
4.**Assign Colors**:
45
-
-**Brand Colors**: Known vendors are mapped to their official brand colors for easy recognition.
46
-
-**Fallback Colors**: Vendors without defined colors are assigned visually distinct fallback colors from a predefined color palette (`tab20`).
45
+
-**Brand Colors**: Maps vendors to their official brand colors for easy recognition.
46
+
-**Fallback Colors**: Assigns visually distinct colors to vendors without defined brand colors.
47
47
48
48
5.**Generate the Bar Chart Race**:
49
-
- Animates the top 5 vendors dynamically over time:
50
-
- Bars update their values and order based on cumulative CVE counts.
51
-
-Customizable parameters enhance readability and aesthetics.
49
+
- Animates the top 10 vendors dynamically over time:
50
+
- Bars update their positions and lengths based on cumulative CVE counts.
51
+
-Parameters enhance readability and visual storytelling.
52
52
- Saves the animation as an `.mp4` file for high-quality sharing.
53
53
54
54
---
55
55
56
56
### Key Parameters
57
57
58
-
-**Number of Bars (`n_bars`)**: Displays the top 10 vendors at any given time.
59
-
-**Dynamic Ordering (`fixed_order=False`)**: Updates the bar order dynamically based on cumulative counts.
60
-
-**Y-Axis Consistency (`fixed_max=True`)**: Maintains a consistent y-axis scale across frames for clarity.
61
-
-**Smooth Transitions (`steps_per_period=20`)**: Ensures fluid animations between time steps.
62
-
-**Frame Duration (`period_length=600`)**: Each frame lasts 600 milliseconds.
58
+
-**Top Vendors (`n_bars`)**: Displays the top 10 vendors based on cumulative CVE counts.
59
+
-**Dynamic Ordering (`fixed_order=False`)**: Updates the bar order dynamically to reflect changes in rankings.
60
+
-**Y-Axis Consistency (`fixed_max=True`)**: Maintains a consistent y-axis scale to enable meaningful visual comparisons.
61
+
-**Smooth Transitions (`steps_per_period=10`)**: Creates fluid animations between monthly time steps.
62
+
-**Frame Duration (`period_length=400`)**: Each time step lasts 400 milliseconds for optimal pacing.
63
63
64
64
---
65
65
66
66
### Customization
67
67
68
-
-**Font Compatibility**:
69
-
- Special characters in vendor names are handled gracefully for a professional appearance.
70
68
-**Visual Enhancements**:
71
-
- Larger bar labels (`bar_label_size=12`) improve readability.
72
-
- High resolution (`dpi=300`) ensures visuals are suitable for presentations, reports, and social media sharing.
73
-
-**Brand Colors**:
74
-
- Incorporates official colors for known vendors and visually distinct fallback colors for others.
69
+
- Clear labels with larger fonts (`bar_label_size=12`) improve readability.
70
+
- High resolution (`dpi=300`) ensures professional-quality visuals suitable for presentations and reports.
71
+
-**Colors**:
72
+
- Brand colors make it easy to identify key vendors.
73
+
- Fallback colors ensure distinction for all other vendors.
75
74
76
75
---
77
76
78
77
### Output
79
78
80
79
-**Video File**:
81
-
- The bar chart race is saved as `top_10_vendors_cve_trends_2002_2024.mp4`.
80
+
- The animation is saved as `top_10_vendors_cve_trends_2002_2024.mp4`, ready for sharing and embedding.
82
81
83
82
-**Insights**:
84
-
-Highlights the dynamic evolution of CVE counts by vendor.
85
-
-Visualizes trends in vulnerability disclosures over two decades, showcasing shifts in the security landscape.
83
+
-Tracks the dynamic evolution of CVE counts by vendor.
84
+
-Highlights key shifts and emerging trends in vulnerability disclosures across two decades, providing actionable insights into the cybersecurity landscape.
86
85
87
86
88
-
89
-
90
-
```python
87
+
```python jupyter={"is_executing": true}
91
88
import os
92
89
import warnings
93
90
@@ -117,10 +114,10 @@ vendor_normalization = {
117
114
"cisco": "Cisco",
118
115
"data_general": "Data General",
119
116
"debian": "Debian",
120
-
"digital": "Digital Equipment Corporation",
121
-
"eric_allman": "Eric Allman",
122
-
"fedoraproject": "Fedora Project",
123
-
"fred_n._van_kempen": "Fred N. van Kempen",
117
+
"digital": "Digital Corp",
118
+
"eric_allman": "E. Allman",
119
+
"fedoraproject": "Fedora",
120
+
"fred_n._van_kempen": "F. van Kempen",
124
121
"freebsd": "FreeBSD",
125
122
"gentoo": "Gentoo",
126
123
"gnu": "GNU",
@@ -151,25 +148,25 @@ vendor_normalization = {
151
148
"openbsd": "OpenBSD",
152
149
"opensuse": "OpenSUSE",
153
150
"oracle": "Oracle",
154
-
"paul_vixie": "Paul Vixie",
151
+
"paul_vixie": "P. Vixie",
155
152
"php": "PHP",
156
-
"process_software": "Process Software",
153
+
"process_software": "Process Soft.",
157
154
"redhat": "Red Hat",
158
-
"renaud_deraison": "Renaud Deraison",
155
+
"renaud_deraison": "R. Deraison",
159
156
"rxvt": "Rxvt",
160
157
"sap": "SAP",
161
158
"sco": "SCO",
162
159
"sendmail": "Sendmail",
163
160
"sgi": "SGI",
164
161
"slackware": "Slackware",
165
-
"sun": "Sun Microsystems",
162
+
"sun": "Sun Micro.",
166
163
"suse": "SUSE",
167
164
"symantec": "Symantec",
168
165
"tcsh": "Tcsh",
169
166
"transarc": "Transarc",
170
167
"ubuntu": "Ubuntu",
171
-
"university_of_washington": "University of Washington",
0 commit comments