Skip to content

Commit

Permalink
added traffic code
Browse files Browse the repository at this point in the history
  • Loading branch information
Janibasha committed Apr 20, 2024
1 parent 200d3d6 commit 0dd1383
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/bot-defense-re.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ jobs:
- name: Terraform Apply
if: github.ref == 'refs/heads/bot-defense-re' && github.event_name == 'push'
run: terraform apply -auto-approve -input=false

- name: Run Traffic
run: |
cp ../tools/run-curl-traffic.sh .
domain1 = "$terraform output -raw lb_domain.0"
domain2 = "$terraform output -raw lb_domain.1"
.\run-curl-traffic.sh $domain1
.\run-curl-traffic.sh $domain2
8 changes: 8 additions & 0 deletions tools/run-curl-traffic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for run in {1..10}
do
echo "Running commands against website Address - $1"
curl -s "$1" -i -X POST -d "username=1&password=1"
sleep 10
echo CURL Credential Stuffing attempt "$run" done
sleep 2
done
3 changes: 3 additions & 0 deletions xc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ output "endpoint" {
}
output "az_ce_site_pub_ip" {
value = var.az_ce_site ? regex("master_public_ip_address = \"((?:\\d{1,3}\\.){3}\\d{1,3})\"", volterra_tf_params_action.action_apply[0].tf_output) : null
}
output "lb_domain" {
value = volterra_http_loadbalancer.lb_https.domains
}
3 changes: 2 additions & 1 deletion xc/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ xc_api_val_custom = false
xc_bot_def = false
xc_bot_path = "/user"
need_infra = false
site_name = "sv10-sjc"

#XC DDoS
xc_ddos_pro = false
Expand All @@ -73,4 +74,4 @@ xc_mud = false
# CE configs
gcp_ce_site = "false"
aws_ce_site = "false"
site_name = "sj10-sjc"

10 changes: 5 additions & 5 deletions xc/xc_vk8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "volterra_namespace" "this" {
count = var.vk8s ? 1 : 0
name = var.xc_namespace
}

/*
# create virtual site
resource "volterra_virtual_site" "this" {
count = var.vk8s ? 1 : 0
Expand All @@ -14,16 +14,16 @@ resource "volterra_virtual_site" "this" {
expressions = [format("ves.io/siteName == %s", var.site_name)]
}
site_type = "REGIONAL_EDGE"
}
}*/

# create vK8s
resource "volterra_virtual_k8s" "this" {
name = "${local.project_prefix}-${local.build_suffix}-vk8s"
namespace = var.xc_namespace
depends_on = [volterra_virtual_site.this]
depends_on = [volterra_namespace.this]
vsite_refs {
name = volterra_virtual_site.this.0.name
namespace = var.xc_namespace
name = "ves-io-all-res"
namespace = "shared"
}

provisioner "local-exec" {
Expand Down

0 comments on commit 0dd1383

Please sign in to comment.