atomic_red_team/atomic_red_team.rb
#
# Returns a Markdown formatted Github link to a technique. This will be to the edit page for 
# techniques that already have one or more Atomic Red Team tests, or the create page for
# techniques that have no existing tests for the given OS.
#
Returns a Markdown formatted Github link to a technique. This will be to the edit page for
techniques that already have one or more Atomic Red Team tests, or the create page for
techniques that have no existing tests for the given OS.
Returns a Markdown formatted Github link to a technique . This will be to the edit page for techniques that already have one or more Atomic Red Team tests or the create page for techniques that have no existing tests for the given OS .
def github_link_to_technique(technique, include_identifier: false, only_platform: self.only_platform)
    technique_identifier = ATTACK_API.technique_identifier_for_technique(technique).upcase
    link_display = "#{"#{technique_identifier.upcase} " if include_identifier}#{technique['name']}"
    yaml_file = "#{ATOMICS_DIRECTORY}/#{technique_identifier}/#{technique_identifier}.yaml"
    markdown_file = "#{ATOMICS_DIRECTORY}/#{technique_identifier}/#{technique_identifier}.md"
    if atomic_yaml_has_test_for_platform(yaml_file, only_platform) && (File.exists? markdown_file)
      "[#{link_display}](../../#{technique_identifier}/#{technique_identifier}.md)"
    else
      "#{link_display} [CONTRIBUTE A TEST](https://atomicredteam.io/contributing)"
    end
  end
def github_link_to_technique ( technique , include_identifier : false , only_platform : self . only_platform ) technique_identifier = ATTACK_API . technique_identifier_for_technique ( technique ) . upcase link_display = "#{"#{technique_identifier.upcase} " if include_identifier}#{technique['name']}" yaml_file = "#{ATOMICS_DIRECTORY}/#{technique_identifier}/#{technique_identifier}.yaml" markdown_file = "#{ATOMICS_DIRECTORY}/#{technique_identifier}/#{technique_identifier}.md" if atomic_yaml_has_test_for_platform ( yaml_file , only_platform ) && ( File . exists? markdown_file ) "[#{link_display}](../../#{technique_identifier}/#{technique_identifier}.md)" else "#{link_display} [CONTRIBUTE A TEST](https://atomicredteam.io/contributing)" end end
Returns a Markdown formatted Github link to a technique.
Returns a Markdown formatted Github link to a technique .
# we have a file for this technique, so link to it's Markdown file # we don't have a file for this technique, or there are not tests for the given platform, so link to an edit page
technique
include_identifier
only_platform