зеркало из https://github.com/github/codeql.git
Add option to filter automodel queries by package.
This commit is contained in:
Родитель
89aa86a1d6
Коммит
9b8d7df370
|
@ -66,6 +66,7 @@ where
|
|||
// modeled in a MaD model, then it doesn't belong to any additional sink types, and we don't need to reexamine it.
|
||||
not CharacteristicsImpl::isSink(endpoint, _, _) and
|
||||
meta.hasMetadata(endpoint, package, type, subtypes, name, signature, input) and
|
||||
automodelCandidateFilter(package) and
|
||||
// The message is the concatenation of all sink types for which this endpoint is known neither to be a sink nor to be
|
||||
// a non-sink, and we surface only endpoints that have at least one such sink type.
|
||||
message =
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/java-queries
|
||||
extensible: automodelCandidatePackageFilter
|
||||
data: []
|
|
@ -30,6 +30,7 @@ where
|
|||
// modeled in a MaD model, then it doesn't belong to any additional sink types, and we don't need to reexamine it.
|
||||
not CharacteristicsImpl::isSink(endpoint, _, _) and
|
||||
meta.hasMetadata(endpoint, package, type, subtypes, name, signature, input, parameterName) and
|
||||
automodelCandidateFilter(package) and
|
||||
// The message is the concatenation of all sink types for which this endpoint is known neither to be a sink nor to be
|
||||
// a non-sink, and we surface only endpoints that have at least one such sink type.
|
||||
message =
|
||||
|
|
|
@ -66,3 +66,22 @@ boolean considerSubtypes(Callable callable) {
|
|||
then result = false
|
||||
else result = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the given package is a candidate for automodeling.
|
||||
*
|
||||
* This predicate is extensible, so that different packages can be selected at runtime.
|
||||
*/
|
||||
extensible predicate automodelCandidatePackageFilter(string package);
|
||||
|
||||
/**
|
||||
* Holds if the given package is a candidate for automodeling.
|
||||
*
|
||||
* This relies on an extensible predicate, and if that is not supplied then
|
||||
* all packages are considered candidates.
|
||||
*/
|
||||
bindingset[package]
|
||||
predicate automodelCandidateFilter(string package) {
|
||||
not automodelCandidatePackageFilter(_) or
|
||||
automodelCandidatePackageFilter(package)
|
||||
}
|
||||
|
|
|
@ -12,4 +12,5 @@ dependencies:
|
|||
codeql/util: ${workspace}
|
||||
dataExtensions:
|
||||
- Telemetry/ExtractorInformation.yml
|
||||
- Telemetry/AutomodelCandidateFilter.yml
|
||||
warnOnImplicitThis: true
|
||||
|
|
Загрузка…
Ссылка в новой задаче