-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtemplate.yaml
80 lines (69 loc) · 2.18 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Metadata:
AWS::ServerlessRepo::Application:
Name: Serverless-Goat-Java
Description: 'Serverless Goat Java is an intentionally vulnerable serverless application containing instances of eight of the ten most critical serverless application vulnerabilities for security training purposes.'
Author: Manuel Benz
SpdxLicenseId: AGPL-3.0-only
LicenseUrl: LICENSE
ReadmeUrl: README.md
Labels: ['Serverless', 'Security', 'AWS', 'ServerlessGoat', 'Lambda']
HomePageUrl: https://codeshield.io/blog/2020/11/06/serverless_goat_repo/
SemanticVersion: 1.0.0
SourceCodeUrl: https://github.com/CodeShield-Security/Serverless-Goat-Java
Globals:
Function:
MemorySize: 3008
Timeout: 10
Resources:
FunctionFrontend:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs12.x
Handler: index.handler
CodeUri: src/main/js/
ReservedConcurrentExecutions: 5
Events:
ApiConvert:
Type: Api
Properties:
Path: /
Method: get
FunctionConvert:
Type: AWS::Serverless::Function
Properties:
Runtime: java8
Handler: de.codeshield.cloudscan.serverlessGoatJava.App::handleRequest
CodeUri: ./
ReservedConcurrentExecutions: 5
Environment:
Variables:
HOME: /var/task
TABLE_NAME: !Ref Table
BUCKET_NAME: !Ref Bucket
BUCKET_URL: !GetAtt Bucket.WebsiteURL
Events:
ApiConvert:
Type: Api
Properties:
Path: /api/convert
Method: get
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref Table
- S3FullAccessPolicy:
BucketName: !Ref Bucket
Table:
Type: AWS::Serverless::SimpleTable
Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: index.html
Outputs:
WebsiteURL:
Description: 'Website URL'
Value: !Sub 'https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/${ServerlessRestApi.Stage}/'