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: donate.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ To help more people kickstart their Infosec journey, this course is offered on a
4
4
5
5
Why contribute? Your donations directly fund the ongoing maintenance, updates, and development of new high-quality security resources.
6
6
7
-
Our Mission: To [simplify cybersecurity](https://simplifysecurity.nocomplexity.com) and ensure high-level training remains a public good, not a gated commodity.
7
+
Our Mission: To [simplify cybersecurity](https://simplifysecurity.nocomplexity.com) and transform elite training into a public good, rather than a gated commodity.
8
+
8
9
9
10
If you find this material valuable, please consider supporting our mission.
Copy file name to clipboardExpand all lines: index.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,34 +19,34 @@ The aim of this course is to teach you how to carry out security testing on Pyth
19
19
:::
20
20
21
21
22
-
This course is designed for developers and security enthusiasts, taking you from basic code hygiene through to advanced automated security analysis. It focuses on reliable open-source security tools to identify vulnerabilities arising from Python’s dynamic nature and the common pitfalls in its ecosystem.
22
+
This course is designed for developers and security enthusiasts, taking you from basic code hygiene through to advanced security analysis. It focuses on using reliable open-source security tools to identify vulnerabilities arising from Python’s dynamic nature and the common pitfalls in its ecosystem.
23
23
24
24
:::{note}
25
25
This course assumes a basic familiarity with Python syntax and the command line.
26
26
:::
27
27
28
-
It is designed to take you from a security novice to a proficient code auditor. Rather than focusing solely on theory, we will take a practical approach—identifying and resolving vulnerabilities in **Python code** using **Static Application Security Testing (SAST)** tools.
28
+
It is designed to take you from a security novice to a proficient security code auditor for Python applications. Rather than focusing solely on theory, we will take a practical approach—identifying and resolving vulnerabilities in **Python code** using **Static Application Security Testing (SAST)** tools.
29
29
30
30
31
31
## Who is this course for?
32
32
33
-
This course is designed for software security testers who want to improve their knowledge and skills in security testing for Python software.
33
+
This course is designed for security testers who want to improve their knowledge and skills in security testing for Python software.
34
34
35
35
It is also suitable for DevOps professionals, architects, security professionals, AppSec engineers, software engineers, web application developers, and others interested in learning about security testing for Python software.
36
36
37
37
The course focuses on practical steps that can be taken — even with limited resources — to build your skills in security testing for Python software and performing security audits on systems that include Python components.
38
38
This is not a beginner’s course that simply teaches you to run tools and follow a checklist.
39
39
To get the most from this course (and to complete it successfully), you should already be familiar with:
40
40
41
-
-software testing
42
-
-using programs from the command-line interface (CLI) on Unix-like systems (Linux or BSD)
41
+
-Security testing
42
+
-Using programs from the command-line interface (CLI) on Unix-like systems (Linux or BSD)
43
43
44
44
:::{tip}
45
45
Some prior knowledge and experience with security testing is strongly recommended.
46
46
:::
47
47
48
48
:::{note}
49
-
This course is **not** a beginner’s course, but aims to **deepen the knowledge of professional security testers** in relation to systems built with (or containing) Python code.
49
+
This course is **not** a beginner’s course, but aims to **deepen the knowledge of professional security testers** in relation to systems built with (or containing) **Python** code.
Deep coverage of Python Code Audit, the advantages of a SAST for Python code, and use cases.
63
+
3.[Module 3](module3/module3_overview): Harnessing Static Application Security Testing (SAST) for Python Code and why humans are stil crucial for security testing .
65
64
66
65
+++
67
66
@@ -70,7 +69,7 @@ Deep coverage of Python Code Audit, the advantages of a SAST for Python code, a
70
69
+++
71
70
72
71
73
-
5.[Module 5](module5/module5_overview): Detecting and Exploiting Common Python Vulnerabilities with **Python Code Audit**.
72
+
5.[Module 5](module5/module5_overview): Detecting and Exploiting Common Python Vulnerabilities with [**Python Code Audit**](https://nocomplexity.com/codeaudit/).
Copy file name to clipboardExpand all lines: module1/pythonexecutionmodel.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
@@ -60,8 +60,7 @@ Below is an example how you can see how Python code is compiled to bytecode:
60
60
61
61
## Memory Abstraction in Python: Security Benefits and Trade-offs
62
62
63
-
Unlike lower-level languages such as C or C++, Python does not allow developers to directly manipulate memory addresses. There are no pointers that can be arbitrarily dereferenced, and memory allocation and deallocation are handled automatically by the runtime. This abstraction significantly reduces the risk of certain low-level vulnerabilities.
64
-
Reduced Risk: **Buffer Overflows**
63
+
Unlike lower-level languages such as C or C++, Python does not allow developers to directly manipulate memory addresses. There are no pointers that can be arbitrarily dereferenced, and memory allocation and deallocation are handled automatically by the runtime. This abstraction significantly reduces the risk of certain low-level vulnerabilities, like **Buffer Overflows**.
65
64
66
65
In languages like C, developers must manually manage memory buffers. A common vulnerability is a buffer overflow, where data written beyond the bounds of an allocated buffer overwrites adjacent memory. This can lead to crashes or, in severe cases, arbitrary code execution.
67
66
@@ -109,7 +108,7 @@ Although this does not corrupt memory, it can allow an attacker to execute arbit
109
108
110
109
3.**Reliance on Native Extensions**
111
110
112
-
While Python itself is memory-safe, many performance-critical libraries (e.g. NumPy, cryptographic libraries) are written in `C`. Vulnerabilities in these native extensions can reintroduce classic memory issues such as buffer overflows.
111
+
While Python itself is memory-safe, many performance-critical libraries (e.g. `NumPy`, cryptographic libraries) are written in `C`. Vulnerabilities in these native extensions can reintroduce classic memory issues such as buffer overflows.
113
112
114
113
Example:
115
114
- A Python application calls a vulnerable C extension.
Copy file name to clipboardExpand all lines: module1/pythonsecuritymodel.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ These mechanisms prevent many classic memory exploitation techniques. However, t
33
33
* Denial-of-service risks through excessive object creation
34
34
* Abuse of large in-memory data structures
35
35
36
-
Python protects against direct memory manipulation, but it does not protect against logic flaws or resource misuse.
36
+
Python protects against direct memory manipulation, but it does **not protect against logic flaws or resource misuse**.
37
37
38
38
39
39
@@ -105,7 +105,7 @@ Protecting against malware therefore requires:
105
105
106
106
### No Built-in Sandbox
107
107
108
-
It is important to understand that Python does not provide a secure sandbox environment for executing untrusted code. Attempts to “restrict” Python by removing certain built-ins or blocking modules are generally insufficient and can often be bypassed.
108
+
It is important to understand that Python **does not** provide a secure sandbox environment for executing untrusted code. Attempts to “restrict” Python by removing certain built-ins or blocking modules are generally insufficient and can often be bypassed.
109
109
110
110
True isolation must be implemented at the operating system or infrastructure level, for example using:
**Strong security in Python is not automatic — it is engineered.**
134
+
**Strong security for Python applications is not automatic — it is engineered.**
135
+
:::
136
+
137
+
:::{caution}
138
+
Many Python frameworks prioritize ease of use over strict security in their default configurations (e.g., debug mode in Flask/Django). Moving to a "hardened" production state is a manual, engineered process.
Copy file name to clipboardExpand all lines: module2/ai_testing.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ short_title: Security testing and AI
7
7
Many people advocate for the use of AI technology , like AI agents, for Python security testing.
8
8
9
9
:::{warning}
10
-
Most are just far from good enough. In the best case scenario, you’ll only be disappointed. But the risk of a false sense of security is enormous.
10
+
Most are just far from good enough. In the best case scenario, you’ll only be disappointed. But the risk of a **false sense of security** is enormous.
11
11
:::
12
12
13
-
So why should you not use AI powered security test tools for Python?
13
+
So why should you not use or fully trust on AI powered security test tools for Python?
14
14
-**No single tool can judge the context** where a program is used, how it is used and by whom. There is a large difference between using a e.g. a SAST scanner on code from a developer perspective, or to use a SAST scanner as a potential user of some Python software. Based on findings you will and must judge risks differently. Judging risks is always context dependent and can still not be automated.
15
15
16
16
+++
@@ -33,4 +33,12 @@ AI and ML technologies can support cyber security, particularly in areas such as
33
33
When AI technology is used, strict reproducibility cannot always be guaranteed due to its probabilistic nature.
34
34
:::
35
35
36
-
Cyber security professionals should be conservative with adopting new IT hypes for security testing tools. IT hypes like AI-agents and LLMs are not the holy grail for solving our cybersecurity problems. This is because in the end you always pay more for cyber security solutions, but the risks still remain. Cyber security is not a product, but a process.
36
+
Creating security products that ‘learns’ from patterns is not new for security. AI/ML technologies have been applied for many years. For example for HIDS systems and spam-filters. Applying AI for cyber security has been done for many years with variable success and still most AI/ML powered security systems are not mature and can not be fully trusted.
37
+
38
+
39
+
Cyber security professionals should be conservative with adopting new IT hypes and innovations for security testing tools. IT hypes like AI-agents and LLMs are not the holy grail for solving our cybersecurity problems. This is because in the end you always pay more for cyber security solutions, but the risks still remain.
Copy file name to clipboardExpand all lines: module2/fosstestsoftware.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,15 @@ Some core benefits of using FOSS software for security testing of Python code in
16
16
***Easier access to expertise and resources:** Some specialist security testing tools require in-depth knowledge and experience. Many FOSS Python security tools are widely adopted, making expertise more readily available when required.
17
17
18
18
:::{warning}
19
-
Ensure that the software you use is genuinely open source and distributed under a valid OSI-approved FOSS licence. Avoid tools that claim to be open source in name only.
19
+
Ensure that the test software you use for security testing is genuinely open source and distributed under a valid [OSI-approved](https://opensource.org/) FOSS licence. Avoid using tools that claim to be open source in name only.
20
20
:::
21
21
22
+
Open source in name only" (often called OSINO or Openwashing) refers to software that uses the "open source" label for marketing but fails to provide the actual freedoms associated with it—such as the right to modify, redistribute, or use the code without restrictive commercial licenses. Some disadvantages are:
23
+
1. Vendor Lock-In and False Autonomy
24
+
While these tools appear to give you control, they often include "poison pill" clauses or proprietary dependencies. If the vendor changes their pricing, goes bust, or stops supporting the product, you are left with a codebase you cannot legally or practically maintain yourself. You lose the primary benefit of true open source: the ability to "fork" the code and carry on independently.
25
+
2. Sharing e.g. rules for SAST scanning is not allowed or not possible.
26
+
3. The test software itself is not secure and can cause security vulnerabilities.
27
+
22
28
:::{tip}
23
29
Always consider supporting the developers or foundation behind the product. This may include contributing improvements (code or documentation) and providing financial support to help ensure the long-term sustainability and health of the FOSS project.
Selecting a FOSS (Free and Open Source Software) tool for Python security testing isn't just about finding one that works—it's about ensuring the tool itself meets strict quality, maintenance, and reliability constraints.
9
9
10
-
A Python security testing tool should meet the following criteria:
10
+
A Python security testing tool should minimal meet the following criteria:
11
11
12
-
***FOSS-licensed:** The product must be released under a valid FOSS licence, preferably one approved by the Open Source Initiative (OSI).
12
+
***FOSS-licensed:** The product must be released under a valid FOSS licence, preferably one approved by the [Open Source Initiative (OSI)](https://opensource.org/).
13
13
***Local-first deployment:** The tool should run locally or on a server within your own security perimeter. Avoid SaaS-only solutions where you cannot control the execution environment or data handling.
14
14
***Actively maintained:** The project should be active and demonstrate an acceptable level of quality, including regular updates and issue management.
15
15
***Public version control repository:** The source code must be publicly accessible in a version-controlled repository with a clear and verifiable URL.
16
16
17
-
Ideally, projects should also meet the minimum requirements outlined by the [OpenSSF Best Practices Badge](https://www.bestpractices.dev/en) Program. However, despite significant effort from the community, this programme is still not widely recognised or adopted.
17
+
Ideally, projects should also meet the minimum requirements outlined by the [OpenSSF Best Practices Badge](https://www.bestpractices.dev/en) Program. However, despite significant effort from the community, this programme is not widely known and adopted.
18
18
19
19
In practice, you will use a long list when selecting test software for Python.
20
20
For each tool, you should use a proven checklist that helps you choose a suitable FOSS testing tool for your purpose.
| Build customer trust & confidence | Loss of reputation and user trust after breaches |
62
62
63
63
:::{tip}
64
-
While Python is often considered a secure language, also Python applications are susceptible to common security flaws, and **SAST is a crucial, cost-effective method** to address them before deployment.
64
+
While Python is often considered a secure language, also **Python applications are susceptible to common security flaws**, and **SAST is a crucial, cost-effective method** to address them before deployment.
Copy file name to clipboardExpand all lines: module4/installation_of_tools.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Secure installation of test tools is not optional — it is part of the security
16
16
17
17
Always install security testing tools in an isolated and controlled environment:
18
18
19
-
* Use **virtual environments** (`venv`) for project-level isolation.
19
+
* Use **virtual environments** (`venv` or use [`conda`](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)) for project-level isolation.
20
20
* Prefer **dedicated test machines** or hardened virtual machines.
21
21
* Never install security testing tools directly on production systems.
22
22
* Ensure your operating system and Python interpreter are up to date with security patches.
@@ -121,7 +121,7 @@ This ensures:
121
121
122
122
## Document Installed Versions
123
123
124
-
Never rely on “latest” versions in professional environments. Explicitly specify versions when performing security testing that must be 100% reproducible:
124
+
Never rely on “latest” versions or automatic updates in professional testing environments. Explicitly specify versions when performing security testing that must be 100% reproducible:
Copy file name to clipboardExpand all lines: module5/sast_boundaries.md
+10-19Lines changed: 10 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,22 +3,14 @@ title: SAST Boundaries - What Can and Cannot Be Detected?
3
3
short_title: SAST Boundaries
4
4
---
5
5
6
-
Static Application Security Testing (SAST) is one of the core techniques in Python security testing. It analyses source code without executing it, identifying patterns, data flows, and potentially dangerous constructs.
6
+
**Static Application Security Testing (SAST)** is one of the core techniques in Python security testing. It analyses source code without executing it to detect **potentially dangerous constructs**.
7
7
8
-
However, SAST is not magic.
8
+
However, SAST tools for Python are not magic.
9
9
10
-
Understanding its capabilities and limitations is critical if you are to use it effectively — or assess its results correctly during an engagement.
10
+
Understanding their capabilities and limitations is critical if you are to use them effectively — or assess their results correctly during an engagement.
11
11
12
-
## SAST Boundaries: What Can and Cannot Be Detected?
13
12
14
-
Static Application Security Testing (SAST) is one of the **core techniques in Python security testing**. It analyses source code *without executing it* to detect potentially dangerous constructs.
15
-
16
-
However, no SAST tool for Python is not magic.
17
-
18
-
Understanding its **capabilities and limitations** is critical if you are to use it effectively — or assess its results correctly during an engagement.
19
-
20
-
21
-
Each works slightly differently, but they all share a fundamental constraint:
13
+
Each SAST tool works slightly differently, but they all share a fundamental constraint:
22
14
23
15
:::{caution}
24
16
SAST can only reason about what it can *see in the code*.
0 commit comments