Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPNsense Caddy Plugin - Didn't forward NTLM #4160

Open
phillipunzen opened this issue Aug 6, 2024 · 6 comments
Open

OPNsense Caddy Plugin - Didn't forward NTLM #4160

phillipunzen opened this issue Aug 6, 2024 · 6 comments
Labels
support Community support

Comments

@phillipunzen
Copy link

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
I have pulled the OPNsense including caddy reverse proxy to the current version. Unfortunately, NTLM is not forwarded, which I need for the Outlook desktop clients that access my Exchange server.

Tip: to validate your setup was working with the previous version, use opnsense-revert (https://docs.opnsense.org/manual/opnsense_tools.html#opnsense-revert)

To Reproduce
Steps to reproduce the behavior:

  1. Create Handler
  2. Check NTLM

Expected behavior
I want to connect my Outlook Clients

Screenshots
If applicable, add screenshots to help explain your problem.

opnsense_error_1

@Monviech
Copy link
Member

Monviech commented Aug 6, 2024

Please show me how the Caddyfile looks like. I want to see if the http_ntlm option is there or not.

Which os-caddy was your prior version and which version are you on now?

EDIT:

As a baseline, last time I tested it with Exchange 2019 and Outlook was when I evaluated NTLM again here: #4072

That was after the Binary of Caddy has been updated to 2.8.4. So I tested it in os-caddy-1.5.7.

There hasn't been any difference with the build or with the template in that regard. So essentially there should not be a difference right now.

@phillipunzen
Copy link
Author

Sooo...
This is a part from the Caddyfile:

# Reverse Proxy Domain: "623c2f46-e854-4811-ae7b-b1f103c01e6c"
*.petersen-nf.com {
        @372ffa3f-9de1-4144-acb3-3ec2c6407d9c {
                host outlook.petersen-nf.com
        }
        handle @372ffa3f-9de1-4144-acb3-3ec2c6407d9c {
                handle {
                        reverse_proxy 192.168.10.14:443 {
                                transport http_ntlm {
                                        tls
                                        tls_insecure_skip_verify
                                        tls_server_name outlook.phillipunzen.de
                                }
                        }
                }
        }
        @96d079b9-d85c-4626-acab-75748bed9f09 {
                host autodiscover.petersen-nf.com
        }
        handle @96d079b9-d85c-4626-acab-75748bed9f09 {
                handle {
                        reverse_proxy 192.168.10.14:443 {
                                transport http_ntlm {
                                        tls
                                        tls_insecure_skip_verify
                                        tls_server_name outlook.phillipunzen.de
                                }
                        }
                }
        }
}

import /usr/local/etc/caddy/caddy.d/*.conf

I use the OPNsense in 27.7_9 and os-caddy in 1.6.1.
My OPNsense have no updates at this time...

@Monviech
Copy link
Member

Monviech commented Aug 6, 2024

I have just set up "Windows Authentication" in an ISS, and set it to NTLM, and protected the default ISS website with it.

Then I tested the authentication with NTLM and without NTLM in Caddy.

Without NTLM aktivated, the login mask appeared after each try.

With NTLM aktivated, I got authenticated.

So it should work essentially.


That means there is a configuration error here.

Can you open the Caddyfile /usr/local/etc/caddy/Caddyfile and turn this:

transport http_ntlm {
                                        tls
                                        tls_insecure_skip_verify
                                        tls_server_name outlook....
                                }

Into this:

transport http_ntlm {
                                        tls_insecure_skip_verify
                                }

After editing and saving the Caddyfile, issue a:

service caddy reloadssl

That will reload Caddy without regenerating the template. Afterwards test it again please.

@phillipunzen
Copy link
Author

I edit the caddyfile to your schema. I got the same error...

@phillipunzen
Copy link
Author

Hm, the OPNsense edit the Caddyfile after a reboot to the old version with tls activated. The config change is not saving...

@Monviech
Copy link
Member

Monviech commented Aug 7, 2024

Can you configure the server correctly for TLS.

Import the self signed exchange certificate, select it as TLS trust pool.

  • NTLM enabled

  • TLS enabled

  • TLS Trust Pool: Exchange Server certificate

  • TLS server name: SAN of the Exchange server certificate

  • TLS insecure skip verify DISABLED

Check out the docs: https://docs.opnsense.org/manual/how-tos/caddy.html#reverse-proxy-the-opnsense-webgui

I hope that works, if not, I don't have an exchange server I can test it with anymore. I only confirmed it working with IIS itself.

@Monviech Monviech added the support Community support label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Community support
Development

No branches or pull requests

2 participants