From 802fb625d75a26a203b9c55709b12dad3d879193 Mon Sep 17 00:00:00 2001 From: Alicia Sykes <=> Date: Sun, 26 Dec 2021 22:56:11 +0000 Subject: [PATCH 1/5] :sparkles: Adds widget for monitoring CVE vulnerabilities --- docs/widgets.md | 39 +++ src/components/Widgets/CveVulnerabilities.vue | 236 ++++++++++++++++ src/components/Widgets/WidgetBase.vue | 8 + src/styles/color-palette.scss | 255 +++++++++--------- src/utils/MiscHelpers.js | 5 + src/utils/defaults.js | 1 + 6 files changed, 417 insertions(+), 127 deletions(-) create mode 100644 src/components/Widgets/CveVulnerabilities.vue diff --git a/docs/widgets.md b/docs/widgets.md index 4dc3ccef..14d0db67 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -12,6 +12,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [RSS Feed](#rss-feed) - [XKCD Comics](#xkcd-comics) - [Code Stats](#code-stats) + - [Vulnerability Feed](#vulnerability-feed) - [Public Holidays](#public-holidays) - [TFL Status](#tfl-status) - [Exchange Rates](#exchange-rates) @@ -277,6 +278,44 @@ Display your coding summary. [Code::Stats](https://codestats.net/) is a free and --- +### Vulnerability Feed + +Display a feed of recent vulnerabilities, with optional filtering by score, exploits, vendor and product. All fields are optional. + +
+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`sortBy`** | `string` | _Optional_ | The sorting method. Can be either `publish-date`, `last-update` or `cve-code`. Defaults to `publish-date` +**`limit`** | `number` | _Optional_ | The number of results to fetch. Can be between `5` and `30`, defaults to `10` +**`minScore`** | `number` | _Optional_ | If set, will only display results with a CVE score higher than the number specified. Can be a number between `0` and `9.9`. By default, vulnerabilities of all CVE scores are shown +**`hasExploit`** | `boolean` | _Optional_ | If set to `true`, will only show results with active exploits. Defaults to `false` +**`vendorId`** | `number` | _Optional_ | Only show results from a specific vendor, specified by ID. See [Vendor Search](https://www.cvedetails.com/vendor-search.php) for list of vendors. E.g. `23` (Debian), `26` (Microsoft), `23682` (CloudFlare) +**`productId`** | `number` | _Optional_ | Only show results from a specific app or product, specified by ID. See [Product Search](https://www.cvedetails.com/product-search.php) for list of products. E.g. `13534` (Docker), `15913` (NextCloud), `19294` (Portainer), `17908` (ProtonMail) + + +##### Example + +```yaml +- type: cve-vulnerabilities +``` + +or + +```yaml +- type: cve-vulnerabilities + options: + sortBy: publish-date + productId: 28125 + hasExploit: true + minScore: 5 + limit: 30 +``` + +--- + ### Public Holidays Counting down to the next day off work? This widget displays upcoming public holidays for your country. Data is fetched from [Enrico](http://kayaposoft.com/enrico/) diff --git a/src/components/Widgets/CveVulnerabilities.vue b/src/components/Widgets/CveVulnerabilities.vue new file mode 100644 index 00000000..80f48dd8 --- /dev/null +++ b/src/components/Widgets/CveVulnerabilities.vue @@ -0,0 +1,236 @@ + +{{ cve.score }}
+{{ cve.id }}
+ {{ cve.publishDate | formatDate }} + Last Updated: {{ cve.updateDate | formatDate }} + + {{ cve.numExploits | formatExploitCount }} + ++ {{ cve.description | formatDescription }} + + Keep Reading + +
+{{ copyright }}
{{ truncatedDescription }}
diff --git a/src/components/Widgets/CryptoWatchList.vue b/src/components/Widgets/CryptoWatchList.vue index 115f42bf..0f11f232 100644 --- a/src/components/Widgets/CryptoWatchList.vue +++ b/src/components/Widgets/CryptoWatchList.vue @@ -7,7 +7,7 @@ class="asset-wrapper" v-tooltip="tooltip(asset.info)" > - +{{ asset.name }}
{{ asset.price | formatPrice }}
diff --git a/src/components/Widgets/GitHubProfile.vue b/src/components/Widgets/GitHubProfile.vue
index 4f7de097..8f24aa34 100644
--- a/src/components/Widgets/GitHubProfile.vue
+++ b/src/components/Widgets/GitHubProfile.vue
@@ -1,9 +1,9 @@
{{ repo.name }} {{ article.description }}
{{ ipAddr }}
{{ ispName }}
{{ location }} diff --git a/src/components/Widgets/RssFeed.vue b/src/components/Widgets/RssFeed.vue index 06fc3e75..12359eb7 100644 --- a/src/components/Widgets/RssFeed.vue +++ b/src/components/Widgets/RssFeed.vue @@ -2,7 +2,7 @@