This directory contains example configuration files for installing and running pd-agent as a system service on different platforms.
- pd-agent.service - systemd service file for Linux
- com.projectdiscovery.pd-agent.plist - launchd plist file for macOS
- windows-install-nssm.ps1 - PowerShell script for Windows installation using NSSM
- pd-agent-deployment.yaml - Kubernetes Deployment manifest
- pd-agent-pvc.yaml - Kubernetes PersistentVolumeClaim for persistent storage
-
Copy the service file to
/etc/systemd/system/:sudo cp pd-agent.service /etc/systemd/system/
-
Edit the service file and update the environment variables with your actual values:
sudo nano /etc/systemd/system/pd-agent.service
-
Follow the installation steps in the main README.md
-
Copy the plist file to your LaunchAgents directory:
cp com.projectdiscovery.pd-agent.plist ~/Library/LaunchAgents/ -
Edit the plist file and replace
YOUR_USERNAMEwith your actual macOS username:nano ~/Library/LaunchAgents/com.projectdiscovery.pd-agent.plist -
Update all placeholder values (API keys, team ID, etc.)
-
Follow the installation steps in the main README.md
-
Review and update the PowerShell script with your configuration values
-
Run the script as Administrator:
.\windows-install-nssm.ps1
-
The script will automatically download the binary and NSSM, install the service, and start it
The deployment manifest includes everything needed: namespace, service account, RBAC permissions, and deployment configuration. The agent automatically discovers Kubernetes cluster CIDRs (nodes, pods, services) for scanning.
1. (Optional) Customize the deployment:
Edit pd-agent-deployment.yaml to update:
- Namespace: Change
pd-agentto your desired namespace (update in all resources) - Agent tags (line 72): Change
productionto your desired tag - Agent networks (line 74): Change
kube-prod-clusterto your cluster identifier - Replicas: Change
1to your desired number of replicas
2. Create secret:
# Create namespace (should be the same as the namespace in the deployment file)
kubectl create namespace pd-agent
# Create secret with your PDCP credentials (update namespace if customized)
kubectl create secret generic pd-agent-secret \
--namespace pd-agent \
--from-literal=PDCP_API_KEY=your-api-key \
--from-literal=PDCP_TEAM_ID=your-team-id3. Deploy:
# Deploy the agent (creates namespace, RBAC, and deployment)
kubectl apply -f pd-agent-deployment.yaml
# Check status
kubectl get pods -n pd-agent
# View logs
kubectl logs -n pd-agent -l app=pd-agent -fNotes:
- The agent requires
ClusterRolepermissions to discover cluster subnets (nodes, pods, service CIDRs) - Uses
hostNetwork: truefor network discovery and scanning - Agent automatically caches and aggregates discovered subnets for efficient scanning
- Never commit real API keys or credentials - all example files use placeholder values
- Replace all placeholder values (
your-api-key,your-team-id, etc.) with actual values - Ensure the user/service account has appropriate permissions
- Review security considerations in the main README.md