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 <[email protected]>
  • Loading branch information
jtquach1 committed Nov 29, 2024
1 parent 544bee8 commit 813ea65
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5,123 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
1 change: 0 additions & 1 deletion libs/hdf-converters/src/mappings/CciNistMappingData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const CCI_TO_NIST: Record<string, NistReference[]> = cciToNistData;
export const CCI_TO_DEFINITION: Record<string, string> = cciToDefinitionData;
export const DEFAULT_NIST_REFERENCE: Omit<NistReference, 'nist'> = {
version: '5',
creator: 'NIST',
title: 'NIST SP 800-53 Revision 5'
};

Expand Down
Loading

0 comments on commit 813ea65

Please sign in to comment.