From 3bd3ceb8a269d24f5eb7837ada59c2e5ef21f587 Mon Sep 17 00:00:00 2001 From: Hare Sudhan Date: Tue, 28 Nov 2023 11:01:37 -0500 Subject: [PATCH] Update attack_api.rb (#2624) Co-authored-by: Carrie Roberts --- atomic_red_team/attack_api.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atomic_red_team/attack_api.rb b/atomic_red_team/attack_api.rb index 16dafb25..1e92b763 100755 --- a/atomic_red_team/attack_api.rb +++ b/atomic_red_team/attack_api.rb @@ -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