Skip to content

Commit

Permalink
adds documentation to script
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Dec 4, 2020
1 parent 5b438b0 commit c0db334
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10044,11 +10044,16 @@ export const subtechniquesOptions: MitreSubtechniquesOptions[] = [
},
];

/**
* A full object of Mitre Attack Threat data that is taken directly from the `mitre_tactics_techniques.ts` file
*
* Is built alongside and sampled from the data in the file so to always be valid with the most up to date MITRE ATT&CK data
*/
export const mockThreatData = {
tactic: {
name: 'Privilege Escalation',
id: 'TA0009',
reference: 'https://attack.mitre.org/tactics/TA0009',
id: 'TA0004',
reference: 'https://attack.mitre.org/tactics/TA0004',
},
technique: {
name: 'Event Triggered Execution',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const buildMockThreatData = (tactics, techniques, subtechniques) => {
const subtechnique = subtechniques[0];
const technique = techniques.find((technique) => technique.id === subtechnique.techniqueId);
const tactic = tactics.find(
(tactic) => (tactic.name = startCase(camelCase(subtechnique.tactics[0])))
(tactic) => tactic.name === startCase(camelCase(technique.tactics[0]))
);

return {
Expand Down Expand Up @@ -190,6 +190,11 @@ async function main() {
.replace(/}"/g, '}')
.replace(/"{/g, '{')};
/**
* A full object of Mitre Attack Threat data that is taken directly from the \`mitre_tactics_techniques.ts\` file
*
* Is built alongside and sampled from the data in the file so to always be valid with the most up to date MITRE ATT&CK data
*/
export const mockThreatData = ${JSON.stringify(
buildMockThreatData(tactics, techniques, subtechniques),
null,
Expand Down

0 comments on commit c0db334

Please sign in to comment.