Skip to content

[Feature request] Advanced filtering by container name and label #181

Description

@NotaInutilis

Is your feature request related to a problem? Please describe.

I'd like to request integration of advanced filters like the ones that the Docker Proxy Filter container provides:

"Filters List Containers responses so any container that does not match filters is excluded from the return list
Any other Container endpoints will return 404 if it does not match a filter"

Additional documentation: https://blog.foxxmd.dev/posts/restricting-socket-proxy-by-container/

It has 2 limitations though:

  • no per-container allowlist (no label configuration)
  • limited to network proxying only (not unix socket)

Describe the solution you'd like

I'd like socket-proxy to have similar filter those provided by Docker Proxy Filter: CONTAINER_NAMES and CONTAINER_LABELS filters "list containers" answers to the containers matching the listed names/labels and only allows queries to those containers. It could also be extended to other list queries, like networks.

It seems that part of the name filtering is already being worked on #49 but limited to direct queries by name only, with no filtering to "list containers" or by labels.

There is also an interesting modifier SCRUB_ENVS: "When true any responses from the Container Inspect endpoint will have Config.Env set to an empty array. This prevents leaking of sensitive environment:/-e variables that you passed to your container, over the network."

I'd also like to be able to set these options per-container with labels.

Describe alternatives you've considered
Using a lot of proxy and filter containers in internal network mode!

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions