Site icon Kali Linux Tutorials

Domain-Protect : Protect Against Subdomain Takeover

Domain-Protect : Protect Against Subdomain Takeover

deploy to security audit account

scan your entire AWS Organization

receive alerts by Slack or email

or manually scan from your laptop

Subdomain Detection Functionality

Scans Amazon Route53 to identify:

Optional Additional Check

Turned off by default as it may result in Lambda timeouts for large organisations

To enable, create this Terraform variable in your tfvars file or CI/CD pipeline:

lambdas = [“alias-cloudfront-s3”, “alias-eb”, “alias-s3”, “cname-cloudfront-s3”, “cname-eb”, “cname-s3”, “ns-domain”, “ns-subdomain”, “cname-azure”, “cname-google”, “a-storage”]

Options

  1. scheduled lambda functions with email and Slack alerts, across an AWS Organization, deployed using Terraform
  2. manual scans run from your laptop or CloudShell, in a single AWS account

Notifications

Requirements

Usage

terraform init -backend-config=bucket=TERRAFORM_STATE_BUCKET -backend-config=key=TERRAFORM_STATE_KEY -backend-config=region=TERRAFORM_STATE_REGION
terraform workspace new dev
terraform plan
terraform apply

AWS IAM Policies

For least privilege access control, example AWS IAM policies are provided:

Adding New Checks

Adding Notifications To Extra Slack Channels

Testing

ci/cd

ENVIRONMENT VARIABLEEXAMPLE VALUE / COMMENT
AWS_ACCESS_KEY_IDusing domain-protect deploy policy
AWS_SECRET_ACCESS_KEY–
TERRAFORM_STATE_BUCKETtfstate48903
TERRAFORM_STATE_KEYdomain-protect
TERRAFORM_STATE_REGIONus-east-1
TF_VAR_org_primary_account012345678901
TF_VAR_security_audit_role_namenot needed if “domain-protect-audit” used
TF_VAR_external_idonly required if External ID is configured
TF_VAR_slack_channels[“security-alerts”]
TF_VAR_slack_channels_dev[“security-alerts-dev”]
TF_VAR_slack_webhook_urls[“https://hooks.slack.com/services/XXX/XXX/XXX”]

docker run -v pwd:/whatever circleci/circleci-cli circleci config validate /whatever/.circleci/config.yml

Exit mobile version