Skip to content

Commit c2f296b

Browse files
authored
pySCG: template for contributing to the project (#669)
* Python guide: template for contributing to the project The change aims to create a simple template for creating README files for Secure Coding Python Guides. By using the template, we can ensure that all of the rule descriptions follow the same format in regards to page sections, code examples, bibliography, etc. The template also contains the link to quoting reference guide we have decided to follow. The template should be mentioned on the landing page referenced in #520 Signed-off-by: edanhub <[email protected]> * Minor changes to address review commentss Signed-off-by: edanhub <[email protected]> * Related guidelines explanation for class/base Signed-off-by: edanhub <[email protected]> --------- Signed-off-by: edanhub <[email protected]>
1 parent 67489e1 commit c2f296b

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# CWE-000: Title goes here
2+
3+
Introduction sentence, this will be displayed in search engines.
4+
5+
Introduction paragraph, expanding on the introduction sentence...
6+
7+
[*example01.py:*](example01.py)
8+
9+
```py
10+
""" Code Example """
11+
12+
# Code goes here
13+
```
14+
15+
**Output of example01.py:**
16+
17+
```bash
18+
Console output...
19+
```
20+
21+
## Non-Compliant Code Example
22+
23+
Introduction to the code example...
24+
25+
*[noncompliant01.py](noncompliant01.py):*
26+
27+
```python
28+
""" Non-compliant Code Example """
29+
30+
# Code goes here
31+
32+
#####################
33+
# Trying to exploit above code example
34+
#####################
35+
36+
# Code goes here
37+
```
38+
39+
Short explanation of expected outcome of running the code example, e.g. "The code will ... throw an exception, print x..., loop forever..."
40+
41+
## Compliant Solution
42+
43+
Introduction to the code example...
44+
45+
*[compliant01.py](compliant01.py):*
46+
47+
```python
48+
""" Compliant Code Example """
49+
50+
# Code goes here
51+
52+
#####################
53+
# Trying to exploit above code example
54+
#####################
55+
56+
# Code goes here
57+
```
58+
59+
Short explanation of expected outcome of running the code example, e.g. "The code will ... throw an exception, print x..., loop forever..."
60+
61+
## Automated Detection
62+
63+
|Tool|Version|Checker|Description|
64+
|:---|:---|:---|:---|
65+
|Bandit|1.7.4 on Python 3.10.4|Not Available||
66+
|Flake8|8-4.0.1 on Python 3.10.4|Not Available||
67+
68+
## Related Guidelines
69+
70+
|||
71+
|:---|:---|
72+
|[MITRE CWE](http://cwe.mitre.org/)|Pillar: [CWE-000: Name of the pillar (4.13) (mitre.org)](https://cwe.mitre.org/data/definitions/000.html)|
73+
|[MITRE CWE](http://cwe.mitre.org/)|Base/Class (choose which one it is based on the abstraction on the CWE page): [CWE-000: Numeric Truncation Error](https://cwe.mitre.org/data/definitions/000.html)|
74+
|[SEI CERT Coding Standard for Java](https://wiki.sei.cmu.edu/confluence/display/java/SEI+CERT+Oracle+Coding+Standard+for+Java)|[Reference Goes here](http://YOUR_LINK)|
75+
|[SEI CERT C Coding Standard](https://web.archive.org/web/20220511061752/https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Coding+Standard)|[Reference Goes here](http://YOUR_LINK)|
76+
|[ISO/IEC TR 24772:2019]|[Reference Goes here](http://YOUR_LINK)|
77+
78+
## Bibliography
79+
80+
|||
81+
|:---|:---|
82+
|[[Python docs](https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations)]|Python Software Foundation. (2024). Expressions, Title goes here [online]. Available from: [https://docs.python.org/3/reference/YOUR_LINK](https://docs.python.org/3/reference/YOUR_LINK) [accessed 1 January 2024] |
83+
84+
When writing bibligraphy, follow the [Harvard reference guide](https://dkit.ie.libguides.com/harvard/citing-referencing)

0 commit comments

Comments
 (0)