Skip to content

Commit eacfceb

Browse files
author
Anna Railton
authored
Merge pull request github#8605 from github/annarailton/new-query-label-mappings
Experimental (ATM): update query label mappings
2 parents 2a4d65f + 9c25da2 commit eacfceb

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* representation of each of these classes.
77
*/
88
newtype TEndpointType =
9-
TNotASinkType() or
9+
TNegativeType() or
1010
TXssSinkType() or
1111
TNosqlInjectionSinkType() or
1212
TSqlInjectionSinkType() or
@@ -21,9 +21,9 @@ abstract class EndpointType extends TEndpointType {
2121
string toString() { result = getDescription() }
2222
}
2323

24-
/** The `NotASink` class that can be predicted by endpoint scoring models. */
25-
class NotASinkType extends EndpointType, TNotASinkType {
26-
override string getDescription() { result = "NotASink" }
24+
/** The `Negative` class that can be predicted by endpoint scoring models. */
25+
class NegativeType extends EndpointType, TNegativeType {
26+
override string getDescription() { result = "Negative" }
2727

2828
override int getEncoding() { result = 0 }
2929
}

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointLabelEncoding.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
import experimental.adaptivethreatmodeling.EndpointTypes
99

1010
from EndpointType type
11-
select type.getEncoding() as encoding, type.getDescription() as description order by encoding
11+
select type.getEncoding() as label, type.getDescription() as labelName order by label

javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/extraction/ExtractEndpointMapping.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import experimental.adaptivethreatmodeling.AdaptiveThreatModeling
1313
from string queryName, AtmConfig c, EndpointType e
1414
where
1515
(
16-
queryName = "SqlInjectionATM.ql" and
16+
queryName = "SqlInjection" and
1717
c instanceof SqlInjectionATM::SqlInjectionAtmConfig
1818
or
19-
queryName = "NosqlInjectionATM.ql" and
19+
queryName = "NosqlInjection" and
2020
c instanceof NosqlInjectionATM::NosqlInjectionAtmConfig
2121
or
22-
queryName = "TaintedPathInjectionATM.ql" and
22+
queryName = "TaintedPathInjection" and
2323
c instanceof TaintedPathATM::TaintedPathAtmConfig
2424
or
25-
queryName = "XssATM.ql" and c instanceof XssATM::DomBasedXssAtmConfig
25+
queryName = "Xss" and c instanceof XssATM::DomBasedXssAtmConfig
2626
) and
2727
e = c.getASinkEndpointType()
28-
select queryName, e.getEncoding() as endpointTypeEncoded
28+
select queryName, e.getEncoding() as label
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| 0 | Negative |
2+
| 1 | XssSink |
3+
| 2 | NosqlInjectionSink |
4+
| 3 | SqlInjectionSink |
5+
| 4 | TaintedPathSink |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extraction/ExtractEndpointLabelEncoding.ql

javascript/ql/experimental/adaptivethreatmodeling/test/query_mappings/index.js

Whitespace-only changes.

0 commit comments

Comments
 (0)