Skip to content

Commit 02f015d

Browse files
lach-harroSassafrasAUben-AI-cybersec
authored
Updating the Coding Best Practices Module (#271)
Co-authored-by: Kaleb <82347290+SassafrasAU@users.noreply.github.com> Co-authored-by: ben-AI-cybersec <142491786+ben-AI-cybersec@users.noreply.github.com>
1 parent bbf646c commit 02f015d

3 files changed

Lines changed: 20 additions & 18 deletions

File tree

docs/cybersecurity/SecDevOps Team/Coding Best Practices/Section2.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,20 @@ On top of mitigating the code smells, we also need to ensure that we are also im
3030
Within this section of the module, we will briefly go through some various methods in which we can implement to our own coding to achieve the above accomplishments.
3131

3232

33-
#### 1. **Choose Industry-specific coding standards:**
34-
When utilizing coding standards, we can suit the needs of what we are developing. In other words, developing a video game may typically utilize C++ for example whereas HTML, CSS and JavaScript are typically utilized for Web Development. Understanding the requirements of our objectives assists us in determining what standards we should utilize. If we are constructing a visual representation of a dataset, R or even Python may be our solution to the development process. Although, keep in mind when selecting a language that some may have various security issues in which you also need to consider and be prepared to mitigate. For example, the C++ and C languages don’t have any bound checks in which buffer overflows may occur. Always make sure that the coding language and standards you are utilising are appropriate for the solution you are developing but always consider these security considerations as well.
33+
#### 1. **Have security and privacy considerations:**
34+
With constant threats emerging, we want to mitigate any risk of any potential compromise. In saying this, having security considerations is of extreme importance and needs to always be implemented within our code. Some things we should not be doing at all, and this also comes with our code reviewing is:
35+
36+
- **NO** Hardcoded passwords
37+
- **NO** Hardcoded usernames
38+
- **NO** Sensitive data coded or listed
39+
40+
These three main points are a definite ‘no-go’ within coding as these can be easily leveraged against us and can often lead to attacks against our systems and unauthorised access. After all, most cyber security incidents are often caused by human error, so mitigating this risk can drastically reduce the likelihood of a compromise leading to an incident. These also come from secure coding practices including studying and analysing the OWASP Top 10, MITRE ATT&CK Framework, Cryptography Measures (Encryption/Decryption) and Security by design. Some resources will be provided for further information:
41+
42+
- **OWASP Top 10:** https://owasp.org/www-project-top-ten/
43+
- **MITRE:** https://attack.mitre.org/
44+
45+
The main priority with this coding standard is that we should always be thinking about security considerations while completing our work, not have it as an afterthought.
46+
Always keep a tight security posture and always question to yourself, “Am I giving away any sensitive information in this file?”
3547

3648

3749
#### 2. **Focus on Code readability:**
@@ -181,20 +193,8 @@ catch(ArgumentNullException)
181193
```
182194

183195

184-
#### 9. **Have security and privacy considerations:**
185-
With constant threats emerging, we want to mitigate any risk of any potential compromise. In saying this, having security considerations is of extreme importance and needs to always be implemented within our code. Some things we should not be doing at all, and this also comes with our code reviewing is:
186-
187-
- **NO** Hardcoded passwords
188-
- **NO** Hardcoded usernames
189-
- **NO** Sensitive data coded or listed
190-
191-
These three main points are a definite ‘no-go’ within coding as these can be easily leveraged against us and can often lead to attacks against our systems and unauthorised access. After all, most cyber security incidents are often caused by human error, so mitigating this risk can drastically reduce the likelihood of a compromise leading to an incident. These also come from secure coding practices including studying and analysing the OWASP Top 10, MITRE ATT&CK Framework, Cryptography Measures (Encryption/Decryption) and Security by design. Some resources will be provided for further information:
192-
193-
- **OWASP Top 10:** https://owasp.org/www-project-top-ten/
194-
- **MITRE:** https://attack.mitre.org/
195-
196-
The main priority with this coding standard is that we should always be thinking about security considerations while completing our work, not have it as an afterthought.
197-
Always keep a tight security posture and always question to yourself, “Am I giving away any sensitive information in this file?”
196+
#### 9. **Choose Industry-specific coding standards:**
197+
When utilizing coding standards, we can suit the needs of what we are developing. In other words, developing a video game may typically utilize C++ for example whereas HTML, CSS and JavaScript are typically utilized for Web Development. Understanding the requirements of our objectives assists us in determining what standards we should utilize. If we are constructing a visual representation of a dataset, R or even Python may be our solution to the development process. Although, keep in mind when selecting a language that some may have various security issues in which you also need to consider and be prepared to mitigate. For example, the C++ and C languages don’t have any bound checks in which buffer overflows may occur. Always make sure that the coding language and standards you are utilising are appropriate for the solution you are developing but always consider these security considerations as well.
198198

199199

200200
#### 10. **Standardise headers for different files:**

docs/cybersecurity/SecDevOps Team/Coding Best Practices/Section3.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Author: **Lachlan Harrison**, **03/05/2025**
1313
For this section, various pieces of coding will be presented with various points of interest that need to be reviewed to apply our best practices to: (This will be done in the Python coding standard for the purpose of this demonstration)
1414
We will then point out what needed to be refactored and why for the coding example as well as a refactored version of the code to demonstrate these coding best practices in action and why it is needed.
1515

16-
- Here is a link to the video in which you can watch to see the code reviewing process in action: *VIDEO URL*
16+
- Here is a link to the video in which you can watch to see the code reviewing process in action: https://deakin.au.panopto.com/Panopto/Pages/Viewer.aspx?id=4eae4805-a2cc-40b2-8c23-b2e1007d515b
17+
18+
*A few bonus points of addition in which we can also add from the video in which was not initially discussed includes the implementation of a Try-Catch exception handling. And also the header for the file to assist in indentifying the creator of the file along with its modifications.*
1719

1820
The ability to review your own work saves a lot of time for everyone as it is essentially like the first line of defence. You are trying to catch anything that you can see before it is then processed for another individual to also review. You may not always be able to find everything although, finding something is better than nothing. (Sometimes there may also just be genuinely nothing to find!)

docs/cybersecurity/SecDevOps Team/Coding Best Practices/Section4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ Author: **Lachlan Harrison**, **03/05/2025**
1111
:::
1212

1313
To access the quiz for this module, a link will be provided. Test what you have learnt throughout the module and see how you go with the knowledge gathered from the module!
14-
**Quiz Link:** *URL*
14+
**Quiz Link:** https://forms.gle/aLqL6Y2oxEvkMM7Z8
1515

1616
After completing the quiz you have successfully completed this module about Coding Best Practices, thank you for your time and hopefully you have learnt a few new skills to apply when developing future programs!

0 commit comments

Comments
 (0)