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: docs/cybersecurity/SecDevOps Team/Coding Best Practices/Section2.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,20 @@ On top of mitigating the code smells, we also need to ensure that we are also im
30
30
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.
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?”
35
47
36
48
37
49
#### 2. **Focus on Code readability:**
@@ -181,20 +193,8 @@ catch(ArgumentNullException)
181
193
```
182
194
183
195
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?”
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.
198
198
199
199
200
200
#### 10. **Standardise headers for different files:**
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)
14
14
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.
15
15
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.*
17
19
18
20
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!)
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
15
15
16
16
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