Skip to content

Commit

Permalink
Remove creator key from NistReference
Browse files Browse the repository at this point in the history
Signed-off-by: Joyce Quach <jquach@mitre.org>
  • Loading branch information
jtquach1 committed Nov 29, 2024
1 parent 544bee8 commit 814bc66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5,122 deletions.
41 changes: 21 additions & 20 deletions libs/hdf-converters/data/converters/cciListXml2json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ export interface ICCIList {
}

export type NistReference = {
version: string;
creator: string;
title: string;
nist: string;
version: string;
};

// Check that we're not doing `npm test`; it will look for the arguments to the input and output files.
Expand Down Expand Up @@ -130,24 +129,26 @@ function produceConversions(cciList: ICCIList): {
/* There's 1 out of the 2000+ CCI controls where this index string is composed of at
least 2 comma-and-space-separated controls found in the latest revision. */
const {version, creator, index, title} = newestReference.$;
const nistIds = index
.split(/,\s*/)
.map(parse_nist)
.filter(is_control)
.map((n) => n.canonize());

_.set(
nists,
cciId,
nistIds.map((nist) => ({version, creator, title, nist}))
);
_.set(definitions, cciId, cciItem.definition[0]);

for (const nistId of nistIds) {
if (ccis[nistId] === undefined) {
ccis[nistId] = [cciId];
} else {
ccis[nistId].push(cciId);
if (creator === 'NIST') {
const nistIds = index
.split(/,\s*/)
.map(parse_nist)
.filter(is_control)
.map((n) => n.canonize());

_.set(
nists,
cciId,
nistIds.map((nist) => ({version, title, nist}))
);
_.set(definitions, cciId, cciItem.definition[0]);

for (const nistId of nistIds) {
if (ccis[nistId] === undefined) {
ccis[nistId] = [cciId];
} else {
ccis[nistId].push(cciId);
}
}
}
} else {
Expand Down
Loading

0 comments on commit 814bc66

Please sign in to comment.