From 495bf4b98f7ddd187dafa48713e7869e975d59ee Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Wed, 7 Dec 2022 16:40:27 -0500 Subject: [PATCH 1/3] Update composer.lock Point to HotelEngine/jira-security-issue fork and `no-comment` commit --- composer.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index 4d97177..367859a 100644 --- a/composer.lock +++ b/composer.lock @@ -1169,17 +1169,17 @@ "time": "2019-03-08T08:55:37+00:00" }, { - "name": "reload/jira-security-issue", + "name": "HotelEngine/jira-security-issue", "version": "v1.0.29", "source": { "type": "git", - "url": "https://github.com/reload/jira-security-issue.git", - "reference": "3fc2125956288e7dab2e9d40fbaef6de99f9352e" + "url": "https://github.com/HotelEngine/jira-security-issue.git", + "reference": "3d10a379e09f3fd42ea8ec7782adaf08aed42426" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reload/jira-security-issue/zipball/3fc2125956288e7dab2e9d40fbaef6de99f9352e", - "reference": "3fc2125956288e7dab2e9d40fbaef6de99f9352e", + "url": "https://api.github.com/repos/HotelEngine/jira-security-issue/zipball/3d10a379e09f3fd42ea8ec7782adaf08aed42426", + "reference": "3d10a379e09f3fd42ea8ec7782adaf08aed42426", "shasum": "" }, "require": { @@ -1207,8 +1207,8 @@ ], "description": "Create Jira issues if it doesn't exist", "support": { - "issues": "https://github.com/reload/jira-security-issue/issues", - "source": "https://github.com/reload/jira-security-issue/tree/v1.0.29" + "issues": "https://github.com/HotelEngine/jira-security-issue/issues", + "source": "https://github.com/HotelEngine/jira-security-issue/tree/v1.0.29" }, "time": "2022-12-05T05:14:53+00:00" }, From f61b7af816894755b8f5695dc943c2a98232ab21 Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Mon, 9 Jan 2023 15:41:06 -0500 Subject: [PATCH 2/3] Add link to GH alert page. --- src/SecurityAlertIssue.php | 15 +++++++++++++++ src/SyncCommand.php | 1 + 2 files changed, 16 insertions(+) diff --git a/src/SecurityAlertIssue.php b/src/SecurityAlertIssue.php index daed50c..e40cd91 100644 --- a/src/SecurityAlertIssue.php +++ b/src/SecurityAlertIssue.php @@ -38,6 +38,16 @@ class SecurityAlertIssue extends JiraSecurityIssue */ protected string $severity; + /** + * @var int + */ + protected int $alertNumber; + + /** + * @var string + */ + protected string $advisorySummary; + /** * phpcs:disable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint * @@ -52,6 +62,8 @@ public function __construct(array $data) $this->manifestPath = \pathinfo($data['vulnerableManifestPath'], \PATHINFO_DIRNAME); $this->id = $data['securityVulnerability']['advisory']['ghsaId']; $this->severity = $data['securityVulnerability']['severity']; + $this->alertNumber = $data['number']; + $this->advisorySummary = $data['securityVulnerability']['advisory']['summary']; $references = []; @@ -67,9 +79,12 @@ public function __construct(array $data) $ecosystem = $data['securityVulnerability']['package']['ecosystem'] ?? ''; $githubRepo = \getenv('GITHUB_REPOSITORY') ?: ''; $safeVersion = $this->safeVersion ?? 'no fix'; + $alertNumber = $this->alertNumber; + $advisorySummary = $this->advisorySummary; $body = <<package} ($ecosystem) - Vulnerable version: {$this->vulnerableVersionRange} - Secure version: {$safeVersion} diff --git a/src/SyncCommand.php b/src/SyncCommand.php index 00072d1..809658a 100644 --- a/src/SyncCommand.php +++ b/src/SyncCommand.php @@ -176,6 +176,7 @@ protected function fetchAlertData(): array vulnerableManifestFilename vulnerableManifestPath vulnerableRequirements + number } } } From 7fe44ce0a7daa4b84ae83458ef80b6a0e7c1ba37 Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Mon, 6 Feb 2023 13:21:59 -0500 Subject: [PATCH 3/3] Change issue title Issue: PLAT-1010 --- src/SecurityAlertIssue.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SecurityAlertIssue.php b/src/SecurityAlertIssue.php index e40cd91..50925b2 100644 --- a/src/SecurityAlertIssue.php +++ b/src/SecurityAlertIssue.php @@ -78,6 +78,7 @@ public function __construct(array $data) $advisory_description = \wordwrap($data['securityVulnerability']['advisory']['description'] ?? '', 100); $ecosystem = $data['securityVulnerability']['package']['ecosystem'] ?? ''; $githubRepo = \getenv('GITHUB_REPOSITORY') ?: ''; + list($repoOwner, $repoName) = explode('/', $githubRepo); $safeVersion = $this->safeVersion ?? 'no fix'; $alertNumber = $this->alertNumber; $advisorySummary = $this->advisorySummary; @@ -107,7 +108,7 @@ public function __construct(array $data) $this->setKeyLabel($githubRepo); $this->setKeyLabel($this->uniqueId()); - $this->setTitle("{$this->package} ({$safeVersion}) - {$this->severity}"); + $this->setTitle("{$repoName} | Dependabot: {$advisorySummary}"); $this->setBody($body); $labels = \getenv('JIRA_ISSUE_LABELS');