Skip to content

About

DockerUpdateGuard is a web application for tracking what is actually running in Docker, comparing it with registry metadata, and showing where updates, vulnerabilities, and shared base-image dependencies need attention.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

DockerUpdateGuard

DockerUpdateGuard is a web application for tracking what is actually running in Docker, comparing it with registry metadata, and showing where updates, vulnerabilities, and shared base-image dependencies need attention.

It is designed for teams that want more than "a newer tag exists". The app keeps an inventory of observed images and runtime containers, correlates them with registry tags and digests, samples CPU, memory, and network usage, and keeps a scan history so update decisions can be reviewed instead of guessed.

What the application helps with

  • Discover configured Docker instances and the containers currently running on them
  • Detect whether a running container is up to date, behind a newer version, or needs manual review
  • Resolve alias tags such as latest to matching semantic version tags when they share the same digest
  • Recommend updates inside the current major version line first and hold a new major version back until it is established
  • Track resource usage over time for Docker instances and runtime containers
  • Correlate runtime containers with observed images and shared base images
  • Refresh vulnerability data for images
  • Keep historical scan results for auditing and troubleshooting

Main UI areas

  • Dashboard: what needs attention: containers with updates, advisories in running containers, own base runtime warnings and the last scans
  • Observed Images: repositories and tags discovered from Docker Hub account data
  • Runtime Containers: live workload inventory with update and vulnerability state
  • Docker Instances: configured engines plus usage history
  • Shared Base Images: base-image reuse across observed images
  • Scan History: recent background activity and outcomes

Runtime requirements

DockerUpdateGuard expects:

  • A PostgreSQL database
  • Access to one or more Docker Engine endpoints
  • Optional Docker Hub credentials for authenticated registry access
  • Optional Portainer access per Docker instance
  • Optional OTLP endpoint for telemetry export
  • Optional Trivy server when Trivy-based vulnerability scanning is enabled; scans run through the Trivy CLI in client mode, so the trivy binary must be available (bundled in the published container image)

The application applies EF Core migrations automatically on startup.

Running the application

Local development

Use the solution file from the repository root:

dotnet restore DockerUpdateGuard.slnx
reihitsu-format ./
dotnet build DockerUpdateGuard.slnx -c Release --no-restore
dotnet test src\Tests\**\*.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"

Docker image

For a full Docker Compose walkthrough (minimal setup, optional Trivy scanning, optional telemetry), see INSTALL.md.

The container image listens on port 8080 by default.

Example for Linux with a local Docker socket:

docker run -d \
  --name dockerupdateguard \
  -p 8080:8080 \
  --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
  -v /path/to/appsettings.json:/app/appsettings.json:ro \
  networlddev/dockerupdateguard:latest

When DockerUpdateGuard runs inside a Linux container and should inspect the host Docker Engine through the Unix socket, two things must be in place:

  1. /var/run/docker.sock must be mounted into the container
  2. The corresponding Docker instance BaseUrl must be set to unix:///var/run/docker.sock in appsettings.json

Without both settings, the application cannot reach the host engine.

Configuration model

DockerUpdateGuard uses normal ASP.NET Core configuration binding and prefers configuration files for container deployments:

  • appsettings.json
  • appsettings.{Environment}.json
  • environment variables (__ as the section separator, e.g. DockerUpdateGuard__Scanning__RetryCount)
  • command-line arguments
  • secret stores supported by ASP.NET Core

For example:

  • JSON key: DockerUpdateGuard:Scanning:RuntimeImageUpdateScanIntervalMinutes

Configuration reference

The tables list each key with its default. What a key does, its allowed range, whether a change applies without a restart and how it is validated are stated in the area document each section links; an invalid value fails startup (Hosting and configuration). Percent-encode @, #, ? and / in a user name or password inside a configured URL.

Connection and host settings

Rules: Hosting and configuration.

