From 2874ea6511416cd6bc197142266d03bcaa4a9964 Mon Sep 17 00:00:00 2001 From: Joyce Quach Date: Fri, 29 Nov 2024 10:15:56 -0500 Subject: [PATCH] Display correct Revision info per mapped CCI to NIST tag Signed-off-by: Joyce Quach --- .../checklist/ChecklistRuleInfoBody.vue | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/apps/frontend/src/components/global/checklist/ChecklistRuleInfoBody.vue b/apps/frontend/src/components/global/checklist/ChecklistRuleInfoBody.vue index 71a4c33efd..0b54b0d34a 100644 --- a/apps/frontend/src/components/global/checklist/ChecklistRuleInfoBody.vue +++ b/apps/frontend/src/components/global/checklist/ChecklistRuleInfoBody.vue @@ -27,12 +27,12 @@
References: -
- {{ item }}: {{ cciDescription(item) }} -
- NIST 800-53 Rev 5.1.1: - - {{ nistDisplay(item) || 'None' }} +
+ {{ cci }}: {{ cciDescription(cci) }} +
+ {{ title }}, version {{ version }} + + {{ nist || 'None' }}
@@ -118,17 +118,18 @@ import { import {ChecklistVuln} from '@mitre/hdf-converters'; import {Component, Prop, Vue} from 'vue-property-decorator'; import {is_control, NistControl, parse_nist} from 'inspecjs'; +import {NistReference} from '@mitre/hdf-converters/data/converters/cciListXml2json'; @Component export default class ChecklistRuleInfoBody extends Vue { @Prop({type: Object, required: true}) readonly selectedRule!: ChecklistVuln; - nistTag(cci: string): string { + nistReference(cci: string): NistReference[] { return CCI_TO_NIST[cci]; } - nistUrl(cci: string): string { - const control = [this.nistTag(cci)].map(parse_nist).filter(is_control)[0]; + nistUrl(nist: string): string { + const control = [nist].map(parse_nist).filter(is_control)[0]; const url = control.canonize({ pad_zeros: true, add_periods: false, @@ -174,10 +175,8 @@ export default class ChecklistRuleInfoBody extends Vue { return ''; } - nistDisplay(cci: string): string { - const tag = [this.nistTag(cci)].map(parse_nist).filter(is_control)[0]; - const display = tag.canonize(); - return display; + nistDisplay(reference: NistReference): string { + return reference.nist; } cciDescription(cci: string): string {