Skip to content

Commit 6f3b754

Browse files
authored
Merge pull request #23076 from github/nickrolfe/json-data-extensions-python
Python: convert data extensions to JSON
2 parents fa0ee2c + cc48290 commit 6f3b754

53 files changed

Lines changed: 59410 additions & 176218 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎config/identical-files.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@
266266
"java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll"
267267
],
268268
"Python model summaries test extension": [
269-
"python/ql/test/library-tests/dataflow/model-summaries/InlineTaintTest.ext.yml",
270-
"python/ql/test/library-tests/dataflow/model-summaries/NormalDataflowTest.ext.yml"
269+
"python/ql/test/library-tests/dataflow/model-summaries/InlineTaintTest.ext.json",
270+
"python/ql/test/library-tests/dataflow/model-summaries/NormalDataflowTest.ext.json"
271271
],
272272
"XML discard predicates": [
273273
"javascript/ql/lib/semmle/javascript/internal/OverlayXml.qll",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extensions": [
3+
{
4+
"addsTo": {
5+
"pack": "codeql/threat-models",
6+
"extensible": "threatModelConfiguration"
7+
},
8+
"data": [
9+
// Since responses are enabled by default in the shared threat-models configuration,
10+
// we need to disable it here to keep existing behavior for the python analysis.
11+
["response", false, -2147483647]
12+
]
13+
}
14+
]
15+
}

‎python/ql/lib/ext/default-threat-models-fixup.model.yml‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎python/ql/lib/qlpack.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ dependencies:
1818
dataExtensions:
1919
- semmle/python/frameworks/**/*.model.yml
2020
- ext/*.model.yml
21+
- semmle/python/frameworks/**/*.model.json
22+
- ext/*.model.json
2123
warnOnImplicitThis: true
2224
compileForOverlayEval: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extensions": [
3+
{
4+
"addsTo": {
5+
"pack": "codeql/python-all",
6+
"extensible": "barrierGuardModel"
7+
},
8+
"data": [
9+
["AntiSSRF", "Member[URIValidator].Member[in_domain,in_azure_keyvault_domain,in_azure_storage_domain].Argument[0]", "true", "request-forgery"]
10+
]
11+
}
12+
]
13+
}

‎python/ql/lib/semmle/python/frameworks/AntiSSRF.model.yml‎

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"extensions": [
3+
{
4+
"addsTo": {
5+
"pack": "codeql/python-all",
6+
"extensible": "sinkModel"
7+
},
8+
"data": [
9+
// `Connection`s and `ConnectionPool`s provide some methods that execute SQL.
10+
["asyncpg.~Connection", "Member[copy_from_query,execute,fetch,fetchrow,fetchval].Argument[0,query:]", "sql-injection"],
11+
["asyncpg.~Connection", "Member[executemany].Argument[0,command:]", "sql-injection"],
12+
// A model of `Connection` and `ConnectionPool`, which provide some methods that access the file system.
13+
["asyncpg.~Connection", "Member[copy_from_query,copy_from_table].Argument[output:]", "path-injection"],
14+
["asyncpg.~Connection", "Member[copy_to_table].Argument[source:]", "path-injection"],
15+
// the `PreparedStatement` class in `asyncpg`.
16+
["asyncpg.Connection", "Member[prepare].Argument[0,query:]", "sql-injection"]
17+
]
18+
},
19+
{
20+
"addsTo": {
21+
"pack": "codeql/python-all",
22+
"extensible": "typeModel"
23+
},
24+
"data": [
25+
// a `ConnectionPool` that is created when the result of `asyncpg.create_pool()` is awaited.
26+
["asyncpg.Connection", "asyncpg.ConnectionPool", "Member[acquire].ReturnValue.Awaited"],
27+
// a `Connection` that is created when
28+
// * - the result of `asyncpg.connect()` is awaited.
29+
// * - the result of calling `acquire` on a `ConnectionPool` is awaited.
30+
["asyncpg.Connection", "asyncpg", "Member[connect].ReturnValue.Awaited"],
31+
["asyncpg.Connection", "asyncpg", "Member[connection].Member[connect].ReturnValue.Awaited"],
32+
["asyncpg.ConnectionPool", "asyncpg", "Member[create_pool].ReturnValue.Awaited"],
33+
// Creating an internal `~Connection` type that contains both `Connection` and `ConnectionPool`.
34+
["asyncpg.~Connection", "asyncpg.Connection", ""],
35+
["asyncpg.~Connection", "asyncpg.ConnectionPool", ""]
36+
]
37+
}
38+
]
39+
}

‎python/ql/lib/semmle/python/frameworks/Asyncpg.model.yml‎

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extensions": [
3+
{
4+
"addsTo": {
5+
"pack": "codeql/python-all",
6+
"extensible": "sinkModel"
7+
},
8+
"data": [
9+
["azure.keyvault.certificates.CertificateClient!", "Call.Argument[0,vault_url:]", "request-forgery"],
10+
["azure.keyvault.certificates.DeletedCertificate!", "Call.Argument[recovery_id:]", "request-forgery"],
11+
["azure.keyvault.keys.KeyClient!", "Call.Argument[0,vault_url:]", "request-forgery"],
12+
["azure.keyvault.secrets.SecretClient!", "Call.Argument[0,vault_url:]", "request-forgery"]
13+
]
14+
}
15+
]
16+
}

‎python/ql/lib/semmle/python/frameworks/Azure.Keyvault.model.yml‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)