Update attack_api.rb (#2624)
Co-authored-by: Carrie Roberts <clr2of8@gmail.com>
This commit is contained in:
@@ -76,6 +76,8 @@ class Attack
|
||||
techniques.each do |technique|
|
||||
next unless !technique['x_mitre_platforms'].nil?
|
||||
next unless technique['x_mitre_platforms'].any? { |platform| platform.downcase.sub(" ", "-") =~ only_platform }
|
||||
next unless technique.fetch('revoked', false) == false
|
||||
next unless technique.fetch('x_mitre_deprecated', false) == false
|
||||
|
||||
technique.fetch('kill_chain_phases', []).select { |phase| phase['kill_chain_name'] == 'mitre-attack' }.each do |tactic|
|
||||
techniques_by_tactic[tactic.fetch('phase_name')] << technique
|
||||
@@ -91,7 +93,7 @@ class Attack
|
||||
return @techniques unless @techniques.nil?
|
||||
|
||||
# pull out the attack pattern objects
|
||||
@techniques = attack_stix.fetch("objects").select do |item|
|
||||
@techniques = attack_stix.fetch("objects").select do |item|
|
||||
item.fetch('type') == 'attack-pattern' && item.fetch('external_references', []).select do |references|
|
||||
references['source_name'] == 'mitre-attack'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user