Skip to content

Commit

Permalink
Merge pull request #5 from gwuniversity/windows_ami
Browse files Browse the repository at this point in the history
add byo windows ami support and move nessus install to hosts
  • Loading branch information
cudgel authored Sep 7, 2024
2 parents cf0bd29 + ef4efa0 commit c59a154
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions configs/attack_range_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ aws:
private_subnet_id: ""
# VPC ID and subnet arn for byo vpc in AWS.

windows_ami: ""

azure:
location: "West Europe"
# Region used in Azure.
Expand Down Expand Up @@ -251,6 +253,9 @@ windows_servers_default:
install_cisco_amp: "0"
# Install Cisco AMP by setting this to 1.

install_nessus: "0"
# Install Nessus by setting this to 1.

aurora_agent: "0"
# Install Aurora Agent

Expand Down Expand Up @@ -282,8 +287,8 @@ linux_servers_default:
install_cisco_amp: "0"
# Install Cisco AMP by setting this to 1.

aurora_agent: "0"
# Install Aurora Agent
install_nessus: "0"
# Install Nessus by setting this to 1.

instance_profile_name: ""
# Instance profile name generated by IAM
Expand Down
2 changes: 1 addition & 1 deletion terraform/ansible/roles/tenable_agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
when: ansible_os_family == "Debian" and general.nessus_agent == "1"

- include_tasks: windows.yml
when: ansible_os_family == "Windows" and general.nessus_agent == "1"
when: ansible_os_family == "Windows" and windows_servers.install_nessus== "1"
4 changes: 3 additions & 1 deletion terraform/aws/modules/windows/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ data "aws_ami" "windows_ami" {

resource "aws_instance" "windows_server" {
count = length(var.windows_servers)
ami = data.aws_ami.windows_ami[count.index].id
ami = var.aws.windows_ami != "" ? var.aws.windows_ami : data.aws_ami.windows_ami[count.index].id
instance_type = (var.zeek_server.zeek_server == "1" || var.snort_server.snort_server == "1") ? "m5.2xlarge" : "t3.xlarge"
key_name = var.general.key_name
subnet_id = var.ec2_subnet_id
private_ip = "${var.aws.network_prefix}.${var.aws.first_dynamic_ip + count.index}"
vpc_security_group_ids = [var.vpc_security_group_ids]
iam_instance_profile = var.instance_profile_name
associate_public_ip_address = true

tags = {
Name = "ar-win-${var.general.key_name}-${var.general.attack_range_name}-${count.index}"
}

user_data = <<EOF
<powershell>
$admin = [adsi]("WinNT://./Administrator, user")
Expand Down

0 comments on commit c59a154

Please sign in to comment.