Skip to content

Commit 3a5ef94

Browse files
committed
Scala 3rd party Code Scanning GiHub Advanced Security Example
1 parent 130631a commit 3a5ef94

25 files changed

+787
-2
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "[3.0.x] "
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
target-branch: "2.9.x"
14+
commit-message:
15+
prefix: "[2.9.x] "

.github/mergify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends: .github

.github/scala-steward.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pullRequests.frequency = "@monthly"
2+
3+
commits.message = "[3.0.x] ${artifactName} ${nextVersion} (was ${currentVersion})"
4+
5+
pullRequests.grouping = [
6+
{ name = "patches", "title" = "[3.0.x] Patch updates", "filter" = [{"version" = "patch"}] }
7+
]
8+
9+
updates.pin = [
10+
{ groupId = "org.playframework", artifactId = "play-ahc-ws", version = "3.0." },
11+
{ groupId = "org.playframework", artifactId = "play-pekko-http-server", version = "3.0." },
12+
{ groupId = "org.playframework", artifactId = "play-filters-helpers", version = "3.0." },
13+
{ groupId = "org.playframework", artifactId = "play-guice", version = "3.0." },
14+
{ groupId = "org.playframework", artifactId = "play-logback", version = "3.0." },
15+
{ groupId = "org.playframework", artifactId = "play-server", version = "3.0." },
16+
{ groupId = "org.playframework", artifactId = "play-test", version = "3.0." },
17+
{ groupId = "org.playframework", artifactId = "sbt-plugin", version = "3.0." }
18+
]

.github/workflows/build-test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
6+
push:
7+
branches:
8+
- 3.0.x # Check branch after merge
9+
10+
concurrency:
11+
# Only run once for latest commit per ref and cancel other (previous) runs.
12+
group: ci-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
tests:
17+
name: Tests
18+
uses: playframework/.github/.github/workflows/cmd.yml@v3
19+
with:
20+
java: 17, 11
21+
scala: 2.13.x, 3.x
22+
cmd: sbt ++$MATRIX_SCALA test
23+
24+
finish:
25+
name: Finish
26+
if: github.event_name == 'pull_request'
27+
needs: # Should be last
28+
- "tests"
29+
uses: playframework/.github/.github/workflows/rtm.yml@v3

.github/workflows/codacy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Codacy Security Scan
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
codacy-security-scan:
11+
name: Codacy Security Scan
12+
runs-on: ubuntu-latest
13+
permissions:
14+
actions: read
15+
contents: read
16+
security-events: write
17+
18+
steps:
19+
# Step to checkout the code from the repository
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
# Step to run Codacy Analysis CLI
24+
- name: Run Codacy Analysis CLI
25+
uses: codacy/codacy-analysis-cli-action@v4.4.5
26+
with:
27+
output: results.sarif
28+
format: sarif
29+
gh-code-scanning-compat: true
30+
max-allowed-issues: 2147483647 # Force 0 exit code to allow SARIF file generation
31+
run-docker-tools: "true"
32+
33+
# Step to upload the SARIF file generated in the previous step
34+
- name: Upload SARIF results file
35+
uses: github/codeql-action/upload-sarif@v3
36+
with:
37+
sarif_file: results.sarif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Dependency Graph
2+
on:
3+
push:
4+
branches:
5+
- 3.0.x
6+
7+
concurrency:
8+
# Only run once for latest commit per ref and cancel other (previous) runs.
9+
group: dependency-graph-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: write # this permission is needed to submit the dependency graph
14+
15+
jobs:
16+
dependency-graph:
17+
name: Submit dependencies to GitHub
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
ref: ${{ inputs.ref }}
24+
- uses: scalacenter/sbt-dependency-submission@v3

