{"id":21075380,"url":"https://github.com/shirshadatta/server-hardening","last_synced_at":"2026-05-19T00:41:28.239Z","repository":{"id":112513590,"uuid":"302384535","full_name":"ShirshaDatta/Server-Hardening","owner":"ShirshaDatta","description":"Ansible Playbooks for Server Hardening, these playbooks have been tested in AWS servers to provide and configure security in multiple servers.","archived":false,"fork":false,"pushed_at":"2020-10-26T14:46:20.000Z","size":1095,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T22:51:18.647Z","etag":null,"topics":["ansible","ansible-galaxy","ansible-playbook","ansible-role","automation","hacktoberfest","hacktoberfest2020","nginx-server","security","testing"],"latest_commit_sha":null,"homepage":"","language":null,"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/ShirshaDatta.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,"publiccode":null,"codemeta":null}},"created_at":"2020-10-08T15:28:55.000Z","updated_at":"2020-10-26T14:46:22.000Z","dependencies_parsed_at":"2023-05-15T12:00:18.175Z","dependency_job_id":null,"html_url":"https://github.com/ShirshaDatta/Server-Hardening","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirshaDatta%2FServer-Hardening","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirshaDatta%2FServer-Hardening/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirshaDatta%2FServer-Hardening/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirshaDatta%2FServer-Hardening/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShirshaDatta","download_url":"https://codeload.github.com/ShirshaDatta/Server-Hardening/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243521182,"owners_count":20304183,"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":["ansible","ansible-galaxy","ansible-playbook","ansible-role","automation","hacktoberfest","hacktoberfest2020","nginx-server","security","testing"],"created_at":"2024-11-19T19:22:12.711Z","updated_at":"2026-05-19T00:41:28.187Z","avatar_url":"https://github.com/ShirshaDatta.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Table of Contents\n\n* [About the Project](#about-the-project)\n  * [Built With](#built-with)\n* [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n* [Usage](#usage)\n* [Proofs](#proofs)\n* [Contributing](#contributing)\n* [License](#license)\n* [Contact](#contact)\n\n\n## About The Project\n\nThis Repository contains Server Hardening Techniques which are implemented using Ansible Roles\n\nI have created ansible roles for the following tasks\n- accounts : this installs and configures fail2ban which helps in intrusion detection and system administrators can check illegal activities from logs\nAlso I have created a user ansible which is part of group power which I have given sudo powers\n\n- network : Here we make ssh more secure by only allowing key based login , adding protocol 2 and limiting the number of tries , preventing TcpForwarding and etc\nI have also added firewall rules to allow ssh access only from a particular network and only allow webserver access requests and removed all other rules\n\n- physical : This provides security against single user mode and only allows login using password in the grub and also provides security against all types of physical attacks\nAlso changes grub settings .\n\n-  luks-conf : make a harddisk encrypted for users and users will be able to store data securely and can decrypt it anytime using passphrase\n\nThe repository contains ansible vaults\nAlong with that it contains a role for setting up and configuring docker and kubernetes in remote systems , the role name is kubernetes-docker\n\n\n### Built With\n\n* [Ansible](https://docs.ansible.com/)\n* [AWS](https://docs.aws.amazon.com/)\n* [Docker](https://docs.docker.com/)\n* [Kubernetes](https://kubernetes.io/docs/home/)\n\n\n## Getting Started\n\nThis is an example of how you may give instructions on setting up your project locally.\nTo get a local copy up and running follow these simple example steps.\n\n\n### Prerequisites\n\n* pip\n* AWS ec2 instance\n\n\n### Installation\n\n1. Install and configure yum, vim and git\n\n2. Clone the repo\n```sh\ngit clone https://github.com/ShirshaDatta/Server-Hardening\n```\n\n3. Ping to localhost\n```sh\nping localhost\n```\n\n4. Install Ansible (If python3 not installed, do it and then install ansible )\n```sh\npip3 install ansible\nor \nyum install ansible\n```\n## Usage\n\nCheck if ansible is installed successfully. Run the below command.\n``` ansible --version ```\n\n\u003cimg src= \"images/ansible --version.PNG\" alt=\"Logo\"\u003e\n\nSetup Firewall Rules.  Run the below given commands.\n```\ncd Server-Hardening\nansible-playbook network.yml\n```\n\u003cimg src = \"images/setup firewall rules.PNG\" alt=\"Logo\" \u003e\n\nCreate Super User and setup fail2ban\n```\nansible-playbook --ask-vault-pass accounts.yml\nEnter password: $ANSIBLE_VAULT_PASS\n```\n\u003cimg src = \"images/Create Super User and setup fail2ban.PNG\"\u003e\n\n## Proofs\n\nWe saw that the playbook is successfully run. Now we will cross-check the same manually.\n\nChecking if nginx is installed and  the service started and firewall rules.Run the below given commands.\n```\nsystemctl status nginx\niptables -L\n```\n\u003cimg src=\"images/checking.PNG\" alt=\"Logo\"\u003e\n\nChecking if fail-to-ban is installed and running.run the below given command.\n```\nsystemctl status fail2ban\n```\n\u003cimg src=\"images/checking2.PNG\" alt=\"Logo\" \u003e\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Added some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\n## Contact\n\n- Your Name - Shirsha Datta\n \n- You can contact me at shirshadatta2000@gmail.com\n\n- Project Link: [https://github.com/ShirshaDatta/Server-Hardening](https://github.com/ShirshaDatta/Server-Hardening)\n\n\n\u003c!-- ## Acknowledgements\n* [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet)\n* [Img Shields](https://shields.io)\n* [Choose an Open Source License](https://choosealicense.com)\n* [GitHub Pages](https://pages.github.com)\n* [Animate.css](https://daneden.github.io/animate.css)\n* [Loaders.css](https://connoratherton.com/loaders)\n* [Slick Carousel](https://kenwheeler.github.io/slick)\n* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)\n* [Sticky Kit](http://leafo.net/sticky-kit)\n* [JVectorMap](http://jvectormap.com)\n* [Font Awesome](https://fontawesome.com)\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshirshadatta%2Fserver-hardening","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshirshadatta%2Fserver-hardening","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshirshadatta%2Fserver-hardening/lists"}