You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/mastg-best-practice.instructions.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,12 @@ Scope and relationship to Knowledge:
14
14
- Best Practices are prescriptive: they state what to do and why from a security perspective.
15
15
- Keep background explanations minimal; for conceptual background on OS features, link to Knowledge pages under `knowledge/`.
16
16
17
+
Relationship to Tests and Knowledge (nuance):
18
+
19
+
- Tests (MASTG-TEST) describe the issue and "what can go wrong", then show how to detect it.
20
+
- Knowledge (MASTG-KNOW) describes the feature/API neutrally (no "what can go wrong").
21
+
- Best Practices (MASTG-BEST) explains how to prevent or mitigate the issue the tests detect.
22
+
17
23
### Markdown: Metadata
18
24
19
25
Include a YAML front matter block with the following fields:
@@ -27,6 +33,7 @@ Optional metadata:
27
33
- alias: URL-friendly slug (lowercase, hyphen-separated) used for navigation.
28
34
- status: draft, placeholder, deprecated.
29
35
- note: Short free-form note.
36
+
- knowledge: One or more related Knowledge pages (`MASTG-KNOW-####`) for neutral background and API reference.
30
37
- available_since: Minimum platform version/API level where this recommendation applies (Android: integer API level; iOS: release version, for example `13`).
31
38
- deprecated_since: Last applicable platform/API level.
32
39
@@ -38,6 +45,7 @@ title: Preventing Screenshots and Screen Recording
Copy file name to clipboardExpand all lines: .github/instructions/mastg-demo.instructions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ The rule has identified some instances in the code file where a non-random sourc
187
187
188
188
#### Evaluation
189
189
190
-
A concise explanation of how you applied the test’s “Evaluation” section to this demo. If lines are present in the observation, explain each relevant line.
190
+
A concise explanation of how you applied the test’s "Evaluation" section to this demo. If lines are present in the observation, explain each relevant line.
Copy file name to clipboardExpand all lines: .github/instructions/mastg-knowledge.instructions.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,21 @@
1
1
## Knowledge Articles
2
2
3
-
Authoring standards for the Knowledge articles under `knowledge/`. Knowledge pages explain Android or iOS features and concepts that tests and techniques rely on. They are descriptive, not prescriptive: do not include security recommendations here. Best practices belong in `best-practices/`.
3
+
Authoring standards for the Knowledge articles under `knowledge/`.
4
+
5
+
Knowledge pages explain Android or iOS features and concepts that tests and techniques rely on.
6
+
7
+
Scope boundaries (this is important for consistency across the project):
8
+
9
+
- Knowledge (MASTG-KNOW) is descriptive: what the thing is, what it does, how it works, and what APIs/configuration knobs exist.
10
+
- Tests (MASTG-TEST) are issue-focused: what can go wrong with that thing in apps, and how to detect it.
11
+
- Best Practices (MASTG-BEST) are prescriptive: how to prevent or fix the issues that tests look for.
12
+
13
+
Because of this separation, do not include "what can go wrong", threat scenarios, failure criteria, or remediation advice in Knowledge pages.
14
+
15
+
Avoid language and structures that imply security testing or remediation, for example:
16
+
17
+
- "attackers can …", "this is insecure …", "this is vulnerable …"
18
+
- "the test fails if …", "to prevent this …", "you should/shouldn’t …"
4
19
5
20
Locations and taxonomy:
6
21
@@ -53,7 +68,7 @@ Keep content authoritative, concise, and platform-focused. Avoid duplicating OS
53
68
Considerations for writing the content:
54
69
55
70
- Define the concept and its scope. Relate to OS components, APIs, or security model elements.
56
-
- Explain typical security-relevant behaviors or implications of the feature without necessarily recommending mitigations (that's for "best practices").
71
+
- Explain behavior and implications that are relevant to security testing without framing them as "risks" or "attacks". (Tests cover "what can go wrong"; Best Practices cover "what to do about it".)
57
72
- Include specific API names, version nuances, storage locations, and configuration knobs. Try to avoid code samples. Instead, refer to the existing MASTG-DEMO code files. If you include them, keep them short and explanatory.
58
73
- Use references from official docs and standards. Avoid non-authoritative sources.
59
74
- In body text, reference internal MAS identifiers with a leading `@` (for example, @MASTG-KNOW-0001, @MASTG-TEST-0204, @MASTG-TECH-0014, @MASTG-TOOL-0031, MASWE-0089).
@@ -70,7 +85,7 @@ Considerations for writing the content:
70
85
- Cross-category content: If a topic spans two MASVS categories, choose the best fit and reference the other in the body; avoid duplicate pages.
71
86
- Generic vs platform: Concepts that are identical across platforms should be split into platform folders if platform detail matters; otherwise, place details where they differ and keep overviews succinct.
72
87
- Where to place recommendations: Keep all prescriptive advice (do/don't, secure configuration values, mitigations) in Best Practices pages under `best-practices/`, and link them from the "Related" section.
73
-
- When writing tests, techniques, or tools, always try to link to a knowledge article or create one if it's missing.
88
+
- When writing tests, techniques, or tools, always try to link to a Knowledge article (and create one if it's missing). Tests should also link to Knowledge by using the `@MASTG-KNOW-xxxx` notation to make the relationship explicit.
Copy file name to clipboardExpand all lines: .github/instructions/mastg-mitmproxy-scripts.instructions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This guide defines how to write and use mitmproxy scripts in MASTG demos. Script
4
4
5
5
### Scope and terminology
6
6
7
-
-“mitmproxy scripts” refers to Python addons for mitmproxy/mitmdump written against the mitmproxy scripting API.
7
+
-"mitmproxy scripts" refers to Python addons for mitmproxy/mitmdump written against the mitmproxy scripting API.
8
8
- Tools background (installation, proxy setup, certificates) lives in @MASTG-TOOL-0097 (mitmproxy). Do not duplicate setup steps here—link to the Tools page.
9
9
- We use the command-line runner `mitmdump` in demos for reproducibility; `mitmweb` and the interactive `mitmproxy` UI are fine for exploration but not for demo automation.
Copy file name to clipboardExpand all lines: .github/instructions/mastg-r2-scripts.instructions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This guide defines how to write and use radare2 scripts in MASTG demos. Scripts
4
4
5
5
### Scope and terminology
6
6
7
-
-“r2 scripts” refers to radare2 command files executed with `-i <file>`.
7
+
-"r2 scripts" refers to radare2 command files executed with `-i <file>`.
8
8
- The repo uses `.r2` as the primary extension (for example, `cchash.r2`); variations like `.jr2` are not used in this repository.
9
9
- Tools background lives under @MASTG-TOOL-0073 (radare2) and @MASTG-TOOL-0129 (rabin2). Do not duplicate setup or installation steps—link to Tools pages.
Copy file name to clipboardExpand all lines: .github/instructions/mastg-test.instructions.md
+41-17Lines changed: 41 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ Example tests for reference:
23
23
Notes:
24
24
25
25
- Tests with `platform: network` are still organized under the OS folder that the MASVS category belongs to (for example, Android network tests live under `tests-beta/android/MASVS-NETWORK/`).
26
+
- Old tests under `tests/` do not follow these new guidelines. We are currently working to deprecate all of them in favor of these new approach.
26
27
27
28
Each test has two parts: the [Markdown metadata](#markdown-metadata) (YAML `front matter`) and the [Markdown body](#markdown-body).
28
29
@@ -40,16 +41,18 @@ Follow a consistent style across all test titles.
40
41
41
42
**Conventions**
42
43
43
-
- Static: “References to…” (semgrep/r2)
44
-
- Dynamic: “Runtime Use …” (frida)
44
+
- Static: "References to…" (semgrep/r2)
45
+
- Dynamic: "Runtime Use …" (frida)
45
46
46
47
Exceptions may apply where "Runtime ..." feels forced, for example, tests using adb, local backups, or filesystem snapshots.
47
48
48
49
#### platform
49
50
50
-
The mobile platform. One of the following: iOS, Android, or network.
51
+
The mobile platform. One of the following:
51
52
52
-
- Use network for platform-agnostic traffic analysis tests where the checks are performed purely on captured/observed traffic (often paired with type: [network]).
53
+
-`android`
54
+
-`ios`
55
+
-`network`: for platform-agnostic traffic analysis tests where the checks are performed purely on captured/observed traffic (often paired with `type: [network]`).
53
56
54
57
#### id
55
58
@@ -88,22 +91,16 @@ type: [dynamic, manual]
88
91
89
92
#### best-practices
90
93
91
-
Reference platform-specific mitigations or best practices. Automation generates a “Mitigations” section.
94
+
Reference platform-specific mitigations or best practices. Automation generates a "Mitigations" section.
92
95
93
-
New best practice files can be added under [best-practices/](https://github.com/OWASP/owasp-mastg/tree/master/best-practices).
96
+
Reference the related `best-practices/` pages for background using their ID. Create the pages if they don't exist yet.
94
97
95
98
Example:
96
99
97
100
```md
98
101
best-practices: [MASTG-BEST-0001]
99
102
```
100
103
101
-
This links to https://mas.owasp.org/MASTG/best-practices/MASTG-BEST-0001/
102
-
103
-
Notes:
104
-
105
-
- If no applicable best practices exist yet, you can omit the field or set an empty list: `best-practices: []`.
106
-
107
104
#### prerequisites
108
105
109
106
List the conditions that must be known or available before running or evaluating the test. These items capture internal context that only the developer or the organization can provide. Existing files are in the `prerequisites/` folder. Create new ones when needed.
@@ -126,8 +123,8 @@ prerequisites:
126
123
127
124
#### profiles
128
125
129
-
Specify the MASVS profiles to which the test applies. Valid values: L1, L2, P, R.
130
-
The profiles are described in [MAS Testing Profiles Guide](https://docs.google.com/document/d/1paz7dxKXHzAC9MN7Mnln1JiZwBNyg7Gs364AJ6KudEs/edit?tab=t.0#heading=h.il6q80u4fm3n)
126
+
Specify the MAS profiles to which the test applies. Valid values: L1, L2, P, R.
127
+
The profiles are described in [MAS Testing Profiles Guide](Document/0x03b-Testing-Profiles.md)
131
128
132
129
- L1 denotes Essential Security.
133
130
- L2 denotes Advanced Security.
@@ -140,6 +137,16 @@ Example:
140
137
profiles: [L1, L2, P]
141
138
```
142
139
140
+
#### knowledge
141
+
142
+
Reference the related `knowledge/` pages for background using their ID. Create the pages if they don't exist yet.
143
+
144
+
Example:
145
+
146
+
```md
147
+
knowledge: [MASTG-KNOW-0013]
148
+
```
149
+
143
150
#### optional fields
144
151
145
152
Include these if relevant:
@@ -158,7 +165,22 @@ Notes:
158
165
159
166
#### Overview
160
167
161
-
The overview is platform-specific and extends the weakness overview with details on the area tested. It may mention specific APIs and features.
168
+
The overview is platform-specific and extends the weakness overview with details on the area tested (the Knowledge items from the `knowledge` in the metadata).
169
+
170
+
Very important: the overview must be phrased like an issue.
171
+
172
+
- Describe the relevant platform feature/API from the perspective of "what can go wrong" (risk, failure mode, exposure).
173
+
- Make it clear why the test exists: what the tester is trying to detect and why that matters.
174
+
175
+
Do not repeat the weakness description here. Focus on the specific issue the test is checking for on the given platform.
176
+
177
+
Good patterns for issue framing:
178
+
179
+
- "If the app uses/implements/configures X, Y can happen …"
180
+
- "This can lead to … (exposure, bypass, integrity failure, privacy leak) …"
181
+
- "This test checks/verifies whether the app …"
182
+
183
+
Do not write the overview like a neutral platform description. Neutral/descriptive explanations belong in `knowledge/`.
162
184
163
185
Example:
164
186
@@ -198,7 +220,7 @@ Notes:
198
220
199
221
The output you get after executing all steps. It serves as evidence.
200
222
201
-
It MUST start with “The output should contain ...”.
223
+
It MUST start with "The output should contain ...".
202
224
203
225
Example:
204
226
@@ -212,7 +234,7 @@ The output should contain a list of locations where insecure random APIs are use
212
234
213
235
Using the observation as input, describe how to evaluate it. State explicitly what makes the test fail.
214
236
215
-
It MUST start with “The test case fails if ...”.
237
+
It MUST start with "The test case fails if ...".
216
238
217
239
Example:
218
240
@@ -221,3 +243,5 @@ Example:
221
243
222
244
The test case fails if you can find random numbers generated using those APIs that are used in security-relevant contexts.
223
245
```
246
+
247
+
IMPORTANT: Do not include remediation advice or best practices in the evaluation section. Remediation belongs in `best-practices/` and must be linked in the test metadata `best-practices`. If it does not exist yet, create it.
0 commit comments