GithubHelp home page GithubHelp logo

spacecase123 / cloudlabsad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chvancooten/cloudlabsad

0.0 0.0 0.0 310 KB

Terraform + Ansible deployment scripts for an Active Directory lab environment.

License: MIT License

Shell 38.05% C# 1.15% PowerShell 24.73% HCL 35.03% ASP.NET 1.03%

cloudlabsad's Introduction

Cloud Labs AD

By @chvancooten, Ansible role for Elastic Security deployment by @nodauf

Provisioning scripts for an Active Directory lab environment. Designed to be deployed to Azure using the Azure cloud shell.

Setup

The lab is provisioned automatically using Terraform and Ansible. First, Terraform deploys all the infrastructure and prepares the machines for provisioning. It then kicks off a role-based Ansible playbook from the Debian attacker machine to provision the Windows-based machines. The full process takes about 15 to 20 minutes to complete.

๐Ÿ’ธ Note: The machine sizes are moderately large by default ('Standard_B4ms'). In my testing the bill was approx. โ‚ฌ10 per day of active use, your mileage may vary. Change the appropriate 'size' settings in terraform.tfvars to change machine sizes.

Deployment

  • Clone the repo to your Azure cloud shell. It conveniently has all you need (Terraform and an authenticated Azure provider). Alternatively, install and configure Terraform and the Azure provider yourself. Ansible is installed automatically as part of the provisioning process.
  • Copy terraform.tfvars.example to terraform.tfvars in the Terraform directory, and configure the variables appropriately.
  • In the same directory, run terraform init.
  • When you're ready to deploy, run terraform apply (or terraform apply --auto-approve to skip the approval check).

Once deployment and provisioning have finished, the output variables (public IP / DNS name, administrative passwords, machine names, etc.) will be displayed. You are now ready to connect to the labs!

Post-Deployment Configuration

  • If you want to use ADCS, you have to RDP to the DC and follow the post-deployment configuration steps to activate ADCS and the ADCS web enrolment endpoint. Make sure to enable the 'Certification Authority', 'Certification Authority Web Enrollment', and 'Certificate Enrollment Web Service' role services (you can leave the default settings otherwise).

Removal

  • When you're done with the labs, run terraform destroy to tear down the environment.

Labs

Lab overview

The labs consist of a selection of machines:

  • Windows Server 2016 DC
    • Active Directory Certificate Services (ADCS) installed
  • Windows Server 2019
    • Internet Information Services (IIS) web server with simple vulnerable app
  • Windows 10 client
  • Debian box with Elastic Endpoint Security
    • Elastic Agent is deployed to all Windows machines via Fleet
  • Debian attacker box

One public IP is exposed for the whole lab. The IP ranges defined in the ip-whitelist are allowed to access the following ports on this IP address, which are bound to the following services using a load balancer:

  • Port 22 -> Attacker machine SSH
  • Port 80 -> Windows Server 2019 IIS web server with vulnerable page
  • Port 3389 -> Windows 10 Client RDP

Another public IP is used for outbound Internet connectivity for all lab machines.

Wishlist

At a later point I might add the following:

  • Advanced logging configs on Windows
  • Exchange Server + Microsoft Office on Win10 machine

cloudlabsad's People

Contributors

chvancooten avatar nodauf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.