Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Bareiss committed Sep 27, 2024
1 parent e43e7a9 commit d382477
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v6
with:
context: docker/
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
10 changes: 8 additions & 2 deletions docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y python3.10 git unzip python3-pip awscli curl vim lsb-release software-properties-common

RUN curl -s https://releases.hashicorp.com/terraform/1.4.5/terraform_1.4.5_linux_amd64.zip -o terraform.zip && \
RUN curl -s https://releases.hashicorp.com/terraform/1.9.6/terraform_1.9.6_linux_amd64.zip -o terraform.zip && \
unzip terraform.zip && \
mv terraform /usr/local/bin/

RUN git clone https://github.com/splunk/attack_range.git
RUN echo 'alias python=python3' >> ~/.bashrc

RUN mkdir -p /attack_range
COPY configs/ /attack_range/configs/
COPY modules/ /attack_range/modules/
COPY terraform/ /attack_range/terraform/
RUN mkdir -p /attack_range/apps/
COPY pyproject.toml attack_range.py attack_range.yml README.md LICENSE /attack_range/

WORKDIR /attack_range

RUN cd terraform/aws && terraform init
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion terraform/aws/modules/kali-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_instance" "kali_machine" {
connection {
type = "ssh"
user = "kali"
host = aws_instance.kali_machine[count.index].public_ip
host = self.public_ip
private_key = file(var.aws.private_key_path)
}
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/aws/modules/phantom-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource "aws_instance" "phantom-server" {
connection {
type = "ssh"
user = "ec2-user"
host = aws_instance.phantom-server[0].public_ip
host = self.public_ip
private_key = file(var.aws.private_key_path)
}
}
Expand All @@ -67,7 +67,7 @@ resource "aws_instance" "phantom-server" {

provisioner "local-exec" {
working_dir = "../ansible"
command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ec2-user --private-key '${var.aws.private_key_path}' -i '${aws_instance.phantom-server[0].public_ip},' phantom_server.yml -e @vars/phantom_vars.json"
command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ec2-user --private-key '${var.aws.private_key_path}' -i '${self.public_ip},' phantom_server.yml -e @vars/phantom_vars.json"
}
}

Expand Down
4 changes: 2 additions & 2 deletions terraform/aws/modules/splunk-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ resource "aws_instance" "splunk-server" {
connection {
type = "ssh"
user = "ubuntu"
host = aws_instance.splunk-server[0].public_ip
host = self.public_ip
private_key = file(var.aws.private_key_path)
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@ resource "aws_instance" "splunk-server" {
provisioner "local-exec" {
working_dir = "../ansible"
command = <<-EOT
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu --private-key '${var.aws.private_key_path}' -i '${aws_instance.splunk-server[0].public_ip},' splunk_server.yml -e "@vars/splunk_vars.json"
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu --private-key '${var.aws.private_key_path}' -i '${self.public_ip},' splunk_server.yml -e "@vars/splunk_vars.json"
EOT
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/aws/modules/zeek-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "aws_instance" "zeek_sensor" {
provisioner "local-exec" {
working_dir = "../ansible"
command = <<-EOT
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu --private-key '${var.aws.private_key_path}' -i '${aws_instance.zeek_sensor[0].public_ip},' zeek_server.yml -e "@vars/zeek_vars.json"
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu --private-key '${var.aws.private_key_path}' -i '${self.public_ip},' zeek_server.yml -e "@vars/zeek_vars.json"
EOT
}
}
Expand Down

0 comments on commit d382477

Please sign in to comment.