Skip to content

Commit c0cc754

Browse files
committed
Rename ClassificationReasons
Change the name to EndpointCharacteristics.
1 parent a4939b9 commit c0cc754

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
private import javascript as JS
88
import EndpointTypes
9-
import ClassificationReasons
9+
import EndpointCharacteristics
1010

1111
/**
1212
* EXPERIMENTAL. This API may change in the future.
@@ -46,11 +46,11 @@ abstract class AtmConfig extends string {
4646
* Holds if `sink` is a known sink of flow.
4747
*/
4848
predicate isKnownSink(JS::DataFlow::Node sink) {
49-
// If the list of reasons includes positive indicators with maximal confidence for this class, it's a known sink for
50-
// the class.
51-
exists(ClassificationReason reason |
52-
reason.getEndpoints(sink) and
53-
reason.getImplications(this.getASinkEndpointType(), true, 1.0)
49+
// If the list of characteristics includes positive indicators with maximal confidence for this class, then it's a
50+
// known sink for the class.
51+
exists(EndpointCharacteristic characteristic |
52+
characteristic.getEndpoints(sink) and
53+
characteristic.getImplications(this.getASinkEndpointType(), true, 1.0)
5454
)
5555
}
5656

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ private import semmle.javascript.security.dataflow.DomBasedXssCustomizations
1212
private import semmle.javascript.security.dataflow.NosqlInjectionCustomizations
1313
private import semmle.javascript.security.dataflow.TaintedPathCustomizations
1414

15-
abstract class ClassificationReason extends string {
16-
// The name of the reason, which should describe some characteristic of the endpoint that is meaningful for
15+
abstract class EndpointCharacteristic extends string {
16+
// The name of the characteristic, which should describe some characteristic of the endpoint that is meaningful for
1717
// determining whether it's a sink and if so of which type
1818
bindingset[this]
19-
ClassificationReason() { any() }
19+
EndpointCharacteristic() { any() }
2020

2121
// Indicators with confidence at or above this threshold are considered to be high-confidence indicators.
2222
float getHighConfidenceThreshold() { result = 0.8 }
2323

2424
// Indicators with confidence at or above this threshold are considered to be medium-confidence indicators.
2525
float getMediumConfidenceThreshold() { result = 0.5 }
2626

27-
// The logic to identify which endpoints have this reason.
27+
// The logic to identify which endpoints have this characteristic.
2828
abstract predicate getEndpoints(DataFlow::Node n);
2929

30-
// This predicate describes what the reason tells us about an endpoint.
30+
// This predicate describes what the characteristic tells us about an endpoint.
3131
//
3232
// Params:
3333
// endpointClass: Class 0 is the negative class. Each positive int corresponds to a single sink type.
34-
// isPositiveIndicator: Does this reason indicate this endpoint _is_ a member of the class, or that it _isn't_ a
35-
// member of the class?
36-
// confidence: A number in [0, 1], which tells us how strong an indicator this reason is for the endpoint belonging /
37-
// not belonging to the given class.
34+
// isPositiveIndicator: Does this characteristic indicate this endpoint _is_ a member of the class, or that it
35+
// _isn't_ a member of the class?
36+
// confidence: A number in [0, 1], which tells us how strong an indicator this characteristic is for the endpoint
37+
// belonging / not belonging to the given class.
3838
abstract predicate getImplications(
3939
EndpointType endpointClass, boolean isPositiveIndicator, float confidence
4040
);
@@ -45,8 +45,8 @@ abstract class ClassificationReason extends string {
4545
* confidence.
4646
*/
4747

48-
class DomBasedXssSinkReason extends ClassificationReason {
49-
DomBasedXssSinkReason() { this = "DomBasedXssSink" }
48+
class DomBasedXssSinkCharacteristic extends EndpointCharacteristic {
49+
DomBasedXssSinkCharacteristic() { this = "DomBasedXssSink" }
5050

5151
override predicate getEndpoints(DataFlow::Node n) { n instanceof DomBasedXss::Sink }
5252

@@ -62,8 +62,8 @@ class DomBasedXssSinkReason extends ClassificationReason {
6262
* maximal confidence.
6363
*/
6464

65-
class TaintedPathSinkReason extends ClassificationReason {
66-
TaintedPathSinkReason() { this = "TaintedPathSink" }
65+
class TaintedPathSinkCharacteristic extends EndpointCharacteristic {
66+
TaintedPathSinkCharacteristic() { this = "TaintedPathSink" }
6767

6868
override predicate getEndpoints(DataFlow::Node n) { n instanceof TaintedPath::Sink }
6969

@@ -79,8 +79,8 @@ class TaintedPathSinkReason extends ClassificationReason {
7979
* maximal confidence.
8080
*/
8181

82-
class SqlInjectionSinkReason extends ClassificationReason {
83-
SqlInjectionSinkReason() { this = "SqlInjectionSink" }
82+
class SqlInjectionSinkCharacteristic extends EndpointCharacteristic {
83+
SqlInjectionSinkCharacteristic() { this = "SqlInjectionSink" }
8484

8585
override predicate getEndpoints(DataFlow::Node n) { n instanceof SqlInjection::Sink }
8686

@@ -98,8 +98,8 @@ class SqlInjectionSinkReason extends ClassificationReason {
9898
* with maximal confidence.
9999
*/
100100

101-
class NosqlInjectionSinkReason extends ClassificationReason {
102-
NosqlInjectionSinkReason() { this = "NosqlInjectionSink" }
101+
class NosqlInjectionSinkCharacteristic extends EndpointCharacteristic {
102+
NosqlInjectionSinkCharacteristic() { this = "NosqlInjectionSink" }
103103

104104
override predicate getEndpoints(DataFlow::Node n) { n instanceof NosqlInjection::Sink }
105105

0 commit comments

Comments
 (0)