@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
112 lines (108 loc) • 2.98 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/classes/sdo/technique.impl.ts
var technique_impl_exports = {};
__export(technique_impl_exports, {
TechniqueImpl: () => TechniqueImpl2
});
module.exports = __toCommonJS(technique_impl_exports);
// src/classes/common/attack-object.impl.ts
var AttackBaseImpl = class {
/**
* Sets the object that revokes the current object.
* @param obj - The object that revokes this object.
*/
setRevokedBy(obj) {
this.revokedBy = obj;
}
/**
* Returns the object that revoked this object.
*/
getRevokedBy() {
return this.revokedBy;
}
};
// src/classes/sdo/technique.impl.ts
var TechniqueImpl2 = class extends AttackBaseImpl {
constructor(technique) {
super();
this.technique = technique;
this._subTechniques = [];
this._tactics = [];
this._mitigations = [];
this._logSources = [];
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);
}
addLogSource(logSource) {
this._logSources.push(logSource);
}
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;
}
getLogSources() {
return this._logSources;
}
getParentTechnique() {
return this._parentTechnique;
}
getRelatedTechniques() {
return this._relatedTechniques;
}
getTargetAssets() {
return this._targetAssets;
}
getDetectingDataComponents() {
return this._detectingDataComponents;
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
TechniqueImpl
});