Skip to content

Commit

Permalink
Merge pull request #47 from mitre/feature/export_rich_adversary
Browse files Browse the repository at this point in the history
adding details to adversary export file
  • Loading branch information
elegantmoose authored Apr 26, 2024
2 parents b039556 + d0db449 commit 9f5635d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/adversaries/DetailsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@ function exportAdversary() {
yaml += `objective: ${selectedAdversary.value.objective}\n`;
yaml += `atomic_ordering:\n`;
selectedAdversaryAbilities.value.forEach((ability) => yaml += `- ${ability.ability_id}\n`);
yaml += `abilities:\n`;
selectedAdversaryAbilities.value.forEach((ability) => {
yaml += ` ${ability.ability_id}:\n`;
yaml += ` name: ${ability.name}\n`;
yaml += ` tactic: ${ability.tactic}\n`;
yaml += ` technique_name: "${ability.technique_name}"\n`;
yaml += ` technique_id: ${ability.technique_id}\n`;
yaml += ` executors: \n`;
ability.executors.forEach((executor) => {
yaml += ` - ${executor.name}:\n`;
yaml += ` platform: ${executor.platform}\n`;
yaml += ` command: |\n ${executor.command.replaceAll("\n", "\n ")}\n`;
});
});
const blob = new Blob([yaml], { type: 'application/x-yaml' })
const url = window.URL.createObjectURL(blob);
Expand Down

0 comments on commit 9f5635d

Please sign in to comment.