diff options
| author | GeorgeFI | 2023-07-19 09:59:53 +0200 |
|---|---|---|
| committer | GeorgeFI | 2023-07-19 09:59:53 +0200 |
| commit | 97250e0d936479113b4b6fda129b5331e01133f7 (patch) | |
| tree | e22133de416a6add300000f4a8bb4e758c368e9b | |
| parent | c6db9df109af140cdc8cdcb2928f0e76b2bd52ca (diff) | |
| download | sec-certs-97250e0d936479113b4b6fda129b5331e01133f7.tar.gz sec-certs-97250e0d936479113b4b6fda129b5331e01133f7.tar.zst sec-certs-97250e0d936479113b4b6fda129b5331e01133f7.zip | |
feat: EDA about CVE distribution
| -rw-r--r-- | notebooks/fips/references.ipynb | 105 |
1 files changed, 96 insertions, 9 deletions
diff --git a/notebooks/fips/references.ipynb b/notebooks/fips/references.ipynb index d54fb56f..561a1226 100644 --- a/notebooks/fips/references.ipynb +++ b/notebooks/fips/references.ipynb @@ -416,6 +416,95 @@ }, { "cell_type": "markdown", + "id": "9b1a8c67", + "metadata": {}, + "source": [ + "#### Total number of assigned CVEs across embodiments" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "id": "65e27e65", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Counter({'Multi-Chip Stand Alone': 217,\n", + " 'Multi-Chip Embedded': 2,\n", + " 'Single Chip': 1})" + ] + }, + "execution_count": 113, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cve_df: DataFrame = df[df[\"related_cves\"].notna()]\n", + "counter: Counter = Counter()\n", + "\n", + "for _, cert in cve_df.iterrows():\n", + " embodiment = cert[\"embodiment\"]\n", + " counter[embodiment] = counter[embodiment] + 1\n", + " \n", + "counter" + ] + }, + { + "cell_type": "markdown", + "id": "64ceea53", + "metadata": {}, + "source": [ + "#### Total number of assigned CVEs across levels" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "id": "05010c02", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Counter({1.0: 133, 2.0: 86, 3.0: 1})" + ] + }, + "execution_count": 114, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "counter: Counter = Counter()\n", + "\n", + "for _, cert in cve_df.iterrows():\n", + " level = cert[\"level\"]\n", + " counter[level] = counter[level] + 1\n", + " \n", + "counter" + ] + }, + { + "cell_type": "markdown", + "id": "62124355", + "metadata": {}, + "source": [ + "#### Total number of assigned CVEs across types" + ] + }, + { + "cell_type": "markdown", + "id": "a336e012", + "metadata": {}, + "source": [ + "#### Total number of assigned CVEs across status\n" + ] + }, + { + "cell_type": "markdown", "id": "480bc189", "metadata": {}, "source": [ @@ -711,7 +800,7 @@ { "cell_type": "code", "execution_count": 58, - "id": "670cc557", + "id": "6b68e012", "metadata": {}, "outputs": [ { @@ -825,7 +914,7 @@ { "cell_type": "code", "execution_count": 84, - "id": "d674de0a", + "id": "b3aa2e7e", "metadata": {}, "outputs": [], "source": [ @@ -850,7 +939,7 @@ { "cell_type": "code", "execution_count": 96, - "id": "2b0a8fa1", + "id": "0fc5988f", "metadata": {}, "outputs": [ { @@ -886,7 +975,7 @@ { "cell_type": "code", "execution_count": 95, - "id": "66576beb", + "id": "c5e978b6", "metadata": {}, "outputs": [ { @@ -921,7 +1010,7 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 105, "id": "91db647f", "metadata": { "scrolled": true @@ -940,9 +1029,7 @@ "below_level4_cert_ids = below_level3_cert_ids | cert_level_ids[3]\n", "level4_ref_certs = referencing_certs[referencing_certs[\"level\"] == LEVEL4]\n", "level4_referencing_lower_level = get_cert_ids_referencing_lower_level_cert(level4_ref_certs, below_level4_cert_ids)\n", - "\n", - "# TODO - implement the analysis and function needs to cope with empty df or something like that\n", - "print(f\"Total amount of certificates with level {compare_level} referencing at least one certificate: {level4_ref_certs.shape[0]}\")" + "print(f\"Total amount of certificates with level {LEVEL4} referencing at least one certificate: {level4_ref_certs.shape[0]}\")" ] }, { @@ -1192,7 +1279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a8b6cba", + "id": "dcb396b3", "metadata": {}, "outputs": [], "source": [] |
