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
"# ELIXIR_SECURITY:2\n\ndefmodule SecurityCheck do\n def validate(input, password_hash) do\n case Plug.Crypto.secure_compare(input, password_hash) do\n true -> :ok\n false -> :access_denied\n end\n end\n\n defexception message: \"There was an issue\"\nend\n\npassword = \"some_secure_password_hash\"\nuser_input = \"some_string_which_obviously_isnt_the_same_as_the_password\"\n:ok\n# DO NOT EDIT ANY CODE ABOVE THIS LINE =====================\n\ntry do\n# if SecurityCheck.validate(user_input, password) or raise(SecurityCheck) do :you_let_a_baddie_in end\n# if SecurityCheck.validate(user_input, password) || raise(SecurityCheck) do :you_let_a_baddie_in end\nrescue\n e -> e\nend"
268
-
|>String.split("\n", parts:2)
269
-
|>hd()
270
-
|>String.trim_leading("#")
271
-
|>String.split(":", parts:2)
272
-
273
-
module_id =
274
-
case %{
275
-
"ELIXIR_SECURITY"=>ELIXIR_SECURITY,
276
-
"GRAPHQL"=>GRAPHQL,
277
-
"OWASP"=>OWASP,
278
-
"SDLC"=>SDLC
279
-
}[String.trim(module_id)] do
280
-
nil->raise"invalid module id: #{module_id}"
281
-
module_id -> module_id
282
-
end
283
-
284
-
question_id =
285
-
caseInteger.parse(String.trim(question_id)) do
286
-
{id, ""} -> id
287
-
_->raise"invalid question id: #{question_id}"
288
-
end
289
-
290
-
caseGradingClient.check_answer(module_id, question_id, result) do
242
+
caseGradingClient.check_answer(ELIXIR_SECURITY, 2, result) do
Copy file name to clipboardExpand all lines: modules/8-cicd.livemd
+10-7
Original file line number
Diff line number
Diff line change
@@ -31,22 +31,25 @@ This module will cover over some of the automated processes you may see in a CI/
31
31
32
32
Built in Elixir, for Elixir, by NCC Group - this tool will try to determine whether your codebase has a number of web vulnerabilities as well as the insecurites outlined in [Module 5 - Elixir Security](./5-elixir.livemd).
33
33
34
-
### <spanstyle="color:blue;">Example</span>
34
+
### <spanstyle="color:blue;">Example</span>
35
+
35
36
Install [Sobelow](https://sobelow.io/) and add it to your application dependencies or install it by following the instructions https://hexdocs.pm/sobelow/readme.html
36
37
37
38
Scan your project by running the following at a terminal in your project's root directory
39
+
38
40
```
39
41
$ mix sobelow
40
42
```
41
-
As a vulnerability scanner, there are multiple categories of vulnerabilities sobelow is capable of discovering and reporting on.
42
43
43
-
For instance, there are a number of security issues published on the Common Weakness Enumeration (CWE) site - [CWE's](https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25.html) and on OWASP Top 10 [OWASP Top 10](https://owasp.org/www-project-top-ten/).
44
+
As a vulnerability scanner, there are multiple categories of vulnerabilities sobelow is capable of discovering and reporting on.
45
+
46
+
For instance, there are a number of security issues published on the Common Weakness Enumeration (CWE) site - [CWE's](https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25.html) and on OWASP Top 10 [OWASP Top 10](https://owasp.org/www-project-top-ten/).
44
47
45
48
Scanning tools like Sobelow identify code patterns that match these issues and report them back to developers/users.
46
49
47
-
### <spanstyle="color:blue;">Example</span>
48
-
49
-
Let's say you are interested finding in places in your application that may be susceptible to injection attacks.
50
+
### <spanstyle="color:blue;">Example</span>
51
+
52
+
Let's say you are interested finding in places in your application that may be susceptible to injection attacks.
50
53
51
54
There are several types of injection. Referring to the CWE list, we see #17 CWE-77 for Command Injection, #25 CWE-94 is Code Injection, and #3 CWE-89 is SQL Injection. If we look at the OWASP Top 10 for 2021, A03:2021-Injection is third on the list. Sobelow has the capability to detect these types of security issues.
0 commit comments