Skip to content

Template repository for student practice assignments.

Notifications You must be signed in to change notification settings

Ildar1/RQCODE_tutorial

Repository files navigation

RQCODE Implementation Guide: Password Lockout Requirement

This guide walks you through implementing a new security requirement using the RQCODE . Follow the steps carefully to complete the task successfully.

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Step-by-Step Instructions
  4. Expected Results
  5. Resources

Introduction

This task demonstrates how to use the RQCODE to implement a security requirement for password lockout. The goal is to create a requirement that locks user accounts after a defined number of failed login attempts, preventing brute-force attacks.


Prerequisites

Before starting, ensure you have the following:

  • Access to the RQCODE tutorial repository.
  • Basic knowledge of Java programming.

Get Familiar with the Following Resources:

Make a Fork of the GitHub Repository

To begin, make a fork of the RQCODE GitHub tutorial repository:

Open the Web Editor

  • Navigate to the cloned repository folder on your local machine.
  • Press the . key to open the repository in an online VS Code IDE.
  • Click Run and Debug and then Continue Working On
    image
  • Click Create New Code Space
    image
  • Choose 2 cores, 8 GB RAM, 32 GB Storage
    image

How to Make a Pull Request

Follow this GitHub guide on creating a Pull Request from a fork.

It is important to create a Pull Request, as you will need to send the link to your Pull Request in the survey as proof of your work.

Security Requirement:

The system must lock a user’s account after 5 consecutive failed login attempts.

Step-by-Step Instructions

Your task is to implement the Security Requirement that enforces password lockout after 5 failed login attempts. Follow the steps below:

1. Implement the Required Functionality

Your implementation should include the following functionality:

  • Implement the class PasswordLockoutRequirement (ensure the name matches exactly). It should inherit from the Requirement class.

  • In this class, implement the following methods:

    • Track and increment the count of failed login attempts for a specific user.
    • Determine whether an account is locked after 5 consecutive failed login attempts.
    • Provide a way to reset failed login attempts after a successful login or manual reset.
    • Evaluate whether the lockout condition has been met and return the appropriate status using the check() method.

2. Use an Example for Reference

For guidance, refer to the implementation of PasswordUpdateRequirement. This example demonstrates how to structure and implement a security requirement in RQCODE.

By following these steps, you will successfully integrate the password lockout functionality into the RQCODE framework.

Example Implementation

For reference, you can check the implementation of a requirement in the PasswordLockoutRequirement. You might use it as a guide for your own implementation.

Run the Main Class

  • The Main class is pre-implemented. Run it following the GitHub Guide.
  • Install the recommended "Extension Pack for Java": image
  • After successful installation, you will see this window: image
  • In the terminal, you should be prompted with the following options:
Choose an action:
1. Simulate failed login attempt
2. Reset failed attempts
3. Check lockout status
4. Exit

Expected Results

After running the Main class, you should observe the following behavior:

  1. Enter 1: Simulate a failed login attempt multiple times.
  2. Enter 3: Check the lockout status after 5 consecutive failed attempts. The system should respond with “Account is locked.”
  3. Enter 2: Reset the failed attempts. Then, enter 3 again to verify that the account is no longer locked.
  4. Enter 4: Exit the program.

Final Step: Your Feedback

We value your feedback! After completing the implementation, please take a moment to fill out the survey:

Pass the Survey

About

Template repository for student practice assignments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages