Skip to content

Commit c1e712e

Browse files
committed
Update hyperlinks and normalize link access in OWASP parser tests and data
1 parent 2e9f153 commit c1e712e

6 files changed

Lines changed: 87 additions & 41 deletions

application/tests/owasp_aisvs_parser_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ def test_parse(self) -> None:
4545
"Training Data Governance & Bias Management", entries[0].section
4646
)
4747
self.assertEqual(
48-
"https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C01-Training-Data-Governance.md",
48+
"https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C01-Training-Data-Governance.md",
4949
entries[0].hyperlink,
5050
)
5151
self.assertEqual(
52-
["227-045", "307-507"], [l.document.id for l in entries[0].links]
52+
["227-045", "307-507"], [link.document.id for link in entries[0].links]
5353
)
5454
self.assertEqual("AISVS14", entries[-1].sectionID)
5555
self.assertEqual(
5656
"Human Oversight, Accountability & Governance", entries[-1].section
5757
)
5858
self.assertEqual(
59-
"https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C14-Human-Oversight.md",
59+
"https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C14-Human-Oversight.md",
6060
entries[-1].hyperlink,
6161
)
62-
self.assertEqual(["162-655"], [l.document.id for l in entries[-1].links])
62+
self.assertEqual(["162-655"], [link.document.id for link in entries[-1].links])

application/tests/owasp_api_top10_2023_parser_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_parse(self) -> None:
3737
self.assertEqual("API1", entries[0].sectionID)
3838
self.assertEqual("Broken Object Level Authorization", entries[0].section)
3939
self.assertEqual(
40-
["304-667", "724-770"], [l.document.id for l in entries[0].links]
40+
["304-667", "724-770"], [link.document.id for link in entries[0].links]
4141
)
4242
self.assertEqual("API10", entries[-1].sectionID)
43-
self.assertEqual(["715-223"], [l.document.id for l in entries[-1].links])
43+
self.assertEqual(["715-223"], [link.document.id for link in entries[-1].links])

application/tests/owasp_kubernetes_top10_2022_parser_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_parse(self) -> None:
3939
self.assertEqual("K01", entries[0].sectionID)
4040
self.assertEqual("Insecure Workload Configurations", entries[0].section)
4141
self.assertEqual(
42-
["233-748", "486-813"], [l.document.id for l in entries[0].links]
42+
["233-748", "486-813"], [link.document.id for link in entries[0].links]
4343
)
4444
self.assertEqual("K10", entries[-1].sectionID)
45-
self.assertEqual(["053-751"], [l.document.id for l in entries[-1].links])
45+
self.assertEqual(["053-751"], [link.document.id for link in entries[-1].links])

application/tests/owasp_kubernetes_top10_2025_parser_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ def test_parse(self) -> None:
4343
self.assertEqual("K01", entries[0].sectionID)
4444
self.assertEqual("Insecure Workload Configurations", entries[0].section)
4545
self.assertEqual(
46-
["233-748", "486-813"], [l.document.id for l in entries[0].links]
46+
["233-748", "486-813"], [link.document.id for link in entries[0].links]
4747
)
4848
self.assertEqual("K10", entries[-1].sectionID)
4949
self.assertEqual(
5050
["148-420", "402-706", "843-841"],
51-
[l.document.id for l in entries[-1].links],
51+
[link.document.id for link in entries[-1].links],
5252
)
5353

5454
def test_parse_falls_back_to_2022_mapping_when_2025_links_missing(self) -> None:

application/tests/owasp_llm_top10_2025_parser_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def test_parse(self) -> None:
3838
self.assertEqual("LLM01", entries[0].sectionID)
3939
self.assertEqual("Prompt Injection", entries[0].section)
4040
self.assertEqual(
41-
["161-451", "760-764"], [l.document.id for l in entries[0].links]
41+
["161-451", "760-764"], [link.document.id for link in entries[0].links]
4242
)
43-
self.assertEqual(["064-808"], [l.document.id for l in entries[4].links])
43+
self.assertEqual(["064-808"], [link.document.id for link in entries[4].links])
4444
self.assertEqual("LLM10", entries[-1].sectionID)
45-
self.assertEqual(["623-550"], [l.document.id for l in entries[-1].links])
45+
self.assertEqual(["623-550"], [link.document.id for link in entries[-1].links])

application/utils/external_project_parsers/data/owasp_aisvs_1_0.json

