### Query Documentation Example Source: https://docs.defguard.net/features/yubikey-provisioning Example of how to query the documentation dynamically using an HTTP GET request with the 'ask' query parameter. ```http GET https://docs.defguard.net/features/yubikey-provisioning.md?ask= ``` -------------------------------- ### Defguard Installation Configuration Prompts Source: https://docs.defguard.net/tutorials/step-by-step-setting-up-a-vpn-server These are example answers to the configuration prompts during the Defguard setup script. Adjust these values based on your domain names, network configuration, and desired VPN settings. ```bash Enter Defguard domain [default: ]: my-server.defguard.net Enter enrollment domain [default: ]: enroll.defguard.net Use HTTPS [default: false]: true Enter VPN location name [default: ]: Example Enter VPN server address and subnet (e.g. 10.0.60.1/24) [default: ]: 10.22.33.1/24 Enter VPN gateway public IP [default: ]: 185.33.37.51 Enter VPN gateway public port [default: ]: 50555 ``` -------------------------------- ### Defguard Deployment Setup Script Help Source: https://docs.defguard.net/getting-started/one-line-install This displays the available command-line options for the Defguard deployment setup script. Use these options to configure the installation non-interactively. ```bash Defguard deployment setup script v1.1.0 Copyright (C) 2023 teonite Usage: [options] Available options: --help this help message --non-interactive run in non-interactive mode (no user input) --domain domain where Defguard web UI will be available --enrollment-domain domain where enrollment service will be available --use-https configure reverse proxy to use HTTPS --vpn-name VPN location name --vpn-ip
VPN server address & netmask (e.g. 10.0.50.1/24) --vpn-gateway-ip VPN gateway external IP --vpn-gateway-port VPN gateway external port --dev use development docker images --pre-release use pre-release docker images ``` -------------------------------- ### Dynamic Documentation Query Example Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Example of how to query the documentation dynamically using an HTTP GET request with an 'ask' parameter. ```http GET https://docs.defguard.net/deployment-strategies/standalone-package-based-installation.md?ask= ``` -------------------------------- ### Install Defguard Pre-release Source: https://docs.defguard.net/getting-started/one-line-install This command installs the latest alpha, beta, or release candidate versions of Defguard. It downloads and runs the setup script with the --pre-release flag. ```shell curl --proto '=https' --tlsv1.2 -sSf -L https://raw.githubusercontent.com/DefGuard/deployment/main/docker-compose/setup.sh -O && bash setup.sh --pre-release ``` -------------------------------- ### Install Defguard Production Release Source: https://docs.defguard.net/getting-started/one-line-install Use this command to download and execute the setup script for the most stable Defguard production release. It initiates an interactive configuration process. ```shell curl --proto '=https' --tlsv1.2 -sSf -L https://raw.githubusercontent.com/DefGuard/deployment/main/docker-compose/setup.sh -O && bash setup.sh ``` -------------------------------- ### Install NGINX and Certbot Source: https://docs.defguard.net/deployment-strategies/reverse-proxy-configuration-using-nginx Installs NGINX and Certbot, then enables and starts the NGINX service. Disables the default NGINX configuration to prevent conflicts. ```bash apt install nginx certbot systemctl enable nginx.service systemctl start nginx.service unlink /etc/nginx/sites-enabled/default ``` -------------------------------- ### Install Latest Development Builds Source: https://docs.defguard.net/getting-started/one-line-install Execute this command to download and run the setup script for the latest development builds of Defguard. It uses the --dev flag for the newest, potentially unstable, features. ```shell curl --proto '=https' --tlsv1.2 -sSf -L https://raw.githubusercontent.com/DefGuard/deployment/main/docker-compose/setup.sh -O && bash setup.sh --dev ``` -------------------------------- ### Install DefGuard Client with Provisioning Source: https://docs.defguard.net/features/desktop-client-auto-provisioning/auto-provisioning-in-windows-environments/on-premise-active-directory-environments Command to install the DefGuard client using the MSI installer, enabling the provisioning script to run during installation by passing the PROVISIONING=1 argument. ```cmd msiexec /i defguard-client.msi PROVISIONING=1 ADAttribute="description" ``` -------------------------------- ### API Request Example Source: https://docs.defguard.net/features/activity-log/activity-log-streaming/activity-log-integrations/vector-integration-guide Demonstrates how to query documentation dynamically by making an HTTP GET request with the `ask` query parameter. This is useful for retrieving specific information or clarifications not explicitly present on the page. ```http GET https://docs.defguard.net/features/activity-log/activity-log-streaming/activity-log-integrations/vector-integration-guide.md?ask= ``` -------------------------------- ### Querying Documentation Source: https://docs.defguard.net/features/openid-connect/vault This example shows how to query the documentation dynamically using an HTTP GET request with the 'ask' query parameter. This is useful for retrieving specific information not explicitly present on the page. ```http GET https://docs.defguard.net/features/openid-connect/vault.md?ask= ``` -------------------------------- ### Query Documentation via GET Request Source: https://docs.defguard.net/features/integrations/webhooks This example demonstrates how to query the documentation dynamically by appending an 'ask' query parameter to the page URL. ```http GET https://docs.defguard.net/features/integrations/webhooks.md?ask= ``` -------------------------------- ### Query Documentation Example Source: https://docs.defguard.net/features/openid-connect/grafana-setup To get additional information not directly on the page, make a GET request to the page URL with an `ask` query parameter containing your question. ```http GET https://docs.defguard.net/features/openid-connect/grafana-setup.md?ask= ``` -------------------------------- ### Example API GET Request with Token Source: https://docs.defguard.net/features/integrations/api-tokens This example demonstrates how to make a GET request to the /api/v1/me endpoint using curl and authenticating with your API token in the Authorization header. ```bash curl -H "Authorization: Bearer " /api/v1/me ``` -------------------------------- ### Defguard Gateway Service Log Output Example Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Example log output from the Defguard gateway service, showing startup information, configuration details, and interface setup. ```log [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] Starting defguard gateway version 0.7.0 with configuration: Config { token: "***", name: Some("Gateway on server X"), grpc_url: "https://my-server.defguard.net:444/", userspace: false, grpc_ca: None, stats_period: 60, ifname: "wg0", pidfile: None, use_syslog: false, syslog_facility: "LOG_USER", syslog_socket: "/var/run/log", config_path: None, pre_up: None, post_up: None, pre_down: None, post_down: None, health_port: None } [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] gRPC server connection setup done. [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] Creating interface wg0 [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] Configuring interface wg0 with config: InterfaceConfiguration { name: "Szczecin", address: "10.22.33.1/24", port: 50051, peers: [], mtu: None, .. } [2024-07-27T16:37:56Z WARN netlink_packet_route::link::buffer_tool] Specified IFLA_INET6_STATS NLA attribute holds more(most likely new kernel) data which is unknown to netlink-packet-route crate, expecting 288, got 296 [2024-07-27T16:37:56Z WARN netlink_packet_route::link::buffer_tool] Specified IFLA_INET6_STATS NLA attribute holds more(most likely new kernel) data which is unknown to netlink-packet-route crate, expecting 288, got 296 [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] Reconfigured WireGuard interface Szczecin (address: 10.0.0.1/24) [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] Stats thread spawned. [2024-07-27T16:37:56Z INFO defguard_gateway::gateway] Connected to defguard gRPC endpoint: https://my-server.defguard.net:444/ ``` -------------------------------- ### Enable and Start Defguard Proxy Service (systemd) Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Commands to enable the Defguard proxy service to start on boot and then start it immediately on systems using systemd. ```bash systemctl enable defguard-proxy.service systemctl start defguard-proxy.service ``` -------------------------------- ### Dynamic Documentation Query Example Source: https://docs.defguard.net/features/openid-connect To get more information not directly present on the page, make a GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://docs.defguard.net/features/openid-connect.md?ask= ``` -------------------------------- ### Query Documentation Example Source: https://docs.defguard.net/features/desktop-client-auto-provisioning/generating-enrollment-tokens-with-defguard-rest-api This example demonstrates how to query the Defguard documentation dynamically by appending an 'ask' parameter with a question to the page URL. ```http GET https://docs.defguard.net/features/desktop-client-auto-provisioning/generating-enrollment-tokens-with-defguard-rest-api.md?ask= ``` -------------------------------- ### Check Setup Logs Source: https://docs.defguard.net/deployment-strategies/terraform Inspect the /var/log/defguard.log file on the EC2 instance to diagnose issues during the initial setup script execution. ```bash cat /var/log/defguard.log ``` -------------------------------- ### Run Defguard Stack with Docker Compose Source: https://docs.defguard.net/for-developers/dev-env-setup Start the Defguard Core, PostgreSQL database, Defguard Gateway, and an example device using Docker Compose. ```bash docker compose up ``` -------------------------------- ### Install Defguard Client Package Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation/defguard-apt-repository Install the Defguard Client package using APT after the repository has been added. ```bash sudo apt install defguard-client ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.defguard.net/features/desktop-client-auto-provisioning/auto-provisioning-in-windows-environments/on-premise-active-directory-environments Example of how to query the documentation dynamically by appending an 'ask' query parameter to the page URL. This is useful for retrieving specific information or clarifications not explicitly present on the page. ```http GET https://docs.defguard.net/features/desktop-client-auto-provisioning/auto-provisioning-in-windows-environments/on-premise-active-directory-environments.md?ask= ``` -------------------------------- ### Install Defguard Helm Chart Source: https://docs.defguard.net/deployment-strategies/kubernetes Install the Defguard Helm chart into the specified namespace using the customized values file. The `--wait=true` flag ensures the installation completes before proceeding. ```bash helm install --wait=true --namespace defguard defguard defguard -f values.yaml ``` -------------------------------- ### Enable and Start Defguard Gateway Service Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation These commands are used on systems with systemd to enable the Defguard gateway service to start on boot and then start it immediately. ```bash # on systems with systemd (like Debian, Ubuntu, Fedora/Red Hat Linux/SUSE) systemctl enable defguard-gateway.service systemctl start defguard-gateway.service ``` -------------------------------- ### Defguard Core Configuration Example Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Example configuration for the Defguard core service, including gRPC URL. ```shell DEFGUARD_GRPC_URL=https://my-server.defguard.net:444 ``` -------------------------------- ### Install Defguard Client with Auto-Provisioning Source: https://docs.defguard.net/features/desktop-client-auto-provisioning/auto-provisioning-in-windows-environments Use this command to install the Defguard client with automatic provisioning enabled. The PROVISIONING=1 argument triggers the helper script. ```powershell msiexec /i defguard-client.msi PROVISIONING=1 ``` -------------------------------- ### Install Defguard Gateway Package Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation/defguard-apt-repository Install the Defguard Gateway package using APT after the repository has been added. ```bash sudo apt install defguard-gateway ``` -------------------------------- ### Install Defguard Gateway OPNsense Plugin Source: https://docs.defguard.net/deployment-strategies/running-gateway-on-opnsense-firewall Use this command to install the Defguard Gateway OPNsense package. Ensure you have downloaded the correct package file. ```bash pkg add defguard-gateway_VERSION_x86_64-unknown-opnsense.pkg ``` -------------------------------- ### Enable and Start Defguard Core Service Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Commands to enable and start the Defguard core service using systemd on Linux or rc.d on FreeBSD/NetBSD. ```bash # on systems with systemd (like Debian, Ubuntu, Fedora/Red Hat Linux/SUSE) systemctl enable defguard.service systemctl start defguard.service # on systems with rc.d (like FreeBSD, NetBSD) sudo /usr/local/etc/rc.d/defguard start ``` -------------------------------- ### Install Defguard Proxy Package Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation/defguard-apt-repository Install the Defguard Proxy package using APT after the repository has been added. ```bash sudo apt install defguard-proxy ``` -------------------------------- ### Install Defguard Core Package Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation/defguard-apt-repository Install the Defguard Core package using APT after the repository has been added. ```bash sudo apt install defguard ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.defguard.net/features/desktop-client-auto-provisioning Use this GET request to ask questions about the documentation. Replace `` with your specific query. ```http GET https://docs.defguard.net/features/desktop-client-auto-provisioning.md?ask= ``` -------------------------------- ### Install Django and Authentication Packages with Poetry Source: https://docs.defguard.net/features/openid-connect/django Install the necessary Python packages for the Django project: django, django-jazzmin, Authlib, and requests, using Poetry. ```bash poetry add django django-jazzmin Authlib requests ``` -------------------------------- ### Provisioning Configuration File Example Source: https://docs.defguard.net/features/desktop-client-auto-provisioning This JSON file configures the Defguard desktop client for automated provisioning. It requires an enrollment token and the Defguard instance URL. ```json { "enrollment_token": "6B8fg2wiyczb1uDCDwUyMsnYz6qQBVu0", "enrollment_url": "https://proxy.example.com/" } ``` -------------------------------- ### Show YubiKey Provisioning CLI Help Source: https://docs.defguard.net/features/yubikey-provisioning Display all available command-line options for the yubikey-provision tool. This is useful for understanding configuration possibilities. ```bash yubikey-provision -h ``` -------------------------------- ### Initialize OpenTofu Modules and Providers Source: https://docs.defguard.net/deployment-strategies/terraform Initialize OpenTofu to download and set up all necessary modules and providers for the deployment. ```bash tofu init ``` -------------------------------- ### Run Django Development Server Source: https://docs.defguard.net/features/openid-connect/django Execute this command to start the Django development server. Ensure you are in the correct project directory and have Poetry installed. ```bash poetry run ./manage.py runserver 0.0.0.0:9000 ``` -------------------------------- ### Terraform Deployment Output Example Source: https://docs.defguard.net/deployment-strategies/terraform Example output after a successful Terraform apply, showing the public and private addresses for Defguard Core, Proxy, and gateway components. ```bash Apply complete! Resources: 35 added, 0 changed, 0 destroyed. Outputs: defguard_core_private_address = "10.0.1.x" defguard_core_public_address = "x.x.x.x" defguard_proxy_private_address = "10.0.1.x" defguard_proxy_public_address = "x.x.x.x" defguard_gateway_private_addresses = [ "10.0.1.226", ] defguard_gateway_public_addresses = [ "x.x.x.x", ] ``` -------------------------------- ### Print CLI Help Source: https://docs.defguard.net/using-defguard-for-end-users/cli-client Verify successful installation of the DefGuard CLI client by printing its help message. This confirms the 'dg' command is accessible. ```bash dg --help ``` -------------------------------- ### Remove Direct Access Rules for Reverse Proxy Setup (Proxy) Source: https://docs.defguard.net/deployment-strategies/terraform This example shows the ingress rule to be removed from the Proxy security group when setting up a reverse proxy to prevent direct access. ```hcl # This is in the Proxy security group block [...] ingress { from_port = local.proxy_http_port to_port = local.proxy_http_port protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } ``` -------------------------------- ### Full Core Configuration Example Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation An example of a complete Defguard Core service configuration file, including secrets, URLs, session lifetimes, and administrative settings. ```ini ### Core configuration ### # # Generate secrets # DEFGUARD_AUTH_SECRET=defguard-auth-secret DEFGUARD_GATEWAY_SECRET=defguard-gateway-secret DEFGUARD_YUBIBRIDGE_SECRET=defguard-yubibridge-secret DEFGUARD_SECRET_KEY=9oZqdHRCN0TWIyMhjYOAYwgzVz9IfOqz62PzUvjvyMzqLICGSM3b0pRMdDH300CQ # Define the URL under which Defguard is running: DEFGUARD_URL=https://my-server.defguard.net # How long auth session lives in seconds DEFGUARD_AUTH_SESSION_LIFETIME=604800 # Optional. Generated based on DEFGUARD_URL if not provided. # DEFGUARD_WEBAUTHN_RP_ID=localhost DEFGUARD_ADMIN_GROUPNAME=admin DEFGUARD_DEFAULT_ADMIN_PASSWORD=pass123 ``` -------------------------------- ### Start Defguard Gateway Binary Source: https://docs.defguard.net/deployment-strategies/running-gateway-on-opnsense-firewall Execute the Defguard Gateway using its binary. You must provide the Core gRPC URL and port, along with your Defguard token. ```bash gateway -g -t ``` -------------------------------- ### Remove Direct Access Rules for Reverse Proxy Setup Source: https://docs.defguard.net/deployment-strategies/terraform When setting up a reverse proxy, remove direct ingress rules for Core and Proxy services to prevent direct access. This example shows the rule to be removed from the Core security group. ```hcl # This is in the Core security group block [...] ingress { from_port = local.core_http_port to_port = local.core_http_port protocol = "tcp" cidr_blocks = [ for eip in aws_eip.defguard_gateway_endpoint : "${eip.public_ip}/32" ] } ``` -------------------------------- ### Install UFW Firewall Source: https://docs.defguard.net/tutorials/step-by-step-setting-up-a-vpn-server Installs the Uncomplicated Firewall (UFW) on Debian systems. UFW is automatically installed on Ubuntu. ```bash root@server# apt install ufw ``` -------------------------------- ### Defguard Database Configuration Examples Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Configuration settings for connecting to the Defguard database. ```shell DEFGUARD_DB_HOST="localhost" DEFGUARD_DB_PORT=5432 DEFGUARD_DB_NAME="defguard" DEFGUARD_DB_USER="defguard" DEFGUARD_DB_PASSWORD="defguard" # for SQLX CLI DATABASE_URL="postgresql://defguard:defguard@localhost/defguard" ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.defguard.net/features/openid-connect/proxmox-1 To get additional information not explicitly present on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.defguard.net/features/openid-connect/proxmox-1.md?ask= ``` -------------------------------- ### Defguard Core Configuration Example Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation An example configuration file for the Defguard core service, including authentication secrets, URL settings, and database connection details. ```ini ### Core configuration ### # # Generate secrets # DEFGUARD_AUTH_SECRET=defguard-auth-secret DEFGUARD_GATEWAY_SECRET=defguard-gateway-secret DEFGUARD_YUBIBRIDGE_SECRET=defguard-yubibridge-secret DEFGUARD_SECRET_KEY=9oZqdHRCN0TWIyMhjYOAYwgzVz9IfOqz62PzUvjvyMzqLICGSM3b0pRMdDH300CQ # Define the URL under which Defguard is running: DEFGUARD_URL=https://my-server.defguard.net # How long auth session lives in seconds DEFGUARD_AUTH_SESSION_LIFETIME=604800 # Optional. Generated based on DEFGUARD_URL if not provided. # DEFGUARD_WEBAUTHN_RP_ID=localhost DEFGUARD_ADMIN_GROUPNAME=admin DEFGUARD_DEFAULT_ADMIN_PASSWORD=pass123 # This will be displayed in the network settings when editing/adding a new location: DEFGUARD_GRPC_URL=https://my-server.defguard.net:444 ### Proxy configuration ### # Proxy is optional - if you would like to use the remote enrollment # and onboarding service, as well as easy desktop client configuration # proxy must be enabled. # For now we leave it uncofigured, will configure it in next step. # DEFGUARD_PROXY_URL=http://localhost:50051 ### LDAP configuration ### # DEFGUARD_LDAP_URL=ldap://localhost:389 # DEFGUARD_LDAP_SERVICE_PASSWORD=adminpassword # DEFGUARD_LDAP_USER_SEARCH_BASE="ou=users,dc=example,dc=org" # DEFGUARD_LDAP_GROUP_SEARCH_BASE="ou=groups,dc=example,dc=org" # DEFGUARD_LDAP_DEVICE_SEARCH_BASE="ou=devices,dc=example,dc=org" ### DB configuration ### DEFGUARD_DB_HOST="localhost" DEFGUARD_DB_PORT=5432 DEFGUARD_DB_NAME="defguard" DEFGUARD_DB_USER="defguard" DEFGUARD_DB_PASSWORD="defguard" # for SQLX CLI DATABASE_URL="postgresql://defguard:defguard@localhost/defguard" ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.defguard.net/deployment-strategies/docker-compose To get additional information not directly present on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.defguard.net/deployment-strategies/docker-compose.md?ask= ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.defguard.net/deployment-strategies/using-a-userspace-wireguard-go-implementation To get additional information not directly on the page, perform an HTTP GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://docs.defguard.net/deployment-strategies/using-a-userspace-wireguard-go-implementation.md?ask= ``` -------------------------------- ### Initialize Terraform Modules and Providers Source: https://docs.defguard.net/deployment-strategies/terraform Initialize Terraform to download and set up all necessary modules and providers for the deployment. ```bash terraform init ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.defguard.net/in-depth/architecture-decision-records/pre-1.3 To get more information not present on the current page, perform an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.defguard.net/in-depth/architecture-decision-records/pre-1.3.md?ask= ``` -------------------------------- ### Build Defguard Frontend Locally Source: https://docs.defguard.net/for-developers/dev-env-setup Install frontend dependencies and build the frontend application locally. ```bash pushd web pnpm install pnpm build popd ``` -------------------------------- ### Check DefGuard Gateway Installation Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Verify the DefGuard Gateway installation by checking its version. ```bash # defguard-gateway -V defguard-gateway 0.7.0 ``` -------------------------------- ### Initialize Development Environment with Docker Compose Source: https://docs.defguard.net/for-developers/dev-env-setup Migrate the database and insert test network and device data using Docker Compose for development. ```bash docker compose run core init-dev-env ``` -------------------------------- ### Check DefGuard Core Installation Source: https://docs.defguard.net/deployment-strategies/standalone-package-based-installation Verify the DefGuard Core installation by checking its version. ```bash # defguard -V defguard_common 1.6.0 ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://docs.defguard.net/using-defguard-for-end-users/desktop-client/mtu-setting To get additional information not present on the current page, perform an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.defguard.net/using-defguard-for-end-users/desktop-client/mtu-setting.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.defguard.net/deployment-strategies/amis-and-aws-cloudformation To get information not explicitly present on the page, make an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.defguard.net/deployment-strategies/amis-and-aws-cloudformation.md?ask= ``` -------------------------------- ### Install pnpm Package Manager Globally Source: https://docs.defguard.net/for-developers/dev-env-setup Install the pnpm package manager globally using npm. ```bash sudo npm i -g pnpm ```