Back to articles
Security & Anti-DDoS

Optimizing Docker Infrastructure Security with Pomerium as Zero Trust Ingress Proxy

A detailed guide to deploying Pomerium as a zero trust ingress proxy on Docker to protect application infrastructure with strict authentication and access control.

DPTCloud Engineering4 min read
Optimizing Docker Infrastructure Security with Pomerium as Zero Trust Ingress Proxy

Optimizing Docker Infrastructure Security with Pomerium as Zero Trust Ingress Proxy

In an era of increasingly sophisticated cyberattacks, protecting application infrastructure can no longer rely solely on traditional firewalls and network routing. Pomerium – an open-source zero trust ingress proxy – offers a modern approach to access control by enforcing strict authentication, user- and device-based authorization, rather than relying on IP addresses or internal network trust. This guide walks through deploying Pomerium on Docker to secure internal applications using a zero trust model, ensuring only authenticated users can access your systems.

Introduction to Pomerium and Zero Trust Model

Pomerium functions as a secure gateway for internal applications, operating on the principle of zero trust: no entity is trusted by default, even if located within the internal network. Every access request must be verified before being granted.

Key features of Pomerium include:

  • User authentication via OAuth2, SAML, or OIDC
  • Policy-based access control
  • Integration with identity providers such as Google Workspace, Okta, or Auth0
  • Automatic HTTPS forwarding with Let's Encrypt
  • Detailed access monitoring and logging

Deploying Pomerium on Docker

To deploy Pomerium on Docker, you need a VPS with Docker installed and public internet connectivity. Below are the essential steps for installation and configuration.

Prerequisites

  • Docker and Docker Compose installed
  • A public domain (e.g., app.yourdomain.com)
  • An identity provider (Google, Okta, etc.)
  • Domain DNS pointing to the VPS IP address

Configuring Pomerium with Docker Compose

Create a docker-compose.yml file with the following content:

version: '3.8'

services:
  pomerium:
    image: pomerium/pomerium:latest
    container_name: pomerium
    ports:
      - "443:443"
      - "8443:8443"
    environment:
      - POMERIUM_DEBUG=true
      - POMERIUM_LOG_LEVEL=info
      - POMERIUM_DOMAIN=yourdomain.com
      - POMERIUM_IDP_PROVIDER=google
      - POMERIUM_IDP_CLIENT_ID=your-client-id.apps.googleusercontent.com
      - POMERIUM_IDP_CLIENT_SECRET=your-client-secret
      - [email protected]
      - POMERIUM_POLICY=/policy.yaml
      - POMERIUM_CERTIFICATE_TYPE=letsencrypt
      - POMERIUM_CERTIFICATE_LETSENCRYPT=true
    volumes:
      - ./policy.yaml:/pomerium/policy.yaml
    restart: unless-stopped

Note: Replace placeholders like yourdomain.com, your-client-id, and your-client-secret with your actual values.

Access Policy (policy.yaml)

Create a policy.yaml file in the same directory as docker-compose.yml:

policy:
  - from: https://app.yourdomain.com
    to: http://internal-app:8080
    allowed_users:
      - [email protected]
      - [email protected]
    allowed_groups:
      - [email protected]

Verification and Testing

After starting the service, access https://app.yourdomain.com in your browser. You will be redirected to the identity provider’s login page (e.g., Google). After successful authentication, you will be granted access to the internal application.

Troubleshooting

  • Cannot access? Check Docker logs: docker logs pomerium
  • Authentication fails? Verify client_id, client_secret, and email_allowlist values.
  • HTTPS not working? Ensure the domain is correctly pointed and port 443 is open on the VPS.

Further Security Optimization

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478