Skip to content

Charles-Roro/Honeyapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Honeyapp

Using AWS and GCP to create and monitor a Fake app. Tools we will use: Bash, Cloud Shell, Snyk, Terraform, Ansible, Ubuntu/Debian Linux, NMap, and Wazuh

First step is to create all the folders and files we will need for the project via the command line.

Screenshot 2024-11-22 at 11 29 35 AM

Now setting up the AWS terraform file. 2 IMPORTANT things to remember here are we do NOT want to use the default VPC in AWS and 2 when creating VMs in terraform with AWS you NEED to pay attention to the "AMI ID" for the OS you are using each region I.E 'us-east-1' and/or 'us-east-2' have different "AMI ID's" even if the OS is the same. I'll post a picture below.(The Highlighted section). We need to make sure we have port 22 open in our Security group so we can use ansible to automate the installation of the plugins we need. Screenshot 2024-11-22 at 11 33 03 AM

Copy that from your respective region and add it to the terraform file Screenshot 2024-11-22 at 11 31 25 AM

Next we will move on to the GCP Linux server that will host our make believe "app." We have to make sure in GCP to add a certain tag to the VM "http-server" as well as have port 80 open in or VPC so we can access the site. Like the AWS EC2 AM we need to have port 22 open so we can have ansible connect and automate the installation of the plugins we need. Screenshot 2024-11-22 at 12 04 07 PM Screenshot 2024-11-22 at 12 08 18 PM

Next we will have snyk do an IaC test on this first part of our terraform code. (No major issues are 2 High issues are because we are allowing SSH from the whole internet. Normally you would want to restrict it to certain IPS of your/works network) Screenshot 2024-11-22 at 11 34 44 AM

Now for the website we will use AI to help create the html for the simple website(I'm not a webdev forgot all that from highschool haha) Screenshot 2024-11-22 at 12 11 24 PM Screenshot 2024-11-22 at 12 11 48 PM Screenshot 2024-11-22 at 12 11 34 PM Screenshot 2024-11-22 at 12 12 08 PM

Now we will run "terraform init," then plan, and then apply to spin up in our AWS and GCP consols! Screenshot 2024-11-22 at 12 14 34 PM

"Terraform plan" looks good and no issues

Screenshot 2024-11-22 at 12 15 10 PM

Next we will run the following command "terraform apply -auto-approve -var-file=terraform.auto.tfvars" This will do a few things. "Apply" will tell terraform to build anything that is in our files that has not been created yet. "-auto-approve" will automatically confirm that we want to do these 'changes.' "-var-file= lets terraform know we have variables that we are using in this set up.

Screenshot 2024-11-22 at 12 24 20 PM

Up and running! Screenshot 2024-11-22 at 12 25 00 PM Screenshot 2024-11-22 at 12 25 18 PM

Now that are VM's are running in GCP and AWS we will now use ansible to install and update the needed tools. First lets add NMAP to our AWS EC2 Screenshot 2024-11-22 at 12 30 18 PM Looks like we were able to connect and install NMAP lets check in the AWS EC2 instance! Screenshot 2024-11-22 at 12 32 36 PM Screenshot 2024-11-22 at 12 34 16 PM

Now lets run our GCP ansible playbook! Screenshot 2024-11-22 at 2 15 40 PM

Now lets check or IP address to see if the apache loads. Good the apache page is showing1 Screenshot 2024-11-22 at 2 19 21 PM

Now we will deploy our website.yml Screenshot 2024-11-22 at 2 21 29 PM

Now lets check the url again. Screenshot 2024-11-22 at 2 32 47 PM

Now our website is up and running!

Next we will set up Wazuh via the Deployment Market place. Screenshot 2024-11-26 at 11 28 50 AM There are guided instructions be sure to follow them I'll add the link Here Screenshot 2024-11-26 at 11 31 05 AM Screenshot 2024-11-26 at 11 31 18 AM Now deployed in GCP Screenshot 2024-11-26 at 11 37 25 AM

Next we need to wait about 5-15 minutes for the services to start. Then we follow the instructions to set up our agent to put it in our GCP-Linux-Box. Be sure to add the ip address of your Wazuh server. Screenshot 2024-11-26 at 11 49 39 AM Next we ssh into our GCP-Linux-Box and run the commands given in Wazuh to install the agent. Screenshot 2024-11-26 at 12 01 12 PM Now let's check Wazuh if the agent is active. It is now up and running! Also connected via our internal GCP subnet! Screenshot 2024-11-26 at 12 02 58 PM

Our last steps will involve going back to AWS and we will SSH into our instance and run a few NMap scans on our GCP-Linux-Box Screenshot 2024-11-26 at 12 22 02 PM Screenshot 2024-11-26 at 12 37 56 PM

Now we are all finished! You could always run more advanced scans and simulated attacks!

Remember to TEAR DOWN any unused resources with Terraform!

About

Using AWS, GCP, and Docker to create and monitor a Fake app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors