Skip to content

Commit 99bc050

Browse files
yoffRasmusWL
andauthored
Update shared/yaml/codeql/serverless/ServerLess.qll
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 957c0d6 commit 99bc050

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared/yaml/codeql/serverless/ServerLess.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ module ServerLess<Input I> {
109109
File ymlFile, string framework, string handler, string codeUri, string runtime
110110
) {
111111
exists(YamlMapping resource | ymlFile = resource.getFile() |
112-
// There exists at least "AWS::Serverless::Function" and "Aliyun::Serverless::Function"
112+
// Official AWS API uses "AWS::Serverless::Function" but we've seen that Aliyun uses the same schema ("Aliyun::Serverless::Function"), so we allow any prefix to be used.
113+
// Note that "AWS::Serverless::Function" expands to a "AWS::Lambda::Function" when deployed (described here: https://github.com/aws/serverless-application-model#getting-started). Also note that a "AWS::Lambda::Function" requires code in its definition, so needs different handling (see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html)
113114
resource.lookup("Type").(YamlScalar).getValue().regexpMatch(".*::Serverless::Function") and
114115
framework = lookupValue(resource, "Type") and
115116
exists(YamlMapping properties | properties = resource.lookup("Properties") |

0 commit comments

Comments
 (0)