{"id":25311671,"url":"https://github.com/rogeriols/born2beroot-42sp","last_synced_at":"2025-09-23T10:39:24.299Z","repository":{"id":208113984,"uuid":"720839091","full_name":"RogerioLS/Born2BeRoot-42sp","owner":"RogerioLS","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-30T00:20:12.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T14:53:36.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RogerioLS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-19T18:51:53.000Z","updated_at":"2023-11-19T19:17:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"243ebcf3-0b35-4855-9c63-692535bdc13f","html_url":"https://github.com/RogerioLS/Born2BeRoot-42sp","commit_stats":null,"previous_names":["rogeriols/born2beroot-42sp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerioLS%2FBorn2BeRoot-42sp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerioLS%2FBorn2BeRoot-42sp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerioLS%2FBorn2BeRoot-42sp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RogerioLS%2FBorn2BeRoot-42sp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RogerioLS","download_url":"https://codeload.github.com/RogerioLS/Born2BeRoot-42sp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648974,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-13T14:53:37.455Z","updated_at":"2025-09-23T10:39:19.246Z","avatar_url":"https://github.com/RogerioLS.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align = center\u003e\n\n# :anchor: Born2BeRoot | 42 SP\n\n![Static Badge](https://custom-icon-badges.demolab.com/badge/BORN2_BE_ROOT-42-blue?logo=repo)\n![42 São Paulo](https://custom-icon-badges.demolab.com/badge/42-SP-1E2952)\n![License](https://custom-icon-badges.demolab.com/github/license/RogerioLS/Born2BeRoot-42sp?logo=law\u0026color=dark-green)\n![Code size in bytes](https://custom-icon-badges.demolab.com/github/languages/code-size/RogerioLS/Born2BeRoot-42sp?logo=file-code\u0026color=dark-green)\n![Top language](https://custom-icon-badges.demolab.com/github/languages/top/RogerioLS/Born2BeRoot-42sp?color=dark-green)\n![Last commit](https://custom-icon-badges.demolab.com/github/last-commit/RogerioLS/Born2BeRoot-42sp?logo=history\u0026color=dark-green)\n![Repo size](https://custom-icon-badges.demolab.com/github/repo-size/RogerioLS/Born2BeRoot-42sp?logo=database)\n![Languages](https://custom-icon-badges.demolab.com/github/languages/count/RogerioLS/Born2BeRoot-42sp?logo=command-palette\u0026color=red)\n![Discord](https://custom-icon-badges.demolab.com/discord/1114673462859006044?\u0026logo=comments\u0026label=testemunhas%20de%20vim\u0026color=ffbe3a)\n\n\u003c/div\u003e\n\n---\n\n\u003cdiv align = center\u003e\n\n![](https://game.42sp.org.br//static/assets/achievements/born2beroote.png)\n\n\n\u003c/div\u003e\n\nIn this project I learned the basics of virtualisation, system administration and security policies in order to set up my very first basic SSH server!\nThe virtual machine was set up in Oracle Virtualbox. The chosen operating system was the latest stable release of Debian GNU/Linux (bullseye), and I used `apt` package manager to install the tools used to enforce minimal security policies, such as:\n- setting up a firewall using `UFW`\n- configuring system administration with `sudo`\n- implementing strong password policy using `libpam-quality`\n- setting up a `cron` task to run a monitoring script every 10 minutes\n\nThis project also covered the basics of **criptography**, **networking**, **hard disk partitioning**, and **shell scripting** (lots of output formatting!)\n\n## Summary\nPassword policies:\n- minimum 10 characters\n- must contain at least 1 upper case character and 1 digit\n- must not contain username\n- must be at least 7 chars different from one password update to the other\n- must not contain more than 3 consecutive characters\n- expires in 30 days\n- minimum 2 days to change password\n- system warning 7 days prior do expiry date\n\nFirewall:\n- all ports must be closed except for port 4242 \n\nSSH:\n- default port changed to port 4242\n- must not be able to connect using SSH as root\n\nMonitoring:\n\n```pthon\n#!/bin/bash\narc=$(uname -a)\npcpu=$(grep \"physical id\" /proc/cpuinfo | sort | uniq | wc -l) \nvcpu=$(grep \"^processor\" /proc/cpuinfo | wc -l)\nfram=$(free -m | awk '$1 == \"Mem:\" {print $2}')\nuram=$(free -m | awk '$1 == \"Mem:\" {print $3}')\npram=$(free | awk '$1 == \"Mem:\" {printf(\"%.2f\"), $3/$2*100}')\nfdisk=$(df -BG | grep '^/dev/' | grep -v '/boot$' | awk '{ft += $2} END {print ft}')\nudisk=$(df -BM | grep '^/dev/' | grep -v '/boot$' | awk '{ut += $3} END {print ut}')\npdisk=$(df -BM | grep '^/dev/' | grep -v '/boot$' | awk '{ut += $3} {ft+= $2} END {printf(\"%d\"), ut/ft*100}')\ncpul=$(top -bn1 | grep '^%Cpu' | cut -c 9- | xargs | awk '{printf(\"%.1f%%\"), $1 + $3}')\nlb=$(who -b | awk '$1 == \"system\" {print $3 \" \" $4}')\nlvmu=$(if [ $(lsblk | grep \"lvm\" | wc -l) -eq 0 ]; then echo no; else echo yes; fi)\nctcp=$(ss -neopt state established | wc -l)\nulog=$(users | wc -w)\nip=$(hostname -I)\nmac=$(ip link show | grep \"ether\" | awk '{print $2}')\ncmds=$(journalctl _COMM=sudo | grep COMMAND | wc -l)\nwall \"\t#Architecture: $arc\n\t#CPU physical: $pcpu\n\t#vCPU: $vcpu\n\t#Memory Usage: $uram/${fram}MB ($pram%)\n\t#Disk Usage: $udisk/${fdisk}Gb ($pdisk%)\n\t#CPU load: $cpul\n\t#Last boot: $lb\n\t#LVM use: $lvmu\n\t#Connections TCP: $ctcp ESTABLISHED\n\t#User log: $ulog\n\t#Network: IP $ip ($mac)\n\t#Sudo: $cmds cmd\"\n\n```\n\n## Submission \nThis projects submission is a SHA hash of the virtual machine in its final state prior to evaluation. It was necessary to take a snapshot within Virtualbox to save the VM state, as it would be altered during each project defense.\nI've included in this repository the shell script used to make the monitoring panel as well.\n\n## Final note\nIf you're a 42 student struggling to understand this project, I got your back! Please refer to this Notion page that I wrote covering the general concepts related to this project! It's in Portuguese :cactus:\n\nNOTE:The author of the manual made in Portuguese is the student [Rods](https://github.com/rodsmade).\n\n\u003e [Acelera — Born2BeRoot](https://rodsmade.notion.site/Acelera-Born2BeRoot-99adac7a7bdc4bbf81b4eaf977625d5c)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogeriols%2Fborn2beroot-42sp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogeriols%2Fborn2beroot-42sp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogeriols%2Fborn2beroot-42sp/lists"}