Skip to content

The fourth project of 42 curriculum asks students to set up a virtual machine while implementing strict rules.

License

Notifications You must be signed in to change notification settings

ygor-sena/42cursus-born2beroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

OS Language Grade Status

Introduction

This project introduces the student to the wonderful world of virtualization. It was possible to choose between Debian and CentOS to be set up in VirtualBox. By July 26th 2022, this project was done in Debian with its most recent stable release (v11.4) since it's easier for first-time travelers learning this topic and it receives a lot of updates and new features.

For the bonus implementation, fail2ban was set up. It's a service that bans IPs after malicious signs, i.e. too many password failures.

Requirements

Mandatory:

  • ✅ Create at least 2 encrypted partitions using LVM.

  • ✅ A SSH service will be running on port 4242 only. It must not be possible to connect using SSH as root.

  • ✅ Configure UFW firewall to leave only port 4242 open.

  • ✅ Implement a strong password policy, that comply with the following requirements:

    • The password has to expire every 30 days.
    • The minimum number of days allowed before the modification of a password will be set to 2.
    • The user has to receive a warning message 7 days before their password expires.
    • The password must be at least 10 characters long. It must contain an uppercase letter, a lowercase letter, and a number. Also, it must not contain more than 3 consecutive identical characters.
    • The password must not include the name of the user.
    • The following rule does not apply to the root password: The password must have at least 7 characters that are not part of the former password.
    • The root password has to comply with this policy.
  • ✅ Install and configure sudo following strict rules, that comply with the following requirements:

    • Authentication using sudo has to be limited to 3 attempts in the event of an incorrect password.
    • A custom message of your choice has to be displayed if an error due to a wrong password occurs when using sudo.
    • Each action using sudo has to be archived, both inputs and outputs. The log file has to be saved in the /var/log/sudo/ folder.
    • The TTY mode has to be enabled for security reasons.
    • The paths that can be used by sudo must be restricted. For example: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
  • ✅ In addition to root, a user has to be present and it must belong to user42 and sudo groups.

  • ✅ Create a script developed in bash that display some operating system information every 10 minutes since server startup.

Bonus:

  • ✅ Set up root, swap, home, var, srv, tmp and var--log encrypted partitions using LVM.
  • ✅ Set up a functional WordPress website with the following services: lighttpd, MariaDB and PHP.
  • ✅ Set up a service of your choice that you think is useful (NGINX / Apache2 excluded!).

References

About

The fourth project of 42 curriculum asks students to set up a virtual machine while implementing strict rules.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published