Skip to content

Conversation

@cpholguera
Copy link
Collaborator

@cpholguera cpholguera commented Mar 14, 2025

This PR focuses adds MASTG-DEMO-0034 and MASTG-DEMO-0035 related to Android app backups.

Documentation Updates

  • Document/0x05d-Testing-Data-Storage.md: Updated the information on Android backups to include restrictions introduced in Android 12 and provided relevant links.

New Tests

  • tests-beta/android/MASVS-STORAGE/MASTG-TEST-0262.md: Created a new test verifying exclusion of sensitive data from backups.

New Demos

  • demos/android/MASVS-STORAGE/MASTG-DEMO-0034/MASTG-DEMO-0034.md: Created a new demo using semgrep to analyze the AndroidManifest.xml for backup-related attributes and evaluate the results.
  • demos/android/MASVS-STORAGE/MASTG-DEMO-0033/MASTG-DEMO-0035.md: Added a detailed demo with steps to back up and restore app data using adb backup, including the evaluation of backup content.

New Techniques

  • techniques/android/MASTG-TECH-0126.md: Added a new technique for performing backups and restores using ADB and Backup Manager.
  • techniques/android/MASTG-TECH-0127.md: Added a new technique for inspecting an app's backup data.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds new demos for backup and restore operations, updates evaluation scripts, and improves documentation on Android backup functionalities.

  • Introduces a Python evaluation script to check backup configurations.
  • Adds/updates markdown demos and technique documentation for backup, restore, and data inspection.
  • Introduces a new YML rule to verify backup-related attributes in AndroidManifest.xml.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
demos/android/MASVS-STORAGE/MASTG-DEMO-0034/evaluate.py Adds a Python evaluation script for verifying Android backup configuration.
techniques/android/MASTG-TECH-0126.md Updates documentation for using ADB backup and backup extraction techniques.
demos/android/MASVS-STORAGE/MASTG-DEMO-0033/MASTG-DEMO-0033.md Updates demo metadata and content to align with new backup evaluation methods.
rules/mastg-android-backup-manifest.yml Adds a new rule to inspect AndroidManifest.xml for backup-related configurations.
demos/android/MASVS-STORAGE/MASTG-DEMO-0034/MASTG-DEMO-0034.md Updates the demo documentation to showcase semgrep-based backup configuration evaluation.
techniques/android/MASTG-TECH-0127.md Adds technique documentation for inspecting the contents of Android backup data.
Document/0x05d-Testing-Data-Storage.md Updates backup documentation to reflect the current Android backup restrictions and usage.
tests-beta/android/MASVS-STORAGE/MASTG-TEST-0216.md Revises test steps to better reflect the new backup and restore workflow.

cpholguera and others added 3 commits March 14, 2025 09:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cpholguera cpholguera changed the title Add demos for backup and restore app data with updated documentation Add MASTG-DEMO-0033 and MASTG-DEMO-0034 using adb backup and semgrep Mar 14, 2025
@cpholguera cpholguera changed the title Add MASTG-DEMO-0033 and MASTG-DEMO-0034 using adb backup and semgrep Add MASTG-DEMO-0034 and MASTG-DEMO-0035 using adb backup and semgrep Mar 15, 2025
@cpholguera cpholguera requested a review from Copilot March 24, 2025 10:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The PR introduces new demos, tests, techniques, and documentation updates focused on Android app backup verification using adb backup and semgrep. Key changes include:

  • Addition of two new demo files (MASTG-DEMO-0034 and MASTG-DEMO-0035) demonstrating backup verification approaches.
  • New and updated test files to validate backup configurations and file exclusions.
  • Updates to documentation and techniques, along with a new semgrep rule for inspecting AndroidManifest.xml backup-related attributes.

Reviewed Changes

Copilot reviewed 9 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests-beta/android/MASVS-STORAGE/MASTG-TEST-0262.md Introduces a new test verifying exclusion of sensitive data from backups.
demos/android/MASVS-STORAGE/MASTG-DEMO-0035/MASTG-DEMO-0035.md Adds a demo using adb backup to demonstrate backup file evaluation.
techniques/android/MASTG-TECH-0128.md Provides instructions on performing a backup and restore using ADB and Backup Manager.
rules/mastg-android-backup-manifest.yml Introduces a semgrep rule to inspect AndroidManifest.xml for backup-related configurations.
techniques/android/MASTG-TECH-0127.md Details the process to inspect backup data post restoration.
demos/android/MASVS-STORAGE/MASTG-DEMO-0034/MASTG-DEMO-0034.md Adds a demo showcasing semgrep analysis of backup configurations in AndroidManifest.xml.
Document/0x05d-Testing-Data-Storage.md Updates documentation with details on Android backups and related restrictions.
tests-beta/android/MASVS-STORAGE/MASTG-TEST-0216.md Revises an existing test to better verify backup restoration behavior.
Files not reviewed (6)
  • demos/android/MASVS-STORAGE/MASTG-DEMO-0034/output.txt: Language not supported
  • demos/android/MASVS-STORAGE/MASTG-DEMO-0034/run.sh: Language not supported
  • demos/android/MASVS-STORAGE/MASTG-DEMO-0035/apps/org.owasp.mastestapp/f/secret.txt: Language not supported
  • demos/android/MASVS-STORAGE/MASTG-DEMO-0035/output.txt: Language not supported
  • demos/android/MASVS-STORAGE/MASTG-DEMO-0035/run.sh: Language not supported
  • utils/mastg-android-backup-adb.sh: Language not supported

@cpholguera cpholguera requested a review from serek8 March 24, 2025 10:36
@cpholguera cpholguera changed the title Add MASTG-DEMO-0034 and MASTG-DEMO-0035 using adb backup and semgrep Add MASTG-TEST-0262, MASTG-DEMO-0034 and MASTG-DEMO-0035 using adb backup and semgrep Mar 24, 2025
Copy link
Collaborator

@serek8 serek8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting the tests into dynamic and static, and adding the demo. I just have minor remarks about the titles but the content is great

weakness: MASWE-0004
best-practices: [MASTG-BEST-0004]
---

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's solely a dynamic test now, shouldn't we start this title with "Runtime use ..."? Not sure if we can find a good title with this prefix but how about "Runtime Testing for Presence of Sensitive Files in Backups"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, and I thought about it. However, I began to see a pattern of tests that did not fit our very well-intentioned naming rule.

See here: https://github.com/OWASP/owasp-mastg/pull/3242/files#diff-4dcf4f4e02c7e27d435bcc8d6c096a0c351a07fb9caf7f8ac301d3dd59c91c40

This is another dynamic test where it would be weird to start it with "Runtime ...". I propose we keep it consistent for the typical static (semgrep/r2) and dynamic (frida) and let's see how this other kind evolves and if we come up with a good convention.

@cpholguera cpholguera merged commit 29595f8 into master Mar 27, 2025
13 checks passed
@cpholguera cpholguera deleted the add-android-backup-demos branch March 27, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants