@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
85 lines (81 loc) • 1.97 kB
JavaScript
import {
AttackBaseImpl
} from "./chunk-2N7H7TEP.js";
// src/classes/sdo/technique.impl.ts
var TechniqueImpl = class extends AttackBaseImpl {
constructor(technique) {
super();
this.technique = technique;
this._subTechniques = [];
this._tactics = [];
this._mitigations = [];
this._relatedTechniques = [];
this._targetAssets = [];
this._detectingDataComponents = [];
Object.assign(this, technique);
}
setParent(parent) {
this._parentTechnique = parent;
}
addSubTechnique(subTechnique) {
this._subTechniques.push(subTechnique);
}
addTactic(tactic) {
this._tactics.push(tactic);
}
addMitigation(mitigation) {
this._mitigations.push(mitigation);
}
addRelatedTechnique(technique) {
this._relatedTechniques.push(technique);
}
addTargetAsset(asset) {
this._targetAssets.push(asset);
}
addDetectingDataComponent(dataComponent) {
this._detectingDataComponents.push(dataComponent);
}
// Getters
getSubTechniques() {
return this._subTechniques;
}
getTactics() {
return this._tactics;
}
getMitigations() {
return this._mitigations;
}
getParentTechnique() {
return this._parentTechnique;
}
getRelatedTechniques() {
return this._relatedTechniques;
}
getTargetAssets() {
return this._targetAssets;
}
getDetectingDataComponents() {
return this._detectingDataComponents;
}
};
// src/classes/sdo/data-component.impl.ts
var DataComponentImpl2 = class extends AttackBaseImpl {
constructor(dataComponent) {
super();
this.dataComponent = dataComponent;
this._detectedTechniques = [];
Object.assign(this, dataComponent);
}
// Add a technique detected by this data component
addDetectedTechnique(technique) {
this._detectedTechniques.push(technique);
}
// Getters
getDetectedTechniques() {
return this._detectedTechniques;
}
};
export {
DataComponentImpl2 as DataComponentImpl,
TechniqueImpl
};