aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeorgeFI2023-07-18 15:37:40 +0200
committerGeorgeFI2023-07-18 15:37:40 +0200
commit19ff7a3f55ab8e512fde8ecbf34bf5477ad87a8c (patch)
tree1c99049d2ac05e8ac6cde478e3a135a306a5af9e
parent0c3692de126d47bcfff840e3a3315d41ecfe5f08 (diff)
downloadsec-certs-19ff7a3f55ab8e512fde8ecbf34bf5477ad87a8c.tar.gz
sec-certs-19ff7a3f55ab8e512fde8ecbf34bf5477ad87a8c.tar.zst
sec-certs-19ff7a3f55ab8e512fde8ecbf34bf5477ad87a8c.zip
feat: added algorithm for potential vulnerable active certs
-rw-r--r--notebooks/fips/references.ipynb98
1 files changed, 83 insertions, 15 deletions
diff --git a/notebooks/fips/references.ipynb b/notebooks/fips/references.ipynb
index e82c0da3..b646a874 100644
--- a/notebooks/fips/references.ipynb
+++ b/notebooks/fips/references.ipynb
@@ -12,7 +12,7 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 62,
"id": "91a0cb1b",
"metadata": {},
"outputs": [],
@@ -41,21 +41,21 @@
"plt.rcParams[\"xtick.labelsize\"] = 8\n",
"plt.rcParams[\"ytick.labelsize\"] = 8\n",
"plt.rcParams[\"ytick.left\"] = True\n",
- "plt.rcParams['ytick.major.size'] = 5\n",
- "plt.rcParams['ytick.major.width'] = 0.5\n",
- "plt.rcParams['ytick.major.pad'] = 0\n",
+ "plt.rcParams[\"ytick.major.size\"] = 5\n",
+ "plt.rcParams[\"ytick.major.width\"] = 0.5\n",
+ "plt.rcParams[\"ytick.major.pad\"] = 0\n",
"plt.rcParams[\"xtick.bottom\"] = True\n",
- "plt.rcParams['xtick.major.size'] = 5\n",
- "plt.rcParams['xtick.major.width'] = 0.5\n",
- "plt.rcParams['xtick.major.pad'] = 0\n",
+ "plt.rcParams[\"xtick.major.size\"] = 5\n",
+ "plt.rcParams[\"xtick.major.width\"] = 0.5\n",
+ "plt.rcParams[\"xtick.major.pad\"] = 0\n",
"# plt.rcParams[\"pgf.texsystem\"] = \"pdflatex\"\n",
"plt.rcParams[\"font.family\"] = \"serif\"\n",
"# plt.rcParams[\"text.usetex\"] = True\n",
"# plt.rcParams[\"pgf.rcfonts\"] = False\n",
"plt.rcParams[\"axes.titlesize\"] = 8\n",
"plt.rcParams[\"legend.handletextpad\"] = 0.3\n",
- "plt.rcParams['lines.markersize'] = 4\n",
- "plt.rcParams['savefig.pad_inches'] = 0.01\n",
+ "plt.rcParams[\"lines.markersize\"] = 4\n",
+ "plt.rcParams[\"savefig.pad_inches\"] = 0.01\n",
"sns.set_palette(\"deep\")"
]
},
@@ -416,7 +416,7 @@
},
{
"cell_type": "markdown",
- "id": "75389a01",
+ "id": "480bc189",
"metadata": {},
"source": [
"### Statistics how many certificates reference certificate with at least one vulnerability"
@@ -425,7 +425,7 @@
{
"cell_type": "code",
"execution_count": 54,
- "id": "2ed6f483",
+ "id": "678835dd",
"metadata": {
"scrolled": false
},
@@ -447,7 +447,7 @@
},
{
"cell_type": "markdown",
- "id": "a47c45f0",
+ "id": "15968ee7",
"metadata": {},
"source": [
"#### The certificate with at least one CVE assigned and maximum of references from other certs"
@@ -456,7 +456,7 @@
{
"cell_type": "code",
"execution_count": 58,
- "id": "52b43ae4",
+ "id": "3c17e838",
"metadata": {
"scrolled": false
},
@@ -478,7 +478,7 @@
{
"cell_type": "code",
"execution_count": 61,
- "id": "4f07fcfc",
+ "id": "6ca75914",
"metadata": {},
"outputs": [
{
@@ -747,6 +747,74 @@
},
{
"cell_type": "markdown",
+ "id": "39dcecd1",
+ "metadata": {},
+ "source": [
+ "#### Active certificate referencing at least one historical certificate with assigned CVE"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 93,
+ "id": "f3402d08",
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[(3939, 3860)]"
+ ]
+ },
+ "execution_count": 93,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "active_cert_referencing_historical_with_cves: list[tuple[int, int]] = []\n",
+ "\n",
+ "\n",
+ "for _, cert in refs_df[refs_df[\"cert_id\"].isin(active_certs_referencing_historical)].iterrows():\n",
+ " cert_id = cert[\"cert_id\"]\n",
+ " \n",
+ " for referenced_cert_id in cert[\"module_directly_referencing\"]:\n",
+ " referenced_cert_id_int = int(referenced_cert_id)\n",
+ " related_cves = get_cert_property(df, referenced_cert_id_int, \"related_cves\")\n",
+ " \n",
+ " if not pd.isna(related_cves):\n",
+ " active_cert_referencing_historical_with_cves.append((cert_id, referenced_cert_id_int))\n",
+ " \n",
+ "\n",
+ "active_cert_referencing_historical_with_cves"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 78,
+ "id": "2a66a006",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "dgst\n",
+ "86d3ce8c4f7dcd36 {CVE-2003-0370, CVE-2004-0902, CVE-2001-0128, ...\n",
+ "Name: related_cves, dtype: object"
+ ]
+ },
+ "execution_count": 78,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df[df[\"cert_id\"] == 3860][\"related_cves\"]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
"id": "d343e55b",
"metadata": {},
"source": [
@@ -1145,7 +1213,7 @@
},
{
"cell_type": "markdown",
- "id": "61c519aa",
+ "id": "d3ed0d7c",
"metadata": {},
"source": []
}