.github/workflows/scala_spotbugs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation. Updated
5+
name: SpotBugs with FindSecBugs
6+
7+
on:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
branches: [main]
12+
13+
jobs:
14+
spotbugs:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
# this needs to be appropriately configured for your project
24+
- name: Setup Java
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: "microsoft"
28+
java-version: 11
29+
- name: Setup sbt
30+
uses: sbt/setup-sbt@v1
31+
# do your build steps. This example uses sbt
32+
- name: Publish locally with sbt
33+
run: sbt publishLocal
34+
# now run SpotBugs and upload the results to Code Scanning
35+
- name: Run SpotBugs with FindSecBugs
36+
uses: advanced-security/spotbugs-findsecbugs-action@main
37+
with:
38+
# set these appropriately for your project - the defaults are shown here for context
39+
spotbugs_target: "target/scala-2.13" # cannot have globs
40+
path_prefix: "app/"
41+
# spotbugs_filename_glob: '*.jar'
42+
# upload_sarif: 'true'
43+
# no_cache: 'false'
44+
# spotbugs_version: '4.7.3'
45+
# findsecbugs_version: '1.12.0'
46+
# java_distribution: 'microsoft'
47+
# java_version: '11'

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*.fpr
2+
/*.log
3+
logs
4+
target/
5+
tmp
6+
.history
7+
dist
8+
/.idea
9+
/*.iml
10+
/out
11+
/.idea_modules
12+
/.classpath
13+
/.project
14+
/RUNNING_PID
15+
/.settings
16+
/.bsp

LICENSE

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
CC0 1.0 Universal
2+
3+
Statement of Purpose
4+
5+
The laws of most jurisdictions throughout the world automatically confer
6+
exclusive Copyright and Related Rights (defined below) upon the creator and
7+
subsequent owner(s) (each and all, an "owner") of an original work of
8+
authorship and/or a database (each, a "Work").
9+
10+
Certain owners wish to permanently relinquish those rights to a Work for the
11+
purpose of contributing to a commons of creative, cultural and scientific
12+
works ("Commons") that the public can reliably and without fear of later
13+
claims of infringement build upon, modify, incorporate in other works, reuse
14+
and redistribute as freely as possible in any form whatsoever and for any
15+
purposes, including without limitation commercial purposes. These owners may
16+
contribute to the Commons to promote the ideal of a free culture and the
17+
further production of creative, cultural and scientific works, or to gain
18+
reputation or greater distribution for their Work in part through the use and
19+
efforts of others.
20+
21+
For these and/or other purposes and motivations, and without any expectation
22+
of additional consideration or compensation, the person associating CC0 with a
23+
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
24+
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
25+
and publicly distribute the Work under its terms, with knowledge of his or her
26+
Copyright and Related Rights in the Work and the meaning and intended legal
27+
effect of CC0 on those rights.
28+
29+
1. Copyright and Related Rights. A Work made available under CC0 may be
30+
protected by copyright and related or neighboring rights ("Copyright and
31+
Related Rights"). Copyright and Related Rights include, but are not limited
32+
to, the following:
33+
34+
i. the right to reproduce, adapt, distribute, perform, display, communicate,
35+
and translate a Work;
36+
37+
ii. moral rights retained by the original author(s) and/or performer(s);
38+
39+
iii. publicity and privacy rights pertaining to a person's image or likeness
40+
depicted in a Work;
41+
42+
iv. rights protecting against unfair competition in regards to a Work,
43+
subject to the limitations in paragraph 4(a), below;
44+
45+
v. rights protecting the extraction, dissemination, use and reuse of data in
46+
a Work;
47+
48+
vi. database rights (such as those arising under Directive 96/9/EC of the
49+
European Parliament and of the Council of 11 March 1996 on the legal
50+
protection of databases, and under any national implementation thereof,
51+
including any amended or successor version of such directive); and
52+
53+
vii. other similar, equivalent or corresponding rights throughout the world
54+
based on applicable law or treaty, and any national implementations thereof.
55+
56+
2. Waiver. To the greatest extent permitted by, but not in contravention of,
57+
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
58+
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
59+
and Related Rights and associated claims and causes of action, whether now
60+
known or unknown (including existing as well as future claims and causes of
61+
action), in the Work (i) in all territories worldwide, (ii) for the maximum
62+
duration provided by applicable law or treaty (including future time
63+
extensions), (iii) in any current or future medium and for any number of
64+
copies, and (iv) for any purpose whatsoever, including without limitation
65+
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
66+
the Waiver for the benefit of each member of the public at large and to the
67+
detriment of Affirmer's heirs and successors, fully intending that such Waiver
68+
shall not be subject to revocation, rescission, cancellation, termination, or
69+
any other legal or equitable action to disrupt the quiet enjoyment of the Work
70+
by the public as contemplated by Affirmer's express Statement of Purpose.
71+
72+
3. Public License Fallback. Should any part of the Waiver for any reason be
73+
judged legally invalid or ineffective under applicable law, then the Waiver
74+
shall be preserved to the maximum extent permitted taking into account
75+
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
76+
is so judged Affirmer hereby grants to each affected person a royalty-free,
77+
non transferable, non sublicensable, non exclusive, irrevocable and
78+
unconditional license to exercise Affirmer's Copyright and Related Rights in
79+
the Work (i) in all territories worldwide, (ii) for the maximum duration
80+
provided by applicable law or treaty (including future time extensions), (iii)
81+
in any current or future medium and for any number of copies, and (iv) for any
82+
purpose whatsoever, including without limitation commercial, advertising or
83+
promotional purposes (the "License"). The License shall be deemed effective as
84+
of the date CC0 was applied by Affirmer to the Work. Should any part of the
85+
License for any reason be judged legally invalid or ineffective under
86+
applicable law, such partial invalidity or ineffectiveness shall not
87+
invalidate the remainder of the License, and in such case Affirmer hereby
88+
affirms that he or she will not (i) exercise any of his or her remaining
89+
Copyright and Related Rights in the Work or (ii) assert any associated claims
90+
and causes of action with respect to the Work, in either case contrary to
91+
Affirmer's express Statement of Purpose.
92+
93+
4. Limitations and Disclaimers.
94+
95+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
96+
surrendered, licensed or otherwise affected by this document.
97+
98+
b. Affirmer offers the Work as-is and makes no representations or warranties
99+
of any kind concerning the Work, express, implied, statutory or otherwise,
100+
including without limitation warranties of title, merchantability, fitness
101+
for a particular purpose, non infringement, or the absence of latent or
102+
other defects, accuracy, or the present or absence of errors, whether or not
103+
discoverable, all to the greatest extent permissible under applicable law.
104+
105+
c. Affirmer disclaims responsibility for clearing rights of other persons
106+
that may apply to the Work or any use thereof, including without limitation
107+
any person's Copyright and Related Rights in the Work. Further, Affirmer
108+
disclaims responsibility for obtaining any necessary consents, permissions
109+
or other rights required for any use of the Work.
110+
111+
d. Affirmer understands and acknowledges that Creative Commons is not a
112+
party to this document and has no duty or obligation with respect to this
113+
CC0 or use of the Work.
114+
115+
For more information, please see
116+
<http://creativecommons.org/publicdomain/zero/1.0/>

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1-
# Scala_3rdParty_Example
2-
Scala vulnerable application, utilizing 3rd parties within GitHub Advanced Security example repo.
1+
# play-webgoat
2+
3+
[![Twitter Follow](https://img.shields.io/twitter/follow/playframework?label=follow&style=flat&logo=twitter&color=brightgreen)](https://twitter.com/playframework)
4+
[![Discord](https://img.shields.io/discord/931647755942776882?logo=discord&logoColor=white)](https://discord.gg/g5s2vtZ4Fa)
5+
[![GitHub Discussions](https://img.shields.io/github/discussions/playframework/playframework?&logo=github&color=brightgreen)](https://github.com/playframework/playframework/discussions)
6+
[![StackOverflow](https://img.shields.io/static/v1?label=stackoverflow&logo=stackoverflow&logoColor=fe7a16&color=brightgreen&message=playframework)](https://stackoverflow.com/tags/playframework)
7+
[![YouTube](https://img.shields.io/youtube/channel/views/UCRp6QDm5SDjbIuisUpxV9cg?label=watch&logo=youtube&style=flat&color=brightgreen&logoColor=ff0000)](https://www.youtube.com/channel/UCRp6QDm5SDjbIuisUpxV9cg)
8+
[![Twitch Status](https://img.shields.io/twitch/status/playframework?logo=twitch&logoColor=white&color=brightgreen&label=live%20stream)](https://www.twitch.tv/playframework)
9+
[![OpenCollective](https://img.shields.io/opencollective/all/playframework?label=financial%20contributors&logo=open-collective)](https://opencollective.com/playframework)
10+
11+
[![Build Status](https://github.com/playframework/play-webgoat/actions/workflows/build-test.yml/badge.svg)](https://github.com/playframework/play-webgoat/actions/workflows/build-test.yml)
12+
[![Repository size](https://img.shields.io/github/repo-size/playframework/play-webgoat.svg?logo=git)](https://github.com/playframework/play-webgoat)
13+
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
14+
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/playframework/play-webgoat&style=flat)](https://mergify.com)
15+
16+
A vulnerable Play application for attackers.
17+
18+
This application stays clear of the Twirl template engine for the most part, and shows where unvalidated input from the client can be improperly trusted by the application and included in the response.
19+
20+
## Running
21+
22+
```
23+
sbt run
24+
```
25+
26+
Then go to http://localhost:9000.
27+
28+
## Scala versions
29+
30+
Cross-building to Scala 2.13 and 3 is supported.

0 commit comments

Comments
 (0)