You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Code Scanning Javascript Tutorial
1
+
# Code Scanning C# Tutorial
2
2
3
-
Welcome to the Code Scanning Java Tutorial! This tutorial will take you through how to set up Github Advanced Security: Code Scanning as well as interpret results that it may find. The following repository contains SQL injection vulnerability for demonstration purpose.
3
+
Welcome to the Code Scanning C# Tutorial! This tutorial will take you through how to set up Github Advanced Security: Code Scanning as well as interpret results that it may find. The following repository contains cross-site scripting vulnerability for demonstration purpose.
4
4
5
5
## Introduction
6
6
@@ -62,6 +62,10 @@ The Actions Workflow file contains a number of different sections including:
Click `Start Commit` -> `Commit this file` to commit the changes to _main_ branch.
66
70
</p>
67
71
</details>
@@ -107,7 +111,9 @@ Click the specific workflow run. You can view the progress of the Workflow run u
107
111
<summary>Security Issues</summary>
108
112
<p>
109
113
110
-
Once the Workflow has completed, click the `Security` tab -> ` Code Scanning Alerts`. An security alert "Query built from user-controlled sources" should be visible.
114
+
Once the Workflow has completed, click the `Security` tab -> ` Code Scanning Alerts`. You can see 29 alerts, select the first "Cross-site scripting" alert.
@@ -157,13 +163,13 @@ Click `show paths` in order to see the dataflow path that resulted in this alert
157
163
158
164
<summary>Fix the Security Alert</summary>
159
165
160
-
In order to fix this specific alert, we will need to ensure parameters used in the SQL query is validated and sanitized.
166
+
In order to fix this specific alert, we will need to ensure the content being write to the `HttpContext`'s response is validated and sanitized.
161
167
162
-
Click on the `Code` tab and [Edit](https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/editing-files-in-your-repository) the file [`IndexController.java`](./src/main/java/com/github/hackathon/advancedsecurityjava/Controllers/IndexController.java) in the `Controllers` folder, replace the content with the file [`fixme`](./fixme).
168
+
Click on the `Code` tab and [Edit](https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/editing-files-in-your-repository) the file [`Autocomplete.ashx.cs`](./WebGoat/WebGoatCoins/Autocomplete.ashx.cs) in the `WebGoat/WebGoatCoins` folder. For this demonstration purpose, we will simply write some hardcoded value to the `HttpContext` instance, this granatees the parameter is sanitized and safe.
Click `Create a new branch for this commit and start a pull request`, name the branch `fix-sql-injection`, and create the Pull Request.
172
+
Click `Create a new branch for this commit and start a pull request`, name the branch `fix-cross-site-scripting`, and create the Pull Request.
167
173
168
174
#### Pull Request Status Check
169
175
@@ -179,15 +185,15 @@ After the Workflow has completed click on `Details` by the `Code Scanning Result
179
185
180
186
#### Fixed Alert
181
187
182
-
Notice that Code Scanning has detected that this Pull Request will fix the SQL injection vulnerability that was detected before.
188
+
Notice that Code Scanning has detected that this Pull Request will fix the cross-site scripting vulnerability that was detected before.
183
189
184
190
<imgsrc="images/14-fix-detail.png"width="80%"/>
185
191
186
192
Merge the Pull Request. After the Pull Request has been merged, another Workflow will kick off to scan the repository for any vulnerabilties.
187
193
188
194
#### Closed Security Alerts
189
195
190
-
After the final Workflow has completed, navigate back to the `Security` tab and click `Closed`. Notice that the **Query built from user-controlled sources** security alert now shows up as a closed issue.
196
+
After the final Workflow has completed, navigate back to the `Security` tab and click `Closed`. Notice that the **Cross-site scripting** security alert now shows up as a closed issue.
0 commit comments