Key Default Required Description
AllowedHosts * No Host names and IP addresses the UI answers, ;-separated, without port (IPv6 in brackets); any other host name gets 400 "Bad Request - Invalid Hostname". Recommended: protects the UI against DNS rebinding (Security posture)
ConnectionStrings:DockerUpdateGuard none Yes* Named PostgreSQL connection string used when DockerUpdateGuard:ConnectionString is not set
DockerUpdateGuard:ConnectionString none Yes* Inline PostgreSQL connection string
DockerUpdateGuard:ConnectionStringName DockerUpdateGuard No Name of the ConnectionStrings entry to resolve
DockerUpdateGuard:DisplayVersion assembly version No Version string shown at the end of every page and in the narrow-screen drawer; the Docker image sets this automatically
DockerUpdateGuard:Database:MaxConnectionRetryCount 8 No Retries of a transiently failing database command during normal operation
DockerUpdateGuard:Database:MaxConnectionRetryDelaySeconds 30 No Maximum back-off in seconds between those retries
DockerUpdateGuard:Database:MigrationStartupTimeoutSeconds 120 No How long startup waits for the database to become reachable
DockerUpdateGuard:Database:MigrationRetryDelaySeconds 5 No Delay in seconds between connection attempts while startup waits for the database, and between attempts to take the migration lock
DockerUpdateGuard:Database:MigrationLockTimeoutSeconds 900 No Total time in seconds startup waits for another instance to release the migration lock; raise it when a migration takes longer
DockerUpdateGuard:Database:MigrationCommandTimeoutSeconds 900 No Command timeout in seconds of each statement of the startup migration; replaces any Command Timeout of the connection string for those statements, so raise it for long migrations

* At least one of DockerUpdateGuard:ConnectionString or ConnectionStrings:{ConnectionStringName} must be configured.

DockerUpdateGuard:DockerHub

Rules: Registries.

Key Default Required Description
Registry docker.io Yes Docker Hub registry host used for account discovery: a plain host name such as docker.io, never a URL (see the upgrade note below)
ApiBaseUrl https://hub.docker.com/ No Docker Hub web API base address, the only way to change it; a mirror or proxy must keep next-page links on its own origin (Pagination links)
UserName none No Docker Hub user name (Docker ID) for authenticated requests
Pat none No Docker Hub personal access token
RequestTimeoutSeconds 30 No Timeout of one Docker Hub, OCI registry or release-feed request, retries included; for Docker Hub and OCI registries it also covers reading the response
MaxParallelRequests 4 No Maximum number of Docker Hub requests in flight at once for the whole process, the Docker Scout login included (1–32); applied on configuration reload

Upgrading to 1.3.10 or later: Registry only accepts docker.io, index.docker.io, registry-1.docker.io, hub.docker.com, docker.com or www.docker.com. A URL such as https://hub.docker.com (valid before 1.3.10) stops the application at startup. Set Registry to docker.io and, if you used an absolute URL there to change the web API address, set ApiBaseUrl instead.

DockerUpdateGuard:ReleaseMetadata

Base addresses of the upstream feeds used to resolve .NET and nginx release versions. Override them to route the lookups through an internal mirror or proxy. Rules: Base images.

Key Default Required Description
DotNetBaseUrl https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/ No Base address of the .NET release metadata feed
NginxBaseUrl https://nginx.org/ No Base address of the nginx release feed

DockerUpdateGuard:Vulnerabilities

Rules: Vulnerabilities.

Key Default Required Description
Enabled false No Enables vulnerability refresh
Provider None Required when enabled Supported values: None, DockerScout, Trivy
TrivyBaseUrl none Required for Trivy Base URL of the Trivy server used by the Trivy CLI in client mode
TrivyExecutablePath trivy No Path to the Trivy executable (resolved through PATH by default; bundled in the published container image)
DockerScoutLoginUrl https://hub.docker.com/v2/users/login No Docker Hub login endpoint used by the DockerScout provider
DockerScoutBaseUrl https://api.scout.docker.com No Base address of the Docker Scout API
RequestTimeoutSeconds 120 No Timeout for vulnerability provider requests; for Docker Scout, per login or page request with its retries
MaxParallelScans 1 No Maximum number of vulnerability provider scans running at the same time

DockerUpdateGuard:Scanning

Rules: Scan engine; RetryCount in Integration failures, the major-upgrade keys in Update detection, the request budget in Registries.

