JS: Autoformat

This commit is contained in:
Henry Mercer
2022-02-01 16:04:44 +00:00
parent 368839edfc
commit 14601316a5
13 changed files with 26 additions and 6 deletions

View File

@@ -55,7 +55,8 @@ string getDescriptionForAlert(DataFlow::Node sourceCandidate, DataFlow::Node sin
result =
concat(Query query |
|
query.getName() + ": " + getDescriptionForAlertCandidate(sourceCandidate, sinkCandidate, query), ", "
query.getName() + ": " +
getDescriptionForAlertCandidate(sourceCandidate, sinkCandidate, query), ", "
)
}

View File

@@ -19,7 +19,9 @@ import experimental.adaptivethreatmodeling.EndpointScoring::ModelScoring as Mode
class FunctionArgumentFeaturizationConfig extends FeaturizationConfig {
FunctionArgumentFeaturizationConfig() { this = "FunctionArgumentFeaturization" }
override DataFlow::Node getAnEndpointToFeaturize() { exists(DataFlow::CallNode call | result = call.getAnArgument()) }
override DataFlow::Node getAnEndpointToFeaturize() {
exists(DataFlow::CallNode call | result = call.getAnArgument())
}
}
query predicate endpointScores = ModelScoring::endpointScores/3;

View File

@@ -13,4 +13,4 @@ external predicate availableMlModels(
string modelChecksum, string modelLanguage, string modelName, string modelType
);
select any(string checksum | availableMlModels(checksum, "javascript",_ ,_))
select any(string checksum | availableMlModels(checksum, "javascript", _, _))

View File

@@ -2,12 +2,13 @@
* For internal use only.
*
* [DEPRECATED] Counts alerts and sinks for JavaScript security queries.
*
*
* This query is deprecated due to the performance implications of bringing in data flow
* configurations from multiple queries. Instead use `CountSourcesAndSinks.ql` to count sinks for
* JavaScript security queries, and count alerts by running the standard or evaluation queries for
* each security vulnerability.
*/
import semmle.javascript.security.dataflow.NosqlInjection
import semmle.javascript.security.dataflow.SqlInjection
import semmle.javascript.security.dataflow.TaintedPath

View File

@@ -3,6 +3,7 @@
*
* Defines files that should be excluded from the evaluation of ML models.
*/
private import javascript
private import semmle.javascript.filters.ClassifyFiles as ClassifyFiles

View File

@@ -3,6 +3,7 @@
*
* Extracts training and evaluation data we can use to train ML models for ML-powered queries.
*/
import ExtractEndpointData as ExtractEndpointData
query predicate endpoints = ExtractEndpointData::endpoints/5;

View File

@@ -4,6 +4,7 @@
* Library code for training and evaluation data we can use to train ML models for ML-powered
* queries.
*/
import javascript
import Exclusions as Exclusions
import evaluation.EndToEndEvaluation as EndToEndEvaluation

View File

@@ -3,6 +3,7 @@
*
* Extracts evaluation data we can use to evaluate ML models for ML-powered queries.
*/
import javascript
import ExtractEndpointData as ExtractEndpointData

View File

@@ -3,6 +3,7 @@
*
* Extracts training data we can use to train ML models for ML-powered queries.
*/
import javascript
import ExtractEndpointData as ExtractEndpointData

View File

@@ -3,6 +3,7 @@
*
* Query for finding misclassified endpoints which we can use to debug ML-powered queries.
*/
import javascript
import experimental.adaptivethreatmodeling.AdaptiveThreatModeling
import experimental.adaptivethreatmodeling.ATMConfig

View File

@@ -4,7 +4,11 @@
* Labels used in training and evaluation data to indicate knowledge about whether an endpoint is a
* sink for a particular security query.
*/
newtype TEndpointLabel = TSinkLabel() or TNotASinkLabel() or TUnknownLabel()
newtype TEndpointLabel =
TSinkLabel() or
TNotASinkLabel() or
TUnknownLabel()
abstract class EndpointLabel extends TEndpointLabel {
abstract string getEncoding();

View File

@@ -1,6 +1,7 @@
/*
* For internal use only.
*/
private import experimental.adaptivethreatmodeling.FeaturizationConfig
/**

View File

@@ -3,7 +3,12 @@
*
* Represents the security queries for which we currently have ML-powered versions.
*/
newtype TQuery = TNosqlInjectionQuery() or TSqlInjectionQuery() or TTaintedPathQuery() or TXssQuery()
newtype TQuery =
TNosqlInjectionQuery() or
TSqlInjectionQuery() or
TTaintedPathQuery() or
TXssQuery()
abstract class Query extends TQuery {
abstract string getName();