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: learn-pr/aspnetcore/owasp-top-10-for-dotnet-developers/5-injection.yml
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,15 @@ quiz:
18
18
questions:
19
19
- content: "In modern day .NET, how can the code fragment `string sql='SELECT * FROM users WHERE name = '\" + username + \"'` be written more securely?"
20
20
choices:
21
-
- content: "Using an object relational mapper (ORM)."
21
+
- content: "By using an object relational mapper (ORM)."
22
22
isCorrect: false
23
-
explanation: "Entity Framework with LINQ is a powerful way of querying many relational database engines."
24
-
- content: "Using stored procedures."
23
+
explanation: "Using Entity Framework with Language Integrated Query (LINQ) is a powerful way of querying many relational database engines."
24
+
- content: "By using stored procedures."
25
25
isCorrect: false
26
26
explanation: "Stored procedures are the most effective way of countering the SQL Injection vulnerability."
27
-
- content: "Using parameterized queries."
27
+
- content: "By using parameterized queries."
28
28
isCorrect: false
29
29
explanation: "Use parameterized queries where a direct SQL query must be used."
30
-
- content: "You should use at least one or combinations of few techniques, including Entity Framework and input validation"
30
+
- content: "You should use at least one or a combination of a few techniques, including Entity Framework and input validation."
31
31
isCorrect: true
32
32
explanation: "With username validation as a minimum, you can use any of the methods."
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/owasp-top-10-for-dotnet-developers/8-vulnerable-outdated-components.yml
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,12 @@ quiz:
18
18
questions:
19
19
- content: "How should the DevOps team maintain and review a list of third-party components used in the system for security vulnerabilities?"
20
20
choices:
21
-
- content: "An Excel spreadsheet with Software Bill of Materials should be part of the design phase and any new green field project."
21
+
- content: "An Excel spreadsheet with Software Bill of Materials (SBOM) should be part of the design phase and any new green field project."
22
22
isCorrect: false
23
23
explanation: "SBOM is recommended, but you can apply it at any stage of the project in a more automated fashion."
24
-
- content: "Favor automated tools at any stage of the product lifecycle to track and monitor your dependencies."
24
+
- content: "By favoring automated tools at any stage of the product lifecycle for tracking and monitoring dependencies."
25
25
isCorrect: true
26
26
explanation: "Correct. The maintenance effort required to keep a list of dependencies up to date combined with their vulnerability checks can quickly become unmanageable."
27
-
- content: "There's no risk associated with third-party purchased and OSS components."
27
+
- content: "There's no risk associated with third-party purchased and Operational support system (OSS) components."
28
28
isCorrect: false
29
-
explanation: "Even if your software makes the best effort in staying secure, an insecure or flow dependency may introduce security vulnerability in your system."
29
+
explanation: "Even if your software makes the best effort in staying secure, an insecure or flow dependency might introduce security vulnerability in your system."
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/owasp-top-10-for-dotnet-developers/9-identification-authentication-failures.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ quiz:
20
20
- content: "Find the authors of the change with git blame and ask them to fix it when they have some spare time."
21
21
isCorrect: false
22
22
explanation: "Chances are that whoever checked in the commit might no longer be part of your team or even the same company."
23
-
- content: "Change the password for the username referenced in connection string. Open a pull request with hardcoded connection string now being obtained from Azure KeyVault."
23
+
- content: "Change the password for the username referenced in the connection string. Open a pull request with the hardcoded connection string now being obtained from Azure KeyVault."
24
24
isCorrect: true
25
25
explanation: "Secret rotation is a good practice. Azure KeyVault is the go-to service for storing secrets, certificates, and keys and in most secure fashion. Avoid blame games."
26
26
- content: "The connection string is only referenced in Git and code. No one can access it because only the web app is available to the public, so nothing needs to be done."
This module explores OWASP TOP 10: 2021 edition. It covers the most common security weaknesses and how you as an app developer or architect can reduce the risk of security bugs infecting your systems. This module introduces techniques, tools, and best practices that can improve your product’s security posture.
2
+
This module explores the OWASP TOP 10: 2021 edition. It covers the most common security weaknesses and how you as an app developer or architect can reduce the risk of security bugs infecting your systems. This module introduces techniques, tools, and best practices that can improve your product’s security posture.
3
3
4
4
### Threat landscape
5
5
6
-
Implementing secure and high-quality software can be challenging. Malware, exploits, and many other cyber threats are on the rise. Attacks happen by exploiting vulnerabilities in an application. A vulnerability is just an unintended flaw or weakness in that application. How data is processed and stored and how services are configured are examples of where a vulnerability could be introduced.
6
+
Implementing secure and high-quality software can be challenging. Cyber threats are on the rise, like malware, exploits, and many others. Attacks happen by exploiting vulnerabilities in an application. A vulnerability is just an unintended flaw or weakness in that application. How data is processed and stored and how services are configured are examples of where a vulnerability could be introduced.
7
7
8
8

