Skip to content

Commit 03b8e64

Browse files
committed
Filter endpoints by confidence
Select endpoints to score at inference time base purely on their confidence level, and not on whether they fit the historical definition of endpoint filters.
1 parent 1c9545e commit 03b8e64

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/ATMConfig.qll

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,18 @@ abstract class AtmConfig extends string {
8080
// characteristics that are specific to this sink type.
8181
// TODO: Experiment with excluding all endpoints that have a medium- or high-confidence characteristic that implies
8282
// they're not sinks for this sink type (or not sinks for any sink type), not just the EndpointFilterCharacteristics.
83-
exists(EndpointCharacteristics::StandardEndpointFilterCharacteristic standardFilter |
84-
standardFilter.getEndpoints(candidateSink) and
85-
result = standardFilter
86-
)
87-
or
88-
exists(EndpointCharacteristics::EndpointFilterCharacteristic specificFilter |
89-
specificFilter.getEndpoints(candidateSink) and
90-
specificFilter.getImplications(this.getASinkEndpointType(), false, _) and
91-
result = specificFilter
83+
exists(EndpointCharacteristics::EndpointCharacteristic filter, float confidence |
84+
filter.getEndpoints(candidateSink) and
85+
confidence >= filter.mediumConfidence() and
86+
confidence < filter.highConfidence() and
87+
(
88+
// Exclude endpoints that have a characteristic that implies they're not sinks for _any_ sink type.
89+
filter.getImplications(any(NegativeType negative), true, confidence)
90+
or
91+
// Exclude endpoints that have a characteristic that implies they're not sinks for _this particular_ sink type.
92+
filter.getImplications(this.getASinkEndpointType(), false, confidence)
93+
) and
94+
result = filter
9295
)
9396
}
9497

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointCharacteristics.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ abstract class EndpointFilterCharacteristic extends EndpointCharacteristic {
462462
* An EndpointFilterCharacteristic that indicates that an endpoint is unlikely to be a sink of any type.
463463
* Replaces https://github.com/github/codeql/blob/387e57546bf7352f7c1cfe781daa1a3799b7063e/javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/StandardEndpointFilters.qll#LL15C24-L15C24
464464
*/
465-
abstract class StandardEndpointFilterCharacteristic extends EndpointFilterCharacteristic {
465+
abstract private class StandardEndpointFilterCharacteristic extends EndpointFilterCharacteristic {
466466
bindingset[this]
467467
StandardEndpointFilterCharacteristic() { any() }
468468

0 commit comments

Comments
 (0)