Skip to content

Adding a table

Salvatore Manfredi edited this page Sep 19, 2024 · 1 revision

Create the Markdown file

Adding a new table to the dataset requires the creation of a new .md file within the /markdown folder. The file MUST contain a table in which all the lines start with |. The first line that does not start with | and all the following lines will be ignored.

Update the recognition rules

Mandatory

  • the new table MUST be added to the ./schema_generator/template.prisma file as a model by using the table name defined in the sheets_mapping dictionary within the ./utils/configs.py file. The GUIDELINE BLOCKS counter in the same file has to be increased by one.

Edge cases

  • if a guideline needs to propagate a requirement level horizontally, it can be done by

    1. adding a checkmark symbol () as the cell content;

    2. defining a rule within the sheet_columns dictionary in the ./utils/configs.py file. The rule MUST have the following structure:

          category_name: {
              agency: [numbers, of, columns, affected, by, the, propagation]
          },
      

      for example

          "Protocols": {
              "WILLE": [1, 2]
          },
      

      Please remember that the first column of each agency is considered as the 0-th and all the indexes for the same agency are subsequent. [^1] The 0-th column MUST contain the requirement level to be propagated.

      If a propagation cell is left empty, it is considered as a must not.

    3. (optional) if the file you added is not present in the dictionary, and you want the controls to be automated, you also need to add the entry to the configs/compliance/sheet mapping.json file in TLSAssistant.

  • if a table has more than one column that should be used as "name" (e.g., see /markdown/Key lenghts.md) or the column with the name is not the first one, the first column's index and the column count have to be defined within the different_names_pos dictionary in the ./utils/configs.py file. The rule MUST have the following structure:

        category_name: (colum index, column count)
    

    for example

        "Key lengths": (1, 2)
    
  • if a table has some columns that should be considered guideline "versions" but do not use the usual syntax (e.g., see the BSI guideline in /markdown/Cipher Suites.md), they have to be defined within the sheet_columns dictionary in the ./utils/configs.py file. The rule MUST have the following structure:

        category_name: {
            guideline:[column_index1, column_index2, column_indexN]
            },
    

    for example

        "Cipher Suites": {
            "BSI":[1, 2, 3]
            },
    
  • if the table needs a custom template to be read, you should append the template model to the ./schema_generator/template.prisma file. The template name will consist of "TableName7WJsEz", with TableName being the name of the table and "7WJsEz" being a fixed string. The GUIDELINE BLOCKS counter in ./utils/configs.py has to be increased by one.

Important

It is strongly recommended to run the prisma format --schema schema_generator/template.prisma command after editing the template.prisma file.

[^1]: N-th being the number of the column a given set of conditions is referring to, starting the count from zero. See the Cipher Suites file for an example.

Clone this wiki locally