9
9
10
-
News stories about a company being hacked or data being stolen and posted on dark web are now common. According to the 2021 Identity Theft Resource Center (ITRC) Annual Data Breach Report, the cost of a data breach increased by nearly 10% between 2020 and 2021. Data breaches are increasing and getting more costly.
10
+
News stories about a company being hacked or data being stolen and posted on the dark web are now common. According to the 2021 Identity Theft Resource Center (ITRC) Annual Data Breach Report, the cost of a data breach increased by nearly 10% between 2020 and 2021. Data breaches are increasing and getting more costly.
11
11
12
12
> [!IMPORTANT]
13
-
> NIST defines [Software Vulnerability](https://csrc.nist.gov/glossary/term/Software_Vulnerability) as security flaw, glitch, or weakness found in software code that could be exploited by an attacker (threat source).
13
+
> The National Institute of Standards and Technology (NIST) defines [Software Vulnerability](https://csrc.nist.gov/glossary/term/Software_Vulnerability) as "a security flaw, glitch, or weakness found in software code that could be exploited by an attacker (threat source)."
14
14
15
15
### The world of application security
16
16
@@ -21,20 +21,20 @@ Application Security, often referred to as AppSec, is the process of finding, fi
21
21

AppSec logically falls under the wider context of **Information Security (InfoSec)**, term covering protection of information and systems from unauthorized access, use, disruption, or destruction. InfoSec also covers areas like as network security, intrusion detection, digital forensics, and governance, risk, and compliance, for example.
24
+
AppSec logically falls under the wider context of **Information Security (InfoSec)**, a term covering the protection of information and systems from unauthorized access, use, disruption, or destruction. InfoSec also covers areas like network security, intrusion detection, digital forensics, and governance, risk, and compliance, for example.
25
25
26
26
**The Security Development Lifecycle (SDL)** consists of a set of practices that support security assurance and compliance requirements. The SDL helps developers build more secure software by reducing the number and severity of vulnerabilities in software.
27
27
28
28
**DevSecOps** is an evolution in the way development organizations approach security by introducing a security-first mindset culture and automating security into every phase of the software-development lifecycle from design to delivery.
29
29
30
30
### Meet the team
31
31
32
-
Suppose you're joining a new IT company with an established team working on a legacy software. Your team's main focus is maintaining, supporting, and developing new features of a rich web application that customers all around the world use. The website and its underlying infrastructure have only recently been migrated to Microsoft Azure cloud.
32
+
Suppose you're joining a new IT company with an established team working on a legacy software. Your team's main focus is maintaining, supporting, and developing new features of a rich web application that customers all around the world use. The website and its underlying infrastructure were only recently migrated to Microsoft Azure cloud.
33
33
34
34
The team you're part of has a mix of talent, including early-career and seasoned enterprise developers.
35
35
36
-
In the past, your team was slowed down by the manual-release process that proved to be unreliable, error-prone, and heavy on manual interaction. As part of its cloud migration, your team is looking to adopt modern CI/CD automation.
36
+
In the past, a manual-release process slowed down your team and proved to be unreliable, error-prone, and heavy on manual interaction. As part of its cloud migration, your team is looking to adopt modern CI/CD automation.
37
37
38
-
The company hasn't fully grasped the concepts behind secure DevOps practices. With new personnel onboarded, the company is looking to spread security best practices not only within the team, but the company as a whole.
38
+
The company has yet to fully grasp the concepts behind secure DevOps practices. With new personnel onboarded, the company is looking to spread security best practices not only within the team, but the company as a whole.
39
39
40
40
Your team lead asked you to conduct design and code reviews of a team-owned codebase, with extra attention paid to the solution's security aspects. You discovered the OWASP report, which you plan to use as a reference in your code review.
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/owasp-top-10-for-dotnet-developers/includes/2-what-is-owasp-top-10.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
-
2
-
As application complexity increases, so does the effort of making it secure. Modern applications (in contrast with single-project monolith legacy applications) have many dependencies, including external libraries, services for hosting, building, and releasing, to name a few. None of these services are simple "plug and play" affairs. Developers need to understand them and know how to configure and implement the flows and processes securely in their own code.
1
+
As application complexity increases, so does the effort of making it secure. Modern applications, in contrast with single-project monolith legacy applications, have many dependencies. Including, external libraries, services for hosting, building, and releasing, to name a few. None of these services are simple "plug and play" affairs. Developers need to understand them and know how to configure and implement the flows and processes securely in their own code.
3
2
4
3
:::row:::
5
4
:::column span="2":::
@@ -14,7 +13,7 @@ As application complexity increases, so does the effort of making it secure. Mod
14
13
:::column-end:::
15
14
:::row-end:::
16
15
17
-
Although security is everyone’s job, it's important to remember that not everyone needs to be a security expert nor strive to become a proficient penetration tester. However, ensuring everyone understands the attacker's perspective, their goals, and the art of the possible will help capture the attention of everyone and raise the collective knowledge bar.
16
+
Although security is everyone’s job, it's important to remember that not everyone needs to be a security expert nor strive to become a proficient penetration tester. However, ensuring everyone understands the attacker's perspective, their goals, and the art of the possible, helps capture the attention of everyone and raise the collective knowledge bar.
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/owasp-top-10-for-dotnet-developers/includes/3-broken-access-control.md
+24-21Lines changed: 24 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
2
-
Recall that you recently joined a team at an IT software company that's tasked you with conducting a design and code review of the team-owned codebases. As you onboard to your new team and explore the codebase, you discover an ASP.NET Blazor web project. With OWASP Top 10 in mind, you set off on a deep dive into the code with your security lenses on.
2
+
Recall that you recently joined a team at an IT software company who tasked you with conducting a design and code review of the team-owned codebases. As you onboard to your new team and explore the codebase, you discover an ASP.NET Blazor web project. With OWASP Top 10 in mind, you set off on a deep dive into the code with your security lenses on.
3
3
4
4
You start at the top of the OWASP Top 10 list with *#1: Broken Access Control*. This category refers to incidents where a user who shouldn’t have permission to access that data viewed confidential information.
5
5
@@ -11,8 +11,8 @@ Let's consider a ASP.NET Core controller. A controller without any authorization
11
11
:::row:::
12
12
:::column:::
13
13
Plain ASP.NET controller with no authorization attributes, no access restrictions applied.
14
-
```csharp
15
14
15
+
```csharp
16
16
publicclassAccountController : Controller
17
17
{
18
18
publicActionResultLogin()
@@ -27,12 +27,12 @@ public class AccountController : Controller
27
27
{
28
28
}
29
29
}
30
-
31
30
```
32
31
33
32
:::column-end:::
34
33
:::column:::
35
34
Controller with authorization attributes, based on policy or role assignments. Authorized caller is able to invoke the `GetCitizenTaxId` method.
35
+
36
36
```csharp
37
37
[Authorize(Policy="", Roles=""]
38
38
publicclassAccountController:Controller
@@ -56,23 +56,26 @@ public class AccountController : Controller
Yourapplication's user interface should also reflect the user'sauthentication (theuseriswhotheysaytheyare) andauthorizationstate (whethertheuserisallowedtoaccesscertaininformation). Here, too, theOWASPTop10frameworkhasyoucovered. ASP.NETBlazor's razor syntax supports conditionally displayed components depending on authorization status. The `AutorizeView` component selectively displays UI content based on user'sauthorizedstatus.
78
+
Yourapplication's user interface should also reflect the user'sauthentication (theuseriswhotheysaytheyare) andauthorizationstate (whethertheuserisallowedtoaccesscertaininformation). Here, too, you're covered by the OWASP Top 10 framework. ASP.NET Blazor'srazorsyntaxsupportsconditionallydisplayedcomponentsdependingonauthorizationstatus. The `AutorizeView` componentselectivelydisplaysUIcontentbasedonuser's authorized status.
76
79
77
80
```csharp
78
81
<AuthorizeViewRoles="admin, superuser">
@@ -100,7 +103,7 @@ The `SecureMethod` is accessible once the user is authorized. Because the `Autor
Copy file name to clipboardExpand all lines: learn-pr/aspnetcore/owasp-top-10-for-dotnet-developers/includes/4-cryptographic-failures.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Your web applications deal with user accounts and data, but how do you securely
15
15
16
16
### Encryption
17
17
18
-
To securely encrypt a value like a string or integer, you can use symmetric or asymmetric encryption. To encrypt data with a symmetric-key algorithm, you can use the Advanced Encryption Standard (AES). In the next example, we create new instance of the `Aes` class and use it to generate a new key and initialization vector (IV). We use the AES to encrypt any type of managed stream. The stream is then wrapped with `CryptoStream`.
18
+
To securely encrypt a value like a string or integer, you can use symmetric or asymmetric encryption. To encrypt data with a symmetric-key algorithm, you can use the Advanced Encryption Standard (AES). In the next example, we create a new instance of the `Aes` class and use it to generate a new key and initialization vector (IV). We use the AES to encrypt any type of managed stream. The stream is then wrapped with `CryptoStream`.
0 commit comments