Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial modifications from dshield repo.
- Loading branch information
Showing
7 changed files
with
163 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dshield.tfvars | ||
*.tfvars | ||
terraform.tfstate | ||
terraform.tfstate.backup | ||
tfplan | ||
*.plan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
This is a modification of Azure Terraform code in main DShield repo https://github.com/DShield-ISC/dshield | ||
|
||
### For instructions on how to install `terraform`, please consult the following: | ||
- [HashiCorp Terraform Installation](https://learn.hashicorp.com/tutorials/terraform/install-cli) | ||
|
||
### Configure Azure with a service principal: | ||
- [Powershell guide](https://learn.microsoft.com/en-us/powershell/azure/create-azure-service-principal-azureps?view=azps-11.0.0) | ||
- [Hashicorp guide](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret) | ||
|
||
### Create a .azconfigurevars file to generate environment variables for the service principal secrets | ||
``` | ||
export ARM_CLIENT_SECRET= | ||
export ARM_CLIENT_ID= | ||
export ARM_TENANT_ID= | ||
export ARM_SUBSCRIPTION_ID= | ||
export AZURE_LOCATION=eastus | ||
export AZURE_VM_SIZE= | ||
``` | ||
|
||
### Create a DShield ISC account | ||
- [https://www.dshield.org/login.html](https://www.dshield.org/login.html) | ||
|
||
### Create a .tfvars file with the following. These will be generated when you create an ISC account. | ||
``` | ||
dshield_email="" | ||
dshield_apikey="" | ||
dshield_userid="" | ||
``` | ||
|
||
### Optional variables: | ||
- **honeypot_nodes** (default: `1` *increase to scale horizontally*) | ||
- **azure_region** (default: `East US`) _if using **Azure**_ | ||
- **azure_image_size** (default: `Standard_B1ls`) _if using **Azure**_ | ||
- **honeypot_network** (default: `10.40.0.0/16` for VPC & `10.40.0.0/24` for SG) | ||
- **honeypot_ssh_port** (default: `12222`) | ||
- **dshield_ca_country** (default: `US`) | ||
- **dshield_ca_state** (default: `Florida`) | ||
- **dshield_ca_city** (default: `Jacksonville`) | ||
- **dshield_ca_company** (default: `DShield`) | ||
- **dshield_ca_depart** (default: `Decoy`) | ||
|
||
- SSH credentials are contained in the default location: | ||
- `~/.ssh/id_rsa` | ||
- `~/.ssh/id_rsa.pub` | ||
|
||
### After completing the above items, run the following commands to begin the installation: | ||
```terraform init; terraform plan --var-file=.tfvars -out=honeypot; terraform apply "honeypot"``` | ||
**OR** | ||
```terraform init; terraform apply``` and type `yes` when prompted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
output "honeypot_ip" { | ||
description = "Honeypot Public IP" | ||
value = data.azurerm_public_ip.honeypot[*].ip_address | ||
} | ||
|
||
output "connecting_via_ssh" { | ||
description = "Connecting via ssh" | ||
value = [ | ||
for ip in data.azurerm_public_ip.honeypot[*].ip_address : | ||
join("", | ||
[ | ||
"ssh ", | ||
"-i ", | ||
var.azure_ssh_key_priv, | ||
" ", | ||
var.azure_image_user, | ||
"@", | ||
ip, | ||
]) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "= 3.0.0" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /bin/bash | ||
cd ~/ | ||
mkdir install | ||
cd install | ||
git clone https://github.com/DShield-ISC/dshield.git | ||
cd dshield/bin | ||
mv /tmp/makecert2.sh makecert.sh | ||
chmod +x makecert.sh | ||
sudo ./install.sh --upgrade | ||
if [ ${output_logging} = true ]; then | ||
chmod +x /tmp/enable_logging.sh | ||
sudo /tmp/enable_logging.sh | ||
fi | ||
sudo reboot |
Oops, something went wrong.