mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Add queries for extracting hand written MaD models.
This commit is contained in:
17
csharp/ql/src/utils/modelconverter/ExtractSinks.ql
Normal file
17
csharp/ql/src/utils/modelconverter/ExtractSinks.ql
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* @name Extract MaD sink model rows.
|
||||||
|
* @description This extracts the Models as data sink model rows.
|
||||||
|
* @id cs/utils/modelconverter/generate-data-extensions-sink
|
||||||
|
*/
|
||||||
|
|
||||||
|
import csharp
|
||||||
|
import semmle.code.csharp.dataflow.ExternalFlow
|
||||||
|
|
||||||
|
from
|
||||||
|
string namespace, string type, boolean subtypes, string name, string signature, string ext,
|
||||||
|
string input, string kind, string provenance
|
||||||
|
where
|
||||||
|
sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance) and
|
||||||
|
provenance != "generated"
|
||||||
|
select namespace, type, subtypes, name, signature, ext, input, kind, provenance order by
|
||||||
|
namespace, type, name, signature, input, kind
|
||||||
17
csharp/ql/src/utils/modelconverter/ExtractSources.ql
Normal file
17
csharp/ql/src/utils/modelconverter/ExtractSources.ql
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* @name Extract MaD source model rows.
|
||||||
|
* @description This extracts the Models as data source model rows.
|
||||||
|
* @id cs/utils/modelconverter/generate-data-extensions-source
|
||||||
|
*/
|
||||||
|
|
||||||
|
import csharp
|
||||||
|
import semmle.code.csharp.dataflow.ExternalFlow
|
||||||
|
|
||||||
|
from
|
||||||
|
string namespace, string type, boolean subtypes, string name, string signature, string ext,
|
||||||
|
string output, string kind, string provenance
|
||||||
|
where
|
||||||
|
sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance) and
|
||||||
|
provenance != "generated"
|
||||||
|
select namespace, type, subtypes, name, signature, ext, output, kind, provenance order by
|
||||||
|
namespace, type, name, signature, output, kind
|
||||||
17
csharp/ql/src/utils/modelconverter/ExtractSummaries.ql
Normal file
17
csharp/ql/src/utils/modelconverter/ExtractSummaries.ql
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* @name Extract MaD summary model rows.
|
||||||
|
* @description This extracts the Models as data summary model rows.
|
||||||
|
* @id cs/utils/modelconverter/generate-data-extensions-summary
|
||||||
|
*/
|
||||||
|
|
||||||
|
import csharp
|
||||||
|
import semmle.code.csharp.dataflow.ExternalFlow
|
||||||
|
|
||||||
|
from
|
||||||
|
string namespace, string type, boolean subtypes, string name, string signature, string ext,
|
||||||
|
string input, string output, string kind, string provenance
|
||||||
|
where
|
||||||
|
summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance) and
|
||||||
|
provenance != "generated"
|
||||||
|
select namespace, type, subtypes, name, signature, ext, input, output, kind, provenance order by
|
||||||
|
namespace, type, name, signature, input, output, kind
|
||||||
Reference in New Issue
Block a user