From c6ca0aa65a02254f5dfe20dbf255046fb818b2f9 Mon Sep 17 00:00:00 2001 From: Jon Gadsden Date: Sun, 22 Sep 2024 09:05:32 +0100 Subject: [PATCH] add new checkbox to show element attributes in reports --- README.md | 14 ++-- td.vue/src/i18n/ar.js | 1 + td.vue/src/i18n/de.js | 1 + td.vue/src/i18n/el.js | 1 + td.vue/src/i18n/en.js | 1 + td.vue/src/i18n/es.js | 1 + td.vue/src/i18n/fi.js | 1 + td.vue/src/i18n/fr.js | 1 + td.vue/src/i18n/hi.js | 1 + td.vue/src/i18n/id.js | 1 + td.vue/src/i18n/ja.js | 1 + td.vue/src/i18n/ms.js | 1 + td.vue/src/i18n/pt.js | 1 + td.vue/src/i18n/ru.js | 1 + td.vue/src/i18n/uk.js | 1 + td.vue/src/i18n/zh.js | 1 + td.vue/src/views/ReportModel.vue | 11 +++ td.vue/tests/unit/service/otm/OTMtoTD.spec.js | 80 +++++++++---------- 18 files changed, 73 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 3bb50c38c..72b06b5b2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ width="200" alt="Threat Dragon Logo"/>