Lines changed: 74 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,131 @@
22
{
33
"section_id": "AISVS1",
44
"section": "Training Data Governance & Bias Management",
5-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C01-Training-Data-Governance.md",
6-
"cre_ids": ["227-045", "307-507"]
5+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C01-Training-Data-Governance.md",
6+
"cre_ids": [
7+
"227-045",
8+
"307-507"
9+
]
710
},
811
{
912
"section_id": "AISVS2",
1013
"section": "User Input Validation",
11-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C02-User-Input-Validation.md",
12-
"cre_ids": ["031-447", "760-764"]
14+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C02-User-Input-Validation.md",
15+
"cre_ids": [
16+
"031-447",
17+
"760-764"
18+
]
1319
},
1420
{
1521
"section_id": "AISVS3",
1622
"section": "Model Lifecycle Management & Change Control",
17-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C03-Model-Lifecycle-Management.md",
18-
"cre_ids": ["148-853", "613-285"]
23+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C03-Model-Lifecycle-Management.md",
24+
"cre_ids": [
25+
"148-853",
26+
"613-285"
27+
]
1928
},
2029
{
2130
"section_id": "AISVS4",
2231
"section": "Infrastructure, Configuration & Deployment Security",
23-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C04-Infrastructure.md",
24-
"cre_ids": ["233-748", "486-813"]
32+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C04-Infrastructure.md",
33+
"cre_ids": [
34+
"233-748",
35+
"486-813"
36+
]
2537
},
2638
{
2739
"section_id": "AISVS5",
2840
"section": "Access Control & Identity for AI Components & Users",
29-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C05-Access-Control-and-Identity.md",
30-
"cre_ids": ["633-428", "724-770"]
41+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C05-Access-Control-and-Identity.md",
42+
"cre_ids": [
43+
"633-428",
44+
"724-770"
45+
]
3146
},
3247
{
3348
"section_id": "AISVS6",
3449
"section": "Supply Chain Security for Models, Frameworks & Data",
35-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C06-Supply-Chain.md",
36-
"cre_ids": ["613-285", "613-287", "863-521"]
50+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C06-Supply-Chain.md",
51+
"cre_ids": [
52+
"613-285",
53+
"613-287",
54+
"863-521"
55+
]
3756
},
3857
{
3958
"section_id": "AISVS7",
4059
"section": "Model Behavior, Output Control & Safety Assurance",
41-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C07-Model-Behavior.md",
42-
"cre_ids": ["064-808", "141-555"]
60+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C07-Model-Behavior.md",
61+
"cre_ids": [
62+
"064-808",
63+
"141-555"
64+
]
4365
},
4466
{
4567
"section_id": "AISVS8",
4668
"section": "Memory, Embeddings & Vector Database Security",
47-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C08-Memory-Embeddings-and-Vector-Database.md",
48-
"cre_ids": ["126-668", "538-770"]
69+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C08-Memory-Embeddings-and-Vector-Database.md",
70+
"cre_ids": [
71+
"126-668",
72+
"538-770"
73+
]
4974
},
5075
{
5176
"section_id": "AISVS9",
5277
"section": "Autonomous Orchestration & Agentic Action Security",
53-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C09-Orchestration-and-Agentic-Action.md",
54-
"cre_ids": ["117-371", "650-560"]
78+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C09-Orchestration-and-Agentic-Action.md",
79+
"cre_ids": [
80+
"117-371",
81+
"650-560"
82+
]
5583
},
5684
{
5785
"section_id": "AISVS10",
5886
"section": "Model Context Protocol (MCP) Security",
59-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C10-MCP-Security.md",
60-
"cre_ids": ["307-507", "715-223"]
87+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C10-MCP-Security.md",
88+
"cre_ids": [
89+
"307-507",
90+
"715-223"
91+
]
6192
},
6293
{
6394
"section_id": "AISVS11",
6495
"section": "Adversarial Robustness & Privacy Defense",
65-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C11-Adversarial-Robustness.md",
66-
"cre_ids": ["141-555", "623-550"]
96+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C11-Adversarial-Robustness.md",
97+
"cre_ids": [
98+
"141-555",
99+
"623-550"
100+
]
67101
},
68102
{
69103
"section_id": "AISVS12",
70104
"section": "Privacy Protection & Personal Data Management",
71-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C12-Privacy.md",
72-
"cre_ids": ["126-668", "227-045", "482-866"]
105+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C12-Privacy.md",
106+
"cre_ids": [
107+
"126-668",
108+
"227-045",
109+
"482-866"
110+
]
73111
},
74112
{
75113
"section_id": "AISVS13",
76114
"section": "Monitoring, Logging & Anomaly Detection",
77-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C13-Monitoring-and-Logging.md",
78-
"cre_ids": ["058-083", "148-420", "402-706", "843-841"]
115+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C13-Monitoring-and-Logging.md",
116+
"cre_ids": [
117+
"058-083",
118+
"148-420",
119+
"402-706",
120+
"843-841"
121+
]
79122
},
80123
{
81124
"section_id": "AISVS14",
82125
"section": "Human Oversight, Accountability & Governance",
83-
"hyperlink": "https://github.com/OWASP/AISVS/tree/main/1.0/en/0x10-C14-Human-Oversight.md",
84-
"cre_ids": ["162-655", "766-162"]
126+
"hyperlink": "https://github.com/OWASP/AISVS/blob/main/1.0/en/0x10-C14-Human-Oversight.md",
127+
"cre_ids": [
128+
"162-655",
129+
"766-162"
130+
]
85131
}
86132
]

0 commit comments

Comments
 (0)