This project deploys an Acunetix360 scanner agent on Azure Kubernetes Service (AKS) using Terraform and GitHub Actions.
- Azure Kubernetes Service (AKS): Hosts the Acunetix360 scanner agent
- Azure Container Registry (ACR): Stores the Docker image for the scanner agent
- Terraform: Manages the Azure infrastructure
- GitHub Actions: Automates the deployment process
- An Azure subscription
- An Acunetix360 account
- GitHub repository with GitHub Actions enabled
Create an Azure Service Principal for GitHub Actions:
az ad sp create-for-rbac --name "acunetix360-github-actions" --role contributor \
--scopes /subscriptions/{subscription-id}/resourceGroups/ONRR-ISS \
--sdk-authSave the output JSON for the next step.
Add the following secrets to your GitHub repository:
AZURE_CREDENTIALS: The JSON output from the Azure Service Principal creationACUNETIX_EMAIL: Your Acunetix360 account emailACUNETIX_PASSWORD: Your Acunetix360 account passwordACUNETIX_API_URL(optional): Custom API URL if not using the default
The deployment will be triggered automatically on push to the main branch, or you can manually trigger it from the GitHub Actions tab.
If you need to deploy manually:
-
Install the required tools:
-
Log in to Azure:
az login
-
Initialize and apply Terraform:
cd terraform terraform init terraform apply -
Build and push the Docker image:
ACR_LOGIN_SERVER=$(terraform output -raw acr_login_server) az acr login --name $(echo $ACR_LOGIN_SERVER | cut -d'.' -f1) docker build -t $ACR_LOGIN_SERVER/acunetix360-scanner:latest . docker push $ACR_LOGIN_SERVER/acunetix360-scanner:latest
-
Deploy to Kubernetes:
az aks get-credentials --resource-group ONRR-ISS --name acunetix360-aks kubectl apply -f kubernetes/configmap.yaml kubectl apply -f kubernetes/service.yaml # Replace ACR_LOGIN_SERVER in deployment.yaml sed -i 's|\${ACR_LOGIN_SERVER}|'$ACR_LOGIN_SERVER'|g' kubernetes/deployment.yaml kubectl apply -f kubernetes/deployment.yaml # Create secrets kubectl create secret generic acunetix360-credentials \ --from-literal=email=your-email@example.com \ --from-literal=password=your-password
You can customize the deployment by modifying the variables in terraform/variables.tf:
prefix: Prefix for all resources (default: "acunetix360")kubernetes_version: Kubernetes version (default: "1.27.3")node_count: Initial number of nodes (default: 2)min_node_count: Minimum number of nodes for auto-scaling (default: 1)max_node_count: Maximum number of nodes for auto-scaling (default: 5)vm_size: VM size for AKS nodes (default: "Standard_D2s_v3")
You can customize the Kubernetes deployment by modifying the files in the kubernetes/ directory:
deployment.yaml: Deployment configuration (replicas, resources, etc.)service.yaml: Service configurationconfigmap.yaml: ConfigMap for non-sensitive configuration
To update the scanner agent:
- Update the Dockerfile or scanner-agent-installer.sh as needed
- Push the changes to the main branch
- GitHub Actions will automatically rebuild and deploy the updated scanner
To scale the number of scanner agents:
kubectl scale deployment acunetix360-scanner --replicas=3kubectl get pods
kubectl logs -f <pod-name>kubectl get deployments
kubectl describe deployment acunetix360-scanner- All sensitive information is stored in Kubernetes secrets
- The scanner agent runs as a non-root user
- Network policies are applied to restrict traffic
- The container has minimal permissions