-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #461 from RedHatProductSecurity/task/OSIDB-cvss-se…
…ction-extension OSIDB-3546: CVSS Section extension
- Loading branch information
Showing
22 changed files
with
183 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,9 @@ import { useUserStore } from '@/stores/UserStore'; | |
const props = defineProps<{ | ||
bugzilla?: string; | ||
cveid?: null | string; | ||
cveId?: null | string; | ||
cvss?: string; | ||
nistcvss?: string; | ||
nistCvss?: string; | ||
summary?: null | string; | ||
}>(); | ||
|
@@ -21,20 +21,20 @@ const { closeModal, isModalOpen, openModal } = useModal(); | |
const toEmail = '[email protected]'; | ||
const ccEmail = '[email protected]'; | ||
const subject = computed(() => `CVSS Rescore Request - ${props.cveid}`); | ||
const subject = computed(() => `CVSS Rescore Request - ${props.cveId}`); | ||
const emailBody = computed(() => `Hello, | ||
I have performed an analysis of ${props.cveid} on behalf of Red Hat Product Security, | ||
I have performed an analysis of ${props.cveId} on behalf of Red Hat Product Security, | ||
resulting in a Red Hat CVSS score which is different from the NIST score. | ||
Our information and analysis is included below, | ||
and we would appreciate your consideration and review. | ||
CVE : ${props.cveid} | ||
CVE : ${props.cveId} | ||
Red Hat Bugzilla: ${props.bugzilla} | ||
NVD Page: https://nvd.nist.gov/vuln/detail/${props.cveid} | ||
NVD Page: https://nvd.nist.gov/vuln/detail/${props.cveId} | ||
Red Hat CVSS: ${props.cvss} | ||
NIST CVSS: ${props.nistcvss} | ||
NIST CVSS: ${props.nistCvss} | ||
Flaw Summary: | ||
${props.summary} | ||
|
@@ -83,7 +83,6 @@ function openMailto() { | |
</div> | ||
<hr /> | ||
</div> | ||
|
||
<LabelTextarea v-model="emailBody" label="Body:" /> | ||
</template> | ||
<template #footer> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<script setup lang="ts"> | ||
import { computed, ref } from 'vue'; | ||
import CvssNISTForm from '@/components/CvssNISTForm.vue'; | ||
import LabelDiv from '@/components/widgets/LabelDiv.vue'; | ||
import { issuerLabels } from '@/composables/useFlawCvssScores'; | ||
import type { ZodFlawCVSSType } from '@/types/zodFlaw'; | ||
import { IssuerEnum } from '@/generated-client'; | ||
const props = defineProps<{ | ||
allCvss: ZodFlawCVSSType[]; | ||
bugzilla: string; | ||
cveId: null | string; | ||
cvss: string; | ||
highlightedNvdCvss3String: { char: null | string; isHighlighted: boolean }[][]; | ||
nistCvss: string; | ||
shouldDisplayEmailNistForm: boolean; | ||
summary: string; | ||
}>(); | ||
const showAllCvss = ref(false); | ||
const otherCvss = computed(() => props.allCvss.filter(cvssItem => | ||
(!(cvssItem.cvss_version === 'V3' && (cvssItem.issuer === IssuerEnum.Rh || cvssItem.issuer === IssuerEnum.Nist))))); | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<LabelDiv label="NVD CVSSv3" class="mb-2"> | ||
<template v-if="otherCvss && otherCvss.length > 0" #labelSlot> | ||
<button | ||
class="btn btn-sm me-auto border-0" | ||
type="button" | ||
:title="(showAllCvss ? 'Hide' : 'Show') + ' all available CVSS versions and issuers'" | ||
@click="() => showAllCvss = !showAllCvss" | ||
> | ||
<i :class="showAllCvss ? 'bi bi-caret-down' : 'bi bi-caret-right'" style="font-size: 2.25ch;" /> | ||
</button> | ||
</template> | ||
<div class="d-flex flex-row"> | ||
<div class="form-control text-break h-auto" :class="shouldDisplayEmailNistForm ? 'rounded-0' : ''"> | ||
<template v-if="cvss"> | ||
<template v-for="(chars, index) in highlightedNvdCvss3String" :key="index"> | ||
<span v-if="chars[0].isHighlighted" class="text-primary"> | ||
{{ chars.map(c => c.char).join('') }} | ||
</span> | ||
<template v-else>{{ chars.map(c => c.char).join('') }}</template> | ||
</template> | ||
</template> | ||
<template v-else> | ||
<span> | ||
{{ nistCvss }} | ||
</span> | ||
</template> | ||
</div> | ||
<div v-if="shouldDisplayEmailNistForm" class="col-auto align-self-center"> | ||
<CvssNISTForm | ||
:cveId | ||
:summary | ||
:bugzilla | ||
:cvss | ||
:nistCvss | ||
/> | ||
</div> | ||
</div> | ||
</LabelDiv> | ||
<div v-if="showAllCvss" class="bg-secondary p-2 ps-1 ms-1 mb-2 rounded"> | ||
<template | ||
v-for="(cvssItem, cvssItemIndex) in otherCvss" | ||
:key="cvssItemIndex.uuid" | ||
> | ||
<LabelDiv | ||
:label="issuerLabels[cvssItem.issuer] + ' CVSS' + cvssItem.cvss_version.toLocaleLowerCase()" | ||
:class="cvssItemIndex < otherCvss.length -1 ? 'mb-2' : ''" | ||
> | ||
<div class="d-flex flex-row"> | ||
<div class="form-control text-break h-auto"> | ||
<span> | ||
{{ cvssItem.score + ' CVSS:' + cvssItem.cvss_version.substring(1) + '/' + cvssItem.vector }} | ||
</span> | ||
</div> | ||
</div> | ||
</LabelDiv> | ||
</template> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.