// Method for adding techniques with no subtecniques public void AddMitigationInfo(Technique technique, Dictionary <string, Mitigation> MitigationInfo) { // Creating a new navigation technique object for the technique NTechnique NavigatorTechnique = new NTechnique(technique.GetID(), MitigationInfo); // Adding the technique to the list of processed techniques this.techniques.Add(NavigatorTechnique); }
public bool DoesItHaveMitigations(Technique technique) { string StixID = technique.id; // Get all the source references for the technique mitigations var TechniqueMitSourceRef = MitigationRelationships.Where(o => o.target_ref == StixID).Select(o => o.source_ref); // Get all the non-deprecated mitigations for it var TechniqueMitigations = Mitigations.Where(o => TechniqueMitSourceRef.Contains(o.id) && o.x_mitre_deprecated == false); if (TechniqueMitigations.Count() > 0) { return(true); } else { return(false); } }
// Method for adding technique with subtechniques public void AddMitigationInfo(Technique rootTechnique, List <string> subTechniqueIDs, List <Dictionary <string, Mitigation> > subTechniqueResults) { List <string> subTechniquesColors = new List <string>(); // Adding subtechniques foreach (var item in subTechniqueIDs.Zip(subTechniqueResults, Tuple.Create)) { var subTechniqueID = item.Item1; var MitigationInfo = item.Item2; NTechnique subTechnique = new NTechnique(subTechniqueID, MitigationInfo); this.techniques.Add(subTechnique); subTechniquesColors.Add(subTechnique.color); } // Adding root technique NTechnique NavigatorRootTechnique = new NTechnique(rootTechnique.GetID(), subTechniquesColors); this.techniques.Add(NavigatorRootTechnique); }
public IEnumerable <Technique> GetSubTechniquesByTechnique(Technique technique) { return(WindowsTechniques.Where(o => o.GetID().StartsWith(technique.GetID() + "."))); }