diff --git a/atomic_red_team/attack_api.rb b/atomic_red_team/attack_api.rb index 16dafb25d2..1e92b7638a 100755 --- a/atomic_red_team/attack_api.rb +++ b/atomic_red_team/attack_api.rb @@ -76,6 +76,8 @@ def techniques_by_tactic(only_platform: /.*/) 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 @@ def techniques 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