+[![GitHub license](https://img.shields.io/github/license/owasp/threat-dragon.svg)](license.txt) [![Build status](https://github.com/OWASP/threat-dragon/actions/workflows/push.yaml/badge.svg?event=push)][build] [![GitHub release](https://img.shields.io/github/release/owasp/threat-dragon.svg)](https://github.com/owasp/threat-dragon/releases/latest) [![OWASP Lab](https://img.shields.io/badge/owasp-lab%20project-f7b73c.svg)](https://www.owasp.org/projects) @@ -10,16 +11,13 @@ # OWASP Threat Dragon -[OWASP](https://www.owasp.org) Threat Dragon is a free, open-source, cross-platform threat modeling application. +[OWASP][owasp] [Threat Dragon][project] is a free, open-source, cross-platform threat modeling application. It is used to draw threat modeling diagrams and to list threats for elements in the diagram. [Mike Goodwin](https://github.com/mike-goodwin) created Threat Dragon as an open source community project that provides an intuitive and accessible way to model threats. Threat Dragon is designed to be accessible for various types of teams, with an emphasis on flexibility and simplicity. -It is an [OWASP Lab Project](https://owasp.org/www-project-threat-dragon/) -and follows the values and principles of the [threat modeling manifesto][manifesto]. - -[![GitHub license](https://img.shields.io/github/license/owasp/threat-dragon.svg)](license.txt) +It is an [OWASP Lab Project][project] and follows the values and principles of the [threat modeling manifesto][manifesto]. This program is free software: you can redistribute it and/or modify it under the terms of the [Apache 2.0 License][license]. @@ -150,8 +148,7 @@ Using http port 8080 and accessing Threat Dragon on `http://localhost:8080/`. Pull requests, feature requests, bug reports and feedback of any kind are very welcome, please refer to the page for [contributors](contributing.md). -There are some [developer notes](https://owasp.org/www-project-threat-dragon/docs-2/local-development/) -to help get started with this project. +There are some [developer notes][notes] to help get started with this project. We are trying to keep the test coverage relatively high so include tests in your pull requests. The easiest way to get in contact with the Threat Dragon community is via the OWASP Slack @@ -179,4 +176,7 @@ Threat Dragon: _making threat modeling less threatening_ [gitlab]: https://owasp.org/www-project-threat-dragon/docs-2/gitlab-repo/ [license]: https://github.com/OWASP/threat-dragon/blob/v2.2.0/license.txt [manifesto]: https://www.threatmodelingmanifesto.org/ +[notes]: https://owasp.org/www-project-threat-dragon/docs-2/local-development/ +[owasp]: https://www.owasp.org +[project]: https://owasp.org/www-project-threat-dragon [releases]: https://github.com/OWASP/threat-dragon/releases diff --git a/td.vue/src/i18n/ar.js b/td.vue/src/i18n/ar.js index 5bc0229b9..fcedf4922 100644 --- a/td.vue/src/i18n/ar.js +++ b/td.vue/src/i18n/ar.js @@ -353,6 +353,7 @@ const ara = { showMitigatedThreats: 'إظهار التهديدات المُخففة', showModelDiagrams: 'إظهار الرسوم التوضيحية للنموذج', showEmpty: 'إظهار العناصر الفارغة', + showAttributes: 'Show element attributes', showBranding: 'شعار تهديد التنين' }, title: 'تقرير نموذج التهديد لـ', diff --git a/td.vue/src/i18n/de.js b/td.vue/src/i18n/de.js index 524b99bec..ef9c3d3c6 100644 --- a/td.vue/src/i18n/de.js +++ b/td.vue/src/i18n/de.js @@ -351,6 +351,7 @@ const deu = { showMitigatedThreats: 'Abgeschwächte Bedrohungen anzeigen', showModelDiagrams: 'Modell Diagramme anzeigen', showEmpty: 'Leere Elemente anzeigen', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragon Logo' }, title: 'Bedrohungsmodell Bereicht für', diff --git a/td.vue/src/i18n/el.js b/td.vue/src/i18n/el.js index 636fcd9aa..64ba0206f 100644 --- a/td.vue/src/i18n/el.js +++ b/td.vue/src/i18n/el.js @@ -351,6 +351,7 @@ const ell = { showMitigatedThreats: 'Εμφάνιση απειλών που έχουν μετριαστεί', showModelDiagrams: 'Εμφάνιση διαγραμμάτων μοντέλων', showEmpty: 'Προβολή κενών στοιχείων', + showAttributes: 'Show element attributes', showBranding: 'Λογότυπο Threat Dragon' }, title: 'Αναφορά μοντέλου απειλών για', diff --git a/td.vue/src/i18n/en.js b/td.vue/src/i18n/en.js index 550ced2f1..2ace97b77 100644 --- a/td.vue/src/i18n/en.js +++ b/td.vue/src/i18n/en.js @@ -351,6 +351,7 @@ const eng = { showMitigatedThreats: 'Show mitigated threats', showModelDiagrams: 'Show model diagrams', showEmpty: 'Show empty elements', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragon logo' }, title: 'Threat model report for', diff --git a/td.vue/src/i18n/es.js b/td.vue/src/i18n/es.js index da79a8d83..6e4732444 100644 --- a/td.vue/src/i18n/es.js +++ b/td.vue/src/i18n/es.js @@ -351,6 +351,7 @@ const spa = { showMitigatedThreats: 'Mostrar amenazas mitigadas', showModelDiagrams: 'Mostrar diagramas de modelo', showEmpty: 'Show empty elements', + showAttributes: 'Show element attributes', showBranding: 'Marca de Threat Dragon' }, title: 'Reporte de modelo de amenaza para', diff --git a/td.vue/src/i18n/fi.js b/td.vue/src/i18n/fi.js index 2d0c7396a..ceba25323 100644 --- a/td.vue/src/i18n/fi.js +++ b/td.vue/src/i18n/fi.js @@ -351,6 +351,7 @@ const fin = { showMitigatedThreats: 'Näytä hallitut uhkat', showModelDiagrams: 'Näytä uhkamallin kaaviot', showEmpty: 'Näytä tyhjät elementit', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragon logo' }, title: 'Uhkamallinnus kohteelle', diff --git a/td.vue/src/i18n/fr.js b/td.vue/src/i18n/fr.js index 7705d49f0..3e89abbae 100644 --- a/td.vue/src/i18n/fr.js +++ b/td.vue/src/i18n/fr.js @@ -351,6 +351,7 @@ const fra = { showMitigatedThreats: 'Afficher les menaces mitigées', showModelDiagrams: 'Afficher les diagrammes du modèle', showEmpty: 'Show empty elements', + showAttributes: 'Show element attributes', showBranding: 'Icône de Threat Dragon' }, title: 'Rapport sur le modèle de menace pour', diff --git a/td.vue/src/i18n/hi.js b/td.vue/src/i18n/hi.js index 4f0c11d0d..fcf90c688 100644 --- a/td.vue/src/i18n/hi.js +++ b/td.vue/src/i18n/hi.js @@ -351,6 +351,7 @@ const hin = { showMitigatedThreats: 'कम किए गए खतरे दिखाएं', showModelDiagrams: 'मॉडल आरेख दिखाएं', showEmpty: 'खाली तत्व दिखाएं', + showAttributes: 'Show element attributes', showBranding: 'शो थ्रेट ड्रैगन ब्रांडिंग' }, title: 'के लिए थ्रेट मॉडल रिपोर्ट', diff --git a/td.vue/src/i18n/id.js b/td.vue/src/i18n/id.js index d873429e8..15652e046 100644 --- a/td.vue/src/i18n/id.js +++ b/td.vue/src/i18n/id.js @@ -351,6 +351,7 @@ const id = { showMitigatedThreats: 'Tampilkan ancaman yang diredam', showModelDiagrams: 'Tampilkan diagram model', showEmpty: 'Tampilkan elemen kosong', + showAttributes: 'Show element attributes', showBranding: 'Logo Threat Dragon' }, title: 'Laporan model ancaman untuk', diff --git a/td.vue/src/i18n/ja.js b/td.vue/src/i18n/ja.js index 522faa18c..c60f94a5e 100644 --- a/td.vue/src/i18n/ja.js +++ b/td.vue/src/i18n/ja.js @@ -347,6 +347,7 @@ const jpn = { showMitigatedThreats: '解決済みの脅威を表示', showModelDiagrams: 'モデルの図面を表示', showEmpty: '空要素を表示', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragonロゴ' }, title: '脅威レポート', diff --git a/td.vue/src/i18n/ms.js b/td.vue/src/i18n/ms.js index 825d050c9..edffed877 100644 --- a/td.vue/src/i18n/ms.js +++ b/td.vue/src/i18n/ms.js @@ -352,6 +352,7 @@ const ms = { showMitigatedThreats: 'Tunjukkan ancaman yang ditangani', showModelDiagrams: 'Tunjukkan gambarajah model', showEmpty: 'Tunjukkan elemen kosong', + showAttributes: 'Show element attributes', showBranding: 'Logo Threat Dragon' }, title: 'Laporan model ancaman untuk', diff --git a/td.vue/src/i18n/pt.js b/td.vue/src/i18n/pt.js index e8de8c502..e023f32a2 100644 --- a/td.vue/src/i18n/pt.js +++ b/td.vue/src/i18n/pt.js @@ -351,6 +351,7 @@ const por = { showMitigatedThreats: 'Show mitigated threats', showModelDiagrams: 'Show model diagrams', showEmpty: 'Show empty elements', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragon logo' }, title: 'Relatório do modelo de ameaças para', diff --git a/td.vue/src/i18n/ru.js b/td.vue/src/i18n/ru.js index b9301d778..ed207c44d 100644 --- a/td.vue/src/i18n/ru.js +++ b/td.vue/src/i18n/ru.js @@ -351,6 +351,7 @@ const rus = { showMitigatedThreats: 'Show mitigated threats', showModelDiagrams: 'Show model diagrams', showEmpty: 'Show empty elements', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragon logo' }, title: 'Threat model report for', diff --git a/td.vue/src/i18n/uk.js b/td.vue/src/i18n/uk.js index 93188a2c5..6dd904930 100644 --- a/td.vue/src/i18n/uk.js +++ b/td.vue/src/i18n/uk.js @@ -351,6 +351,7 @@ const ukr = { showMitigatedThreats: 'Show mitigated threats', showModelDiagrams: 'Show model diagrams', showEmpty: 'Show empty elements', + showAttributes: 'Show element attributes', showBranding: 'Threat Dragon logo' }, title: 'Threat model report for', diff --git a/td.vue/src/i18n/zh.js b/td.vue/src/i18n/zh.js index 92c72ea7a..683401505 100644 --- a/td.vue/src/i18n/zh.js +++ b/td.vue/src/i18n/zh.js @@ -351,6 +351,7 @@ const zho = { showMitigatedThreats: '显示已缓解的威胁', showModelDiagrams: '显示模型图', showEmpty: '显示空元素', + showAttributes: 'Show element attributes', showBranding: '显示Threat Dragon形象' }, title: '威胁模型报告来自', diff --git a/td.vue/src/views/ReportModel.vue b/td.vue/src/views/ReportModel.vue index 896337c1b..19684a014 100644 --- a/td.vue/src/views/ReportModel.vue +++ b/td.vue/src/views/ReportModel.vue @@ -58,6 +58,17 @@ >{{ $t('report.options.showBranding') }} + + + + {{ $t('report.options.showAttributes') }} + + diff --git a/td.vue/tests/unit/service/otm/OTMtoTD.spec.js b/td.vue/tests/unit/service/otm/OTMtoTD.spec.js index 8ac80e7f7..bcb053407 100644 --- a/td.vue/tests/unit/service/otm/OTMtoTD.spec.js +++ b/td.vue/tests/unit/service/otm/OTMtoTD.spec.js @@ -57,40 +57,40 @@ describe('service/otm/OTMtoTD.js', () => { beforeEach(() => { mockOTM.otmVersion = '0.2.0'; mockOTM.representations = [ - { - 'name': 'Architecture Diagram', - 'id': 'architecture-diagram', - 'type': 'diagram', - 'size': { - 'width': 1000, - 'height': 1100 - }, - 'attributes': null - }, - { - 'name': 'Application Code', - 'id': 'application-code', - 'type': 'code', - 'description': 'the Application Code description', - 'repository': { - 'url': 'https://github.com/my-project' - }, - 'attributes': null - }, - { - 'name': 'Empty Diagram', - 'id': '578b5170-74f1-401d-a72f-c06ccc966ca0', - 'type': 'diagram', - 'description': 'a description of the Empty Diagram', - 'size': { - 'width': 500, - 'height': 300 - }, - 'attributes': { - 'diagramType': 'LINDDUN' - } - } - ]; + { + 'name': 'Architecture Diagram', + 'id': 'architecture-diagram', + 'type': 'diagram', + 'size': { + 'width': 1000, + 'height': 1100 + }, + 'attributes': null + }, + { + 'name': 'Application Code', + 'id': 'application-code', + 'type': 'code', + 'description': 'the Application Code description', + 'repository': { + 'url': 'https://github.com/my-project' + }, + 'attributes': null + }, + { + 'name': 'Empty Diagram', + 'id': '578b5170-74f1-401d-a72f-c06ccc966ca0', + 'type': 'diagram', + 'description': 'a description of the Empty Diagram', + 'size': { + 'width': 500, + 'height': 300 + }, + 'attributes': { + 'diagramType': 'LINDDUN' + } + } + ]; tdModel = convertOTMtoTD(mockOTM); }); @@ -163,12 +163,12 @@ describe('service/otm/OTMtoTD.js', () => { it('preserves a non-diagram representation', () => { expect(tdModel.detail.representations[0]).toEqual({ - 'name': 'Application Code', - 'id': 'application-code', - 'type': 'code', - 'description': 'the Application Code description', - 'repository': { 'url': 'https://github.com/my-project' }, - 'attributes': null + 'name': 'Application Code', + 'id': 'application-code', + 'type': 'code', + 'description': 'the Application Code description', + 'repository': { 'url': 'https://github.com/my-project' }, + 'attributes': null }); });