Module: ActiveAttack::PlaybooksHelper

Defined in:
app/helpers/active_attack/playbooks_helper.rb

Instance Method Summary collapse

Instance Method Details

#attack_pattern_class(phase, row) ⇒ Object



3
4
5
6
7
# File 'app/helpers/active_attack/playbooks_helper.rb', line 3

def attack_pattern_class(phase, row)
  if @playbook.attack_patterns.collect(&:name).include? @playbook.attack_pattern_matrix(phase.name, row)
    "used"
  end
end

#attack_pattern_info(phase, row) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/helpers/active_attack/playbooks_helper.rb', line 28

def attack_pattern_info(phase, row)
  attack_pattern = @playbook.attack_pattern_matrix(phase.name, row)
  if attack_pattern
    "<span  ='/attack/attack_patterns/#{attack_pattern.id}'>click me</span>"
    (:span,
        "Click",
        data: {
            action: 'click->attack-pattern#info',
            attack_pattern_url: "/attack/attack_patterns/#{attack_pattern.id}",
        }
    )
  end
end


21
22
23
24
25
26
# File 'app/helpers/active_attack/playbooks_helper.rb', line 21

def attack_pattern_link(phase, row)
  attack_pattern = @playbook.attack_pattern_matrix(phase.name, row)
  if attack_pattern
    link_to attack_pattern.name, stix.attack_pattern_path(attack_pattern)
  end
end

#attack_pattern_target(phase, row) ⇒ Object



13
14
15
16
17
18
19
# File 'app/helpers/active_attack/playbooks_helper.rb', line 13

def attack_pattern_target(phase, row)
  if @playbook.attack_patterns.collect(&:name).include? @playbook.attack_pattern_matrix(phase.name, row)
    "matrix.used"
  else
    "matrix.notused"
  end
end

#campaign_list(phase, row) ⇒ Object



9
10
11
# File 'app/helpers/active_attack/playbooks_helper.rb', line 9

def campaign_list(phase, row)
  @playbook.attack_pattern_campaign_list(phase, row)
end