Sn-Development Life Cycle: Month 1
Sn-Development Life Cycle: Month 1
3 MONTH
SS
SN-LP-003
Month 1
Securing an application throughout its development cycle
INTRODUCTION
You will be guided through the steps of the Secure Software Development
Lifecycle (SDLC) for an existing web application developed using Vue.js 3,
Node.js, and MongoDB. This project will allow you to apply essential security
practices and conduct vulnerability tests to ensure that the application meets
security standards.
Target skills
• Follow the steps of the SDLC to secure a web application.
• Identify and remediate security vulnerabilities.
• Use tools such as npm audit, Snyk, Trivy, OWASP ZAP, and
Postman.
• Collaborate with developers to write security stubs to control
the behavior of certain parts of the code.
• Produce deliverables for each phase of the project: security
requirements, planning, security testing, vulnerability analysis,
etc.
THE PROJECT
IMPORTANT : The Readme file shows how to run the application, but further
research is required.
At this stage, you will identify the sensitive features of the application, such as
authentication, user management, and forms.
1. List the sensitive features and explain why they require special attention.
2. These various functionalities rely on critical processes that are now digitized.
Identify and list these processes.
3. Develop a RACI matrix for each process, specifying roles and responsibilities.
4. Analyze each process and identify the associated risks.
5. Specify the security requirements to be developed for each feature. For
example, for authentication, you may recommend using JWT with a short
expiration and strict input validation for forms.
6. Translate the roles defined in the RACI matrix into RBAC (Roles, Access Rights,
and Justification)
7. Integrate the security flow into the workflow.
8. Prioritize functionalities based on their criticality
Part 1 Delivery
In this step, you will analyze the MongoDB database schema to identify potential
threats and vulnerabilities. Follow these steps to conduct your analysis:
1. Access the MongoDB Database:
o Tools: Use MongoDB Compass or the MongoDB Shell.
2. Examine the Collections:
o Tools: Open MongoDB Shell in MongoDB Compass.
o Command:
▪ "show collections"
▪ "db.<collection_name>.find().pretty()"
3. Identify Security Risks:
o Consider common NoSQL vulnerabilities:
▪ Injection Attacks:
▪ Command:
▪ "db.<collection_name>.find({<field>: {$regex:
/<user_input>/}})"
▪ Inadequate Access Controls:
▪ Command:
▪ "db.getUsers()"
▪ Schema Validation:
▪ Command:
▪ "db.<collection_name>.getSchema()"
4. Use Threat Modeling Tools:
o Tools: Utilize the Microsoft Threat Modeling Tool to document
findings.
o Create a threat model by mapping interactions with the MongoDB
database.
5. Propose Countermeasures:
• For each identified threat, recommend countermeasures. Examples
include:
o Implementing input validation and sanitization using libraries like
Joi or express-validator in your application code.
o Enforcing role-based access control by configuring user roles in
MongoDB Compass.
o Utilizing TLS/SSL for securing data in transit; configure this in your
MongoDB deployment settings.
o Setting up schema validation in the database using commands in
the MongoDB Shell.
Part 2 Delivery
A report detailing the identified threats associated with the MongoDB database,
including:
Part 3: Implementation
You will now set up a CI/CD pipeline to automate security testing on every code push.
1. Configure a pipeline with GitHub Actions or Jenkins to execute security tests
with each code modification.
2. Integrate security tools like Snyk into the pipeline to scan the code for
vulnerabilities.
3. Set up a vulnerability monitoring system that records the results of analyses
performed by Snyk
4. Set up notifications to alert the development team when vulnerabilities are
detected. Use integrations with communication tools like Slack to send real-
time alerts
5. Create a dashboard showing all detected vulnerabilities and their status. You
can use Grafana
6. Set up scripts or webhooks to automate dashboard updates at regular
intervals, for example, after each security scan or on a daily basis
Part 3 Delivery
A CI/CD pipeline configured to run security tests and generate reports on detected
vulnerabilities.
This step is crucial to verify that security features are properly implemented.
module.exports = unauthorizedAccess;
Frontend (Vue.js):
• Create mock components or use Vue's testing libraries to simulate security
behaviors.
• Example: Simulating a restricted area access attempt.
o Code:
```javascript
// RestrictedComponent.vue
<template>
<div v-if="isAuthorized">Welcome to the restricted area!</div>
<div v-else>You are not authorized to view this content.</div>
</template>
<script>
export default {
data() {
return {
isAuthorized: false, // Simulate unauthorized access
};
},
mounted() {
// Simulate an unauthorized state
this.checkAuthorization();
},
methods: {
checkAuthorization() {
// Stub logic to simulate unauthorized access
this.isAuthorized = false;
},
},
};
</script>
```
Part 4 Delivery
• A list of security test scenarios to be run with the Postman tool in the format:
Scenario, steps, expected results based on your understanding of the
application architecture, the definition of security objectives and the potential
threats identified.
• Results of security test scenarios executed with postman.
• Integrated security stubs in both the Node.js backend and Vue.js frontend that
simulate specific behaviors during security testing.
Once testing is complete, you will check the security of the containers and perform
dynamic analyses.
1. Analyze Docker containers with Trivy to detect vulnerabilities in container
images. You can also add Trivy in your workflow.
2. Use OWASP ZAP to conduct a dynamic application security test (DAST) to
identify security flaws (e.g., injections, XSS).
Delivery
Resources
2. Official Documentation:
3. Security Tools:
o OWASP ZAP: Web application security scanner.
4. Threat Modeling:
5. Version Control:
6. Courses:
7. Development Tools:
8. Best Practices:
To get rich, you choose to develop a complete web platform about crypto-
currencies.
Doing so, you’ll be able to source intel from your users and benefit from their
knowledges.
FEATURES
USERS MANAGEMENT
Three levels of access are managed with specific privileges:
• anonymous access:
• user access:
• administrator access:
CRYPTO-CURRENCIES
PRESS REVIEW
Your platform must be able to provide the freshest news on crypto-currencies. Set
up a background running service that will consume RSS feeds and offer a fine and
up-to-date press review.
Practical Tips
4. Conclusion (5 minutes)
a. Session summary and thanks to all participants.
b. Announcement of next steps or actions to be taken.
Time Management