Skip to content

Exposed ports in the default config #71

@EliRibble

Description

@EliRibble

Thanks for this module - it's vastly superior on NixOS to running OCI containers.

One thing I noticed after starting the service is that a large number of ports were opened on all addresses:

  • 9443
  • 9300
  • 9000

Turns out that's from the default configuration at /var/lib/private/authentik/authentik/lib/default.yml which specifies:

...
listen:
  listen_http: 0.0.0.0:9000
  listen_https: 0.0.0.0:9443
  listen_ldap: 0.0.0.0:3389
  listen_ldaps: 0.0.0.0:6636
  listen_radius: 0.0.0.0:1812
  listen_metrics: 0.0.0.0:9300
  listen_debug: 0.0.0.0:9900
  listen_debug_py: 0.0.0.0:9901

When running inside containers, which seems to be the normal way to install Authentik this is not nearly as dangerous as it is running directly on the host operating system as one does in NixOS.

Eventually I figured out how to add a much safer configuration to my NixOS config:

services.authentik.settings.listen = {
                                        listen_debug = "127.0.0.1:9900";
                                        listen_debug_py = "127.0.0.1:9901";
                                        listen_http = "127.0.0.1:9000";
                                        listen_https = "127.0.0.1:9443";
                                        listen_ldap = "127.0.0.1:3389";
                                        listen_ldaps = "127.0.0.1:6636";
                                        listen_radius = "127.0.0.1:1812";
                                        listen_metrics = "127.0.0.1:9300";
};

I think it'd be a good idea to make this the default for this flake for security, but if not, to explicitly document it since I did not expect this service to bind to public addresses quite so liberally. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions