Skip to content

Commit

Permalink
feat: add support for ATT&CK v15.0 and v15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecarenzo authored Aug 22, 2024
1 parent fd88298 commit 931899b
Show file tree
Hide file tree
Showing 6 changed files with 6,413 additions and 15 deletions.
17 changes: 9 additions & 8 deletions src/mappings_editor/attack/download_sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ const BASE_URL = "https://raw.githubusercontent.com/mitre-attack/attack-stix-dat
* Enterprise Sources
*/
const ENTERPRISE_SOURCES = [
"14.1", "14.0", "13.1", "13.0",
"12.1", "12.0", "11.2", "11.1",
"11.0", "10.1", "10.0", "9.0",
"8.2", "8.1", "8.0"
"15.1", "15.0", "14.1", "14.0",
"13.1", "13.0", "12.1", "12.0",
"11.2", "11.1", "11.0", "10.1",
"10.0", "9.0", "8.2", "8.1",
"8.0"
].map(version => ({
url : `${BASE_URL}/enterprise-attack/enterprise-attack-${ version }.json`,
frameworkId : "mitre_attack_enterprise",
Expand All @@ -22,8 +23,8 @@ const ENTERPRISE_SOURCES = [
* ICS Sources
*/
const ICS_SOURCES = [
"14.1", "14.0", "13.1", "13.0",
"12.1", "12.0", "11.3", "11.2",
"14.1", "14.0", "13.1", "13.0",
"12.1", "12.0", "11.3", "11.2",
"11.1", "11.0", "10.1", "10.0",
"9.0", "8.2", "8.1", "8.0"
].map(version => ({
Expand All @@ -36,7 +37,7 @@ const ICS_SOURCES = [
* Mobile Sources
*/
const MOBILE_SOURCES = [
"14.1", "14.0", "13.1", "13.0",
"14.1", "14.0", "13.1", "13.0",
"12.1", "12.0", "11.3", "10.1",
"10.0", "9.0", "8.2", "8.1",
"8.0"
Expand All @@ -52,7 +53,7 @@ const MOBILE_SOURCES = [
const STIX_SOURCES = [
...ENTERPRISE_SOURCES,
...ICS_SOURCES,
...MOBILE_SOURCES
...MOBILE_SOURCES
]

/**
Expand Down
12 changes: 6 additions & 6 deletions src/mappings_editor/attack/update_supported_frameworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const FRAMEWORKS_DIR_PATH = "frameworks";
/**
* The framework manifest file.
*/
const MANIFEST_FILE = "../src/assets/configuration/app.framework.manifest.json"
const MANIFEST_FILE = "./src/assets/configuration/app.framework.manifest.json"


/**
Expand Down Expand Up @@ -40,17 +40,17 @@ function filterAttackObjects(objects) {
* @param {string} path
* The framework directory's path.
* @param {...string} sources
* A list of STIX sources specified by name, version, and url.
* A list of STIX sources specified by name, version, and url.
*/
async function updateApplicationFrameworks(path, ...sources) {

// Collect ATT&CK Data
let downloads = [];
for(let source of sources) {
downloads.push(fetchAttackData(source.url));
}
let listings = await Promise.all(downloads);

// Generate Framework Listings
console.log("→ Generating Framework Listing Files...");
let manifest = {
Expand All @@ -61,7 +61,7 @@ async function updateApplicationFrameworks(path, ...sources) {
let source = sources[i];
let filename = `${source.frameworkId}_${source.frameworkVersion}.json`
let filepath = resolve(__dirname,`../public/${ path }/${ filename }`);

// Generate Framework File
writeFileSync(filepath, JSON.stringify({
frameworkId: source.frameworkId,
Expand All @@ -73,7 +73,7 @@ async function updateApplicationFrameworks(path, ...sources) {
}, null, 4));

// Update Manifest
manifest.files.push({
manifest.files.push({
frameworkId: source.frameworkId,
frameworkVersion: source.frameworkVersion,
filename
Expand Down
3 changes: 2 additions & 1 deletion src/mappings_editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"update-frameworks": "node ./attack/update_supported_frameworks.js"
},
"dependencies": {
"exceljs": "^4.4.0",
Expand Down
Loading

0 comments on commit 931899b

Please sign in to comment.