Key Default Description
DiscoveryIntervalMinutes 15 Synchronization interval for configured Docker instances
DockerHubAccountDiscoveryIntervalMinutes 60 Interval for refreshing the Docker Hub account image inventory
OwnImageBaseScanIntervalMinutes 60 Interval for resolving base-image chains of observed images
DockerHubRequestLimitWindowHours 6 Quota window size for scheduled Docker Hub refreshes
DockerHubRequestLimitPerWindow 200 Scheduled Docker Hub request budget per quota window
DockerHubReservedManualRequestsPerWindow 40 Reserved request budget for manual scans and ad-hoc activity
RuntimeImageUpdateScanIntervalMinutes 30 Interval for refreshing runtime container state and update status
ResourceStatisticsIntervalMinutes 5 Interval for sampling CPU, memory, and network usage
VulnerabilityRefreshIntervalMinutes 180 Interval for refreshing vulnerability information
CleanupIntervalMinutes 720 Interval for cleaning old scan data
RetryCount 2 Retries of one outbound HTTP request after a transient failure; 0 disables them
RetainScanRunsDays 30 Retention period for completed scan history; the 20 most recent completed runs are always kept
MajorUpgradeMinimumAgeDays 30 Waiting period before a new major version line is recommended
MajorUpgradeMinimumReleaseCount 2 Number of releases a new major version line must have before it is recommended

DockerUpdateGuard:DockerInstances[]

Each entry describes one Docker Engine endpoint. Rules: Docker instances.

Key Default Required Description
Name none Yes Display name of the Docker instance
BaseUrl none Yes Docker endpoint URI (http, https, tcp, unix or npipe)
Enabled true No Enables or disables this Docker instance
UseTls false No For tcp:// endpoints, upgrade the connection to HTTPS
SkipCertificateValidation false No Skip server certificate validation for TLS endpoints. Insecure: exposes the connection to man-in-the-middle attacks; use only for trusted endpoints with self-signed certificates (TLS options).
CertificatePath none No Client certificate for TLS-secured engine access, a password-less PKCS#12 bundle (.pfx or .p12) (TLS options). Convert PEM files with openssl pkcs12 -export -in cert.pem -inkey key.pem -out client.pfx -passout pass:.
RequestTimeoutSeconds 15 No Timeout for Docker Engine requests

Shipped Linux socket configuration (the instance at index 0 of the shipped appsettings.json):

Key Shipped value
DockerUpdateGuard:DockerInstances:0:Name Local Docker
DockerUpdateGuard:DockerInstances:0:BaseUrl unix:///var/run/docker.sock
DockerUpdateGuard:DockerInstances:0:Enabled true

DockerUpdateGuard:DockerInstances[].Portainer

Portainer settings are optional and are only needed when Portainer-backed actions should be available. Rules: Container actions.

Enabling Portainer for a Docker instance lets the runtime container detail page start, stop and restart that instance's containers through Portainer. The application has no sign-in, so anyone who can reach the UI can do this; each action asks for confirmation and is recorded as an action run (requester UI, no identity), so run the application behind a trusted perimeter and set AllowedHosts (Security posture). Portainer answers a stop or restart only once the container has stopped, so these requests wait up to 300 seconds beyond RequestTimeoutSeconds. Redeploying stacks and updating services are not available.

Key Default Required Description
Enabled false No Enables Portainer integration for the Docker instance
BaseUrl none Required when enabled Absolute Portainer URL, the address its UI is reached at (a reverse-proxy path prefix included, without /api); https unless AllowInsecureHttp is set
AllowInsecureHttp false No Allow plaintext http for BaseUrl; credentials travel unencrypted, so use it only on localhost or trusted private networks (Transport security)
Username none Conditional Username for Portainer login
Password none Conditional Password for Portainer login
ApiToken none Conditional Portainer API token; takes precedence over username/password
EndpointId none No Portainer environment ID, digits only; must be set when Portainer manages more than one environment, and an ID that Portainer does not know disables the actions
RequestTimeoutSeconds 15 No Timeout for each Portainer request; the stop and restart of a container wait 300 seconds longer (Actions)

When Portainer is enabled, either:

  • ApiToken, or
  • Username and Password

must be configured.

Telemetry

Rules: Telemetry.

