update mapping and encoding queries according to proposal

This commit is contained in:
tombolton
2022-03-21 12:28:29 +00:00
parent 0122e50ade
commit d1eb15387e
3 changed files with 15 additions and 13 deletions

View File

@@ -23,7 +23,7 @@ abstract class EndpointType extends TEndpointType {
/** The `NotASink` class that can be predicted by endpoint scoring models. */
class NotASinkType extends EndpointType, TNotASinkType {
override string getDescription() { result = "NotASink" }
override string getDescription() { result = "Negative" }
override int getEncoding() { result = 0 }
}

View File

@@ -8,5 +8,4 @@
import experimental.adaptivethreatmodeling.EndpointTypes
from EndpointType type
select type.getEncoding() as encodingTypeEncoded, type.getDescription() as endpointType order by
encodingTypeEncoded
select type.getEncoding() as label, type.getDescription() as labelName order by label

View File

@@ -12,37 +12,40 @@ import experimental.adaptivethreatmodeling.StoredXssATM as StoredXssATM
import experimental.adaptivethreatmodeling.XssThroughDomATM as XssThroughDomATM
import experimental.adaptivethreatmodeling.AdaptiveThreatModeling
from string queryName, ATMConfig c, int endpointTypeEncoded
from string queryName, ATMConfig c, int label
where
(
queryName = "Unknown" and
endpointTypeEncoded = 0
label = 0
or
queryName = "NotASink" and
endpointTypeEncoded = 0
label = 0
or
queryName = "LikelyNotASink" and
label = 0
or
queryName = "XssSink" and
c instanceof XssATM::DomBasedXssATMConfig and
endpointTypeEncoded = c.getASinkEndpointType().getEncoding()
label = c.getASinkEndpointType().getEncoding()
or
queryName = "StoredXssSink" and
c instanceof StoredXssATM::StoredXssATMConfig and
endpointTypeEncoded = c.getASinkEndpointType().getEncoding()
label = c.getASinkEndpointType().getEncoding()
or
queryName = "XssThroughDomSink" and
c instanceof XssThroughDomATM::XssThroughDOMATMConfig and
endpointTypeEncoded = c.getASinkEndpointType().getEncoding()
label = c.getASinkEndpointType().getEncoding()
or
queryName = "SqlInjectionSink" and
c instanceof SqlInjectionATM::SqlInjectionATMConfig and
endpointTypeEncoded = c.getASinkEndpointType().getEncoding()
label = c.getASinkEndpointType().getEncoding()
or
queryName = "NosqlInjectionSink" and
c instanceof NosqlInjectionATM::NosqlInjectionATMConfig and
endpointTypeEncoded = c.getASinkEndpointType().getEncoding()
label = c.getASinkEndpointType().getEncoding()
or
queryName = "TaintedPathSink" and
c instanceof TaintedPathATM::TaintedPathATMConfig and
endpointTypeEncoded = c.getASinkEndpointType().getEncoding()
label = c.getASinkEndpointType().getEncoding()
)
select queryName, endpointTypeEncoded order by endpointTypeEncoded
select queryName, label order by label