forked from OWASP/owasp-mastg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'OWASP:master' into master
- Loading branch information
Showing
363 changed files
with
6,190 additions
and
1,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "MkDocs-VSCode", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"debug.javascript.usePreview": false | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"yzhang.markdown-all-in-one", | ||
"redhat.vscode-yaml", | ||
"shardulm94.trailing-spaces", | ||
"oderwat.indent-rainbow", | ||
"msjsdiag.debugger-for-chrome", | ||
"ms-python.python", | ||
"ms-python.debugpy", | ||
"davidanson.vscode-markdownlint", | ||
"timonwong.shellcheck", | ||
"ms-python.vscode-pylance" | ||
] | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
8000 | ||
] | ||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. | ||
//"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
dist | ||
build | ||
.git | ||
Dockerfile | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Build All Android Demos | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'demos/**' | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- 'demos/**' | ||
|
||
jobs: | ||
generate-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate matrix | ||
id: set-matrix | ||
run: | | ||
demos=$(find demos/android -type d -name "MASTG-DEMO-*") | ||
matrix="{\"demo\":[" | ||
for demo in $demos; do | ||
matrix="${matrix}\"$demo\"," | ||
done | ||
matrix="${matrix%,}]}" | ||
echo "matrix=$matrix" >> $GITHUB_ENV | ||
echo "matrix=$matrix" >> $GITHUB_OUTPUT | ||
- name: Print matrix | ||
run: echo "${{ steps.set-matrix.outputs.matrix }}" | ||
|
||
build: | ||
needs: generate-matrix | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 # Increase this value as needed | ||
strategy: | ||
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | ||
max-parallel: 3 # Limit the number of parallel jobs | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Clone MASTestApp-Android repository | ||
run: git clone https://github.com/cpholguera/MASTestApp-Android.git | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Replace files and build APK | ||
run: | | ||
demo="${{ matrix.demo }}" | ||
if [ -d "$demo" ]; then | ||
echo "Processing $demo" | ||
[ -f "$demo/MastgTest.kt" ] && cp -f "$demo/MastgTest.kt" MASTestApp-Android/app/src/main/java/org/owasp/mastestapp/MastgTest.kt && echo "Copied MastgTest.kt for $demo" || echo "No MastgTest.kt found for $demo" | ||
[ -f "$demo/AndroidManifest.xml" ] && cp -f "$demo/AndroidManifest.xml" MASTestApp-Android/app/src/main/AndroidManifest.xml && echo "Copied AndroidManifest.xml for $demo" || echo "No AndroidManifest.xml found for $demo" | ||
cd MASTestApp-Android | ||
echo "Building APK for $demo" | ||
./gradlew assembleDebug --stacktrace | ||
build_status=$? | ||
cd .. | ||
if [ $build_status -eq 0 ]; then | ||
echo "Build succeeded for $demo" | ||
apk_name="$(basename "$demo").apk" | ||
if [ -f "MASTestApp-Android/app/build/outputs/apk/debug/app-debug.apk" ]; then | ||
mv MASTestApp-Android/app/build/outputs/apk/debug/app-debug.apk "$apk_name" | ||
echo "APK for $demo moved to $apk_name" | ||
else | ||
echo "APK not found for $demo" | ||
fi | ||
else | ||
echo "Build failed for $demo" | ||
fi | ||
else | ||
echo "Demo directory not found: $demo" | ||
fi | ||
- name: Set APK name variable | ||
id: set_apk_name | ||
run: echo "APK_NAME=$(basename ${{ matrix.demo }}).apk" >> $GITHUB_ENV | ||
|
||
- name: List generated APK | ||
run: | | ||
echo "Listing generated APK in demos/android directory:" | ||
ls -l "${{ env.APK_NAME }}" || echo "No APK found." | ||
- name: Upload APK | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.APK_NAME }} | ||
path: "${{ env.APK_NAME }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,9 @@ | |
{ | ||
"pattern": "^/MASTG/" | ||
}, | ||
{ | ||
"pattern": "^/MASWE/" | ||
}, | ||
{ | ||
"pattern": "^/checklists/" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"globs": [ | ||
"**/*.md" | ||
], | ||
|
||
"ignores": [ | ||
"src", | ||
"node_modules", | ||
"Crackmes", | ||
"Samples", | ||
".github", | ||
"docs/contributing/5_Style_Guide.md" | ||
], | ||
"gitignore": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Current File", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true | ||
}, | ||
{ | ||
"name": "Python: MkDocs Serve", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/.venv/bin/mkdocs", // Adjust the path if mkdocs is not in a virtual environment | ||
"args": ["serve", "-a", "localhost:8002"], | ||
"console": "integratedTerminal", | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}/.venv/bin/python3" | ||
}, | ||
"preLaunchTask": "Run populate_dynamic_pages.py" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run structure_mastg.sh", | ||
"type": "shell", | ||
"command": "./src/scripts/structure_mastg.sh", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Run transform_files.py", | ||
"type": "shell", | ||
"command": "${workspaceFolder}/.venv/bin/python", | ||
"args": ["src/scripts/transform_files.py"], | ||
"problemMatcher": [], | ||
"dependsOn": "Run structure_mastg.sh" | ||
}, | ||
{ | ||
"label": "Run populate_dynamic_pages.py", | ||
"type": "shell", | ||
"command": "${workspaceFolder}/.venv/bin/python", | ||
"args": ["src/scripts/populate_dynamic_pages.py"], | ||
"problemMatcher": [], | ||
"dependsOn": "Run transform_files.py" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Use the latest Python image | ||
FROM python:3-slim | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y git jq curl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python dependencies | ||
COPY src/scripts/requirements.txt . | ||
RUN python -m pip install --no-cache-dir -r requirements.txt | ||
|
||
# Clone the OWASP MASVS as required by the website build | ||
RUN git clone --depth 1 https://github.com/OWASP/owasp-masvs.git /workspaces/owasp-masvs | ||
|
||
# Set the working directory this way to be compatible with devcontainers and also run independently | ||
WORKDIR /workspaces/owasp-mastg | ||
|
||
# Expose port 8000 | ||
EXPOSE 8000 | ||
|
||
# Start the container with a shell | ||
CMD ["bash"] | ||
|
||
# If running manually: docker run -it --rm -p 8000:8000 -v $(pwd):/workspaces/owasp-mastg mastg |
Oops, something went wrong.