From b2c7d7aacf99ebd4d33e2cad4ffd54951ac724a3 Mon Sep 17 00:00:00 2001 From: Carlos Holguera Date: Sat, 13 Jul 2024 11:21:03 +0200 Subject: [PATCH 1/2] optimize structure scripts and flatten nav for MASTG --- mkdocs.yml | 17 ++++++++--------- src/scripts/structure_mastg.sh | 22 ++++------------------ src/scripts/structure_masvs.sh | 13 +++++-------- 3 files changed, 17 insertions(+), 35 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 3b6cd8a238..38efa1d35c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,15 +28,14 @@ nav: - MASTG: - MASTG/index.md - Intro: - - ... | flat | MASTG/Intro/*.md - - ... | flat | MASTG/References/*.md - - Theory: - - General Concepts: - - ... | flat | MASTG/General/*.md - - Android Security Testing: - - ... | flat | MASTG/Android/*.md - - iOS Security Testing: - - ... | flat | MASTG/iOS/*.md + - ... | flat | MASTG/0x0[1-2]*.md # Overview of the project (0x03) is redundant in the web. + - ... | flat | MASTG/0x09*.md + - General Concepts: + - ... | flat | MASTG/0x04*.md + - Android Security Testing: + - ... | flat | MASTG/0x05*.md + - iOS Security Testing: + - ... | flat | MASTG/0x06*.md - Tests: - MASTG/tests/index.md - Android: diff --git a/src/scripts/structure_mastg.sh b/src/scripts/structure_mastg.sh index d03bdad183..c26f66d70d 100755 --- a/src/scripts/structure_mastg.sh +++ b/src/scripts/structure_mastg.sh @@ -1,15 +1,5 @@ #!/bin/bash -mkdir -p docs/MASTG/Intro -mkdir -p docs/MASTG/General -mkdir -p docs/MASTG/Android -mkdir -p docs/MASTG/iOS -mkdir -p docs/MASTG/References -mkdir -p docs/MASTG/rules -mkdir -p docs/MASWE - -cp Document/0x0[1-6]*.md docs/MASTG -cp Document/0x09*.md docs/MASTG cp -r tests docs/MASTG/ cp -r techniques docs/MASTG/ cp -r tools docs/MASTG/ @@ -19,17 +9,13 @@ cp -r tests-beta docs/MASTG/ cp -r demos docs/MASTG/ cp -r rules docs/MASTG/ +cp -r Document/0x0*.md docs/MASTG +cp docs/MASTG/0x08b-Reference-Apps.md docs/MASTG/apps/index.md +cp docs/MASTG/0x08a-Testing-Tools.md docs/MASTG/tools/index.md + cp Document/tests.md docs/MASTG/tests/index.md -cp Document/0x08b-Reference-Apps.md docs/MASTG/apps/index.md -cp Document/0x08a-Testing-Tools.md docs/MASTG/tools/index.md cp Document/techniques.md docs/MASTG/techniques/index.md -mv docs/MASTG/0x0[1-3]*.md docs/MASTG/Intro -mv docs/MASTG/0x04*.md docs/MASTG/General -mv docs/MASTG/0x05*.md docs/MASTG/Android -mv docs/MASTG/0x06*.md docs/MASTG/iOS -mv docs/MASTG/0x09*.md docs/MASTG/Intro - if [[ "$(uname)" == "Darwin" ]]; then SED="gsed" else diff --git a/src/scripts/structure_masvs.sh b/src/scripts/structure_masvs.sh index 679ca13b51..7ea47d534e 100755 --- a/src/scripts/structure_masvs.sh +++ b/src/scripts/structure_masvs.sh @@ -1,14 +1,12 @@ +#!/bin/bash if [ ! -d "../owasp-masvs/" ] ; then - echo "Error: Clone owasp-masvs to same directory as owasp-mastg" - exit + echo "Error: Clone owasp-masvs to same directory as owasp-mastg: cd .. && git clone https://github.com/OWASP/owasp-masvs.git" + exit 1 fi -mkdir -p docs/MASVS/Intro -mkdir -p docs/MASVS/controls -cp ../owasp-masvs/Document/*.md docs/MASVS -mv docs/MASVS/0[1-4]*.md docs/MASVS/Intro -cp ../owasp-masvs/controls/* docs/MASVS/controls +cp ../owasp-masvs/Document/*-*.md docs/MASVS/ +cp ../owasp-masvs/controls/ docs/MASVS/ if [[ "$(uname)" == "Darwin" ]]; then SED="gsed" @@ -16,7 +14,6 @@ else SED="sed" fi - mkdir -p docs/assets/Images/MASVS cp ../owasp-masvs/Document/images/* docs/assets/Images/MASVS $SED -i "s#images/#../../../assets/Images/MASVS/#g" docs/MASVS/**/*.md From 760f47cca12f2fa4aa350c6c2c92dbf84cd09e65 Mon Sep 17 00:00:00 2001 From: Carlos Holguera Date: Sat, 13 Jul 2024 11:48:05 +0200 Subject: [PATCH 2/2] Optimize structure scripts and flatten nav for MASVS --- .gitignore | 3 ++- mkdocs.yml | 2 +- src/scripts/structure_mastg.sh | 18 +++++++++--------- src/scripts/structure_masvs.sh | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 6761eb7320..79eaab1541 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,9 @@ logs *.docx *.epub docs/MASVS/**/ -docs/MASVS/*-MASVS-*.md +docs/MASVS/*-*.md docs/MASTG/**/ +docs/MASTG/0x*.md docs/assets/Images docs/checklists/MASVS-*.md docs/talks.md diff --git a/mkdocs.yml b/mkdocs.yml index 38efa1d35c..4befe8a69e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -172,7 +172,7 @@ nav: - MASVS: - MASVS/index.md - Intro: - - ... | flat | MASVS/Intro/* + - ... | flat | MASVS/0[1-4]*.md - MASVS-STORAGE: MASVS/05-MASVS-STORAGE.md - ... | flat | MASVS/controls/MASVS-STORAGE*.md - MASVS-CRYPTO: MASVS/06-MASVS-CRYPTO.md diff --git a/src/scripts/structure_mastg.sh b/src/scripts/structure_mastg.sh index c26f66d70d..f56a292cff 100755 --- a/src/scripts/structure_mastg.sh +++ b/src/scripts/structure_mastg.sh @@ -1,18 +1,18 @@ #!/bin/bash -cp -r tests docs/MASTG/ -cp -r techniques docs/MASTG/ -cp -r tools docs/MASTG/ -cp -r apps docs/MASTG/ -cp -r weaknesses/** docs/MASWE/ -cp -r tests-beta docs/MASTG/ -cp -r demos docs/MASTG/ -cp -r rules docs/MASTG/ +mkdir -p docs/MASWE + +directories=("tests" "techniques" "tools" "apps" "tests-beta" "demos" "rules") + +for dir in "${directories[@]}"; do + cp -r "$dir" docs/MASTG/ || { echo "Failed to copy $dir"; exit 1; } +done + +cp -r weaknesses/** docs/MASWE/ || { echo "Failed to copy weaknesses"; exit 1; } cp -r Document/0x0*.md docs/MASTG cp docs/MASTG/0x08b-Reference-Apps.md docs/MASTG/apps/index.md cp docs/MASTG/0x08a-Testing-Tools.md docs/MASTG/tools/index.md - cp Document/tests.md docs/MASTG/tests/index.md cp Document/techniques.md docs/MASTG/techniques/index.md diff --git a/src/scripts/structure_masvs.sh b/src/scripts/structure_masvs.sh index 7ea47d534e..6d887d4c58 100755 --- a/src/scripts/structure_masvs.sh +++ b/src/scripts/structure_masvs.sh @@ -5,8 +5,8 @@ if [ ! -d "../owasp-masvs/" ] ; then exit 1 fi -cp ../owasp-masvs/Document/*-*.md docs/MASVS/ -cp ../owasp-masvs/controls/ docs/MASVS/ +cp -r ../owasp-masvs/Document/*-*.md docs/MASVS/ +cp -r ../owasp-masvs/controls/ docs/MASVS/controls/ if [[ "$(uname)" == "Darwin" ]]; then SED="gsed"