@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
75 lines (71 loc) • 1.61 kB
JavaScript
import {
AttackBaseImpl
} from "./chunk-2N7H7TEP.js";
// src/classes/sdo/campaign.impl.ts
var CampaignImpl = class extends AttackBaseImpl {
constructor(campaign) {
super();
this.campaign = campaign;
this._techniques = [];
this._software = [];
Object.assign(this, campaign);
}
// Add a technique used by the campaign
addTechnique(technique) {
this._techniques.push(technique);
}
// Add software used by the campaign
addSoftware(software) {
this._software.push(software);
}
// Set the group this campaign is attributed to
setAttributedTo(group) {
this._attributedTo = group;
}
// Getters
getTechniques() {
return this._techniques;
}
getSoftware() {
return this._software;
}
getAttributedTo() {
return this._attributedTo;
}
};
// src/classes/sdo/group.impl.ts
var GroupImpl2 = class extends AttackBaseImpl {
constructor(group) {
super();
this.group = group;
this._techniques = [];
this._software = [];
this._attributedCampaigns = [];
Object.assign(this, group);
}
// Add a technique used by the group
addTechnique(technique) {
this._techniques.push(technique);
}
// Add software used by the group
addSoftware(software) {
this._software.push(software);
}
addAttributedCampaign(campaign) {
this._attributedCampaigns.push(campaign);
}
// Getters
getTechniques() {
return this._techniques;
}
getSoftware() {
return this._software;
}
getAttributedCampaigns() {
return this._attributedCampaigns;
}
};
export {
GroupImpl2 as GroupImpl,
CampaignImpl
};