Key Default Required Description
ServiceName DockerUpdateGuard Required when telemetry is enabled Service name used in telemetry resources
OtlpEndpoint none No Absolute http or https OTLP endpoint
Instance none No Logical deployment instance name
EnableLogging true No Enables OpenTelemetry logging (exported only when OtlpEndpoint is set; console logging is always active)
EnableMetrics true No Enables OpenTelemetry metrics (exported only when OtlpEndpoint is set)
EnableTracing true No Enables OpenTelemetry tracing (exported only when OtlpEndpoint is set)

If all three telemetry switches are false, telemetry is effectively disabled.

Example configuration

JSON

{
  "AllowedHosts": "dockerupdateguard.example.lan;192.168.10.20",
  "ConnectionStrings": {
    "DockerUpdateGuard": "Host=postgres;Port=5432;Database=dockerupdateguard;Username=dockerupdateguard;Password=change-me"
  },
  "DockerUpdateGuard": {
    "ConnectionStringName": "DockerUpdateGuard",
    "DockerHub": {
      "Registry": "docker.io",
      "UserName": "dockerupdateguard",
      "Pat": "change-me",
      "RequestTimeoutSeconds": 30,
      "MaxParallelRequests": 4
    },
    "Vulnerabilities": {
      "Enabled": true,
      "Provider": "Trivy",
      "TrivyBaseUrl": "http://trivy:4954",
      "RequestTimeoutSeconds": 120,
      "MaxParallelScans": 1
    },
    "Scanning": {
      "DiscoveryIntervalMinutes": 5,
      "DockerHubAccountDiscoveryIntervalMinutes": 15,
      "OwnImageBaseScanIntervalMinutes": 30,
      "DockerHubRequestLimitWindowHours": 6,
      "DockerHubRequestLimitPerWindow": 200,
      "DockerHubReservedManualRequestsPerWindow": 40,
      "RuntimeImageUpdateScanIntervalMinutes": 10,
      "ResourceStatisticsIntervalMinutes": 5,
      "VulnerabilityRefreshIntervalMinutes": 60,
      "CleanupIntervalMinutes": 720,
      "RetryCount": 1,
      "RetainScanRunsDays": 14
    },
    "DockerInstances": [
      {
        "Name": "Local Docker",
        "BaseUrl": "unix:///var/run/docker.sock",
        "Enabled": true,
        "UseTls": false,
        "SkipCertificateValidation": false,
        "RequestTimeoutSeconds": 15,
        "Portainer": {
          "Enabled": false,
          "BaseUrl": "https://portainer.local",
          "EndpointId": "1",
          "RequestTimeoutSeconds": 15
        }
      }
    ]
  },
  "Telemetry": {
    "ServiceName": "DockerUpdateGuard",
    "Instance": "Production",
    "OtlpEndpoint": "http://otel-collector:4317",
    "EnableLogging": true,
    "EnableMetrics": true,
    "EnableTracing": true
  }
}

Container deployment configuration

Prefer mounting an appsettings.json into the container rather than using environment variables. Example:

  • Mount your configuration file into the container's content root, for example: -v /path/to/appsettings.json:/app/appsettings.json:ro

See the JSON example above for the exact keys and structure.

Notes for Docker-based deployments

  • The container listens on port 8080 by default
  • The image sets DockerUpdateGuard:DisplayVersion from the image build argument
  • For Linux host monitoring, bind-mount /var/run/docker.sock
  • For TLS-secured remote engines, also mount the client certificate if CertificatePath is used; the container runs as a non-root user (Container image)
  • To trust an internal CA, mount its PEM file into /app/certs (read-only; see DOCKER.md)
  • Set AllowedHosts to every host name and IP address the UI is opened with; the compose files take it from AllowedHosts in .env, and unset every name is accepted (Security posture)
  • The application needs outbound network access to the configured registry, optional Portainer endpoint, optional Trivy server, and optional OTLP collector

License

This repository is distributed under the MIT License. See LICENSE.md for the full license text.

About

DockerUpdateGuard is a web application for tracking what is actually running in Docker, comparing it with registry metadata, and showing where updates, vulnerabilities, and shared base-image dependencies need attention.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages