Skip to content

Change Tactic order on Red Team Framework Page from numerical order to rank order #5

Open

Description

@mikecommits

On the Red Team Framework page, the tactics show up in their numerical order on the grid rather than their rank order https://github.com/DISARMFoundation/DISARMframeworks/blob/main/generated_pages/disarm_red_framework.m
Screen Shot 2022-07-02 at 12 19 42 PM
Screen Shot 2022-07-02 at 12 19 28 PM
d

Activity

  1. mikecommits commented on Jul 2, 2022

    @mikecommits
    ContributorAuthor

    May also want to make that change to the Tactics page as well, though less important visually than in the DISARM Red framework grid view above
    https://github.com/DISARMFoundation/DISARMframeworks/blob/main/generated_pages/tactics_index.md

  2. mikecommits commented on Jul 6, 2022

    @mikecommits
    ContributorAuthor

    Guessing it may have something to do with modifying the code in generate_DISARM_pages.py Something like swapping out line 528
    arr[1][index] = tactic['disarm_id']
    for something like
    arr[1][index] = tactic['rank']
    Here's the full section with lines 518 to 542 for context (below).
    ` def create_padded_framework_table(self, title, ttp_col, tocsv=True):
    # Create the master grid that we make all the framework visuals from
    # cols = number of tactics
    # rows = max number of techniques per tactic + 2

        numrows = max(self.df_tactics[ttp_col].apply(len)) + 2
    
        arr = [['' for i in range(self.num_tactics)] for j in range(numrows)] 
        for index, tactic in self.df_tactics.iterrows():
            arr[0][index] = tactic['phase_id']
            arr[1][index] = tactic['disarm_id']
            if tactic[ttp_col] == '':
                continue
            for index2, technique in enumerate(tactic[ttp_col]):
                arr[index2+2][index] = technique
    
        #Save grid to file
        if tocsv:
            snakecase_title = title.replace(' ', '_')
            csvdir = GENERATED_FILES_DIR
            if not os.path.exists(csvdir):
                os.makedirs(csvdir)
            pd.DataFrame(arr).to_csv('{0}/{1}_ids.csv'.format(csvdir, snakecase_title), index=False, header=False)
    
        return(arr)`
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions