Awx: Add SSL Termination to standalone docker deployment

Created on 13 Mar 2018  路  11Comments  路  Source: ansible/awx

ISSUE TYPE

  • Feature Idea
COMPONENT NAME

  • Installer
SUMMARY

Add support for SSL

ENVIRONMENT
  • AWX version: Master
  • AWX install method: docker for linux
  • Ansible version: Master
  • Operating System: Linux
  • Web Browser: Any
STEPS TO REPRODUCE

Use HAProxy for SSL Termination
Add HAProxy container to docker-compose.j2
https://github.com/jalphonso/awx/blob/7f3ba7ad2de68fa6efdcc9511b56a2e109133887/installer/local_docker/templates/docker-compose.yml.j2#L5-L14

HAProxy cfg file example:
https://github.com/jalphonso/awx_haproxy/blob/master/haproxy.cfg

EXPECTED RESULTS

Can access AWX via SSL

ACTUAL RESULTS

Currently only works on HTTP

ADDITIONAL INFORMATION

https://github.com/jalphonso/awx_haproxy
Dockerfile to build instance can be found at the above link.
AWX installer could either expect user to provide path to their own PEM or assist with generating a new PEM and then build the haproxy container.

installer good first issue help wanted low enhancement

Most helpful comment

I would like to mark this as "really really critical showstopper".
The host that my awx containers are served from on port 8052 is also serving "normal" web content on 80/443 and uses HSTS.
Basically, I can't use AWX. At All. Because after accessing the "normal" content on that host once, any modern browser will refuse to touch anything from that host via normal http.

All 11 comments

Leaving it here in case someone could use an example.
I know it's not HAProxy related, but using NGINX as a proxy with Letsencrypt provided SSL, here's my config:

upstream awx {
    # Depends on what port your docker-compose is listening to
    server localhost:8080; 
}

server {
    server_name  awx.domain.com;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Host $http_host;
        proxy_set_header X-Request-Start "t=${msec}";
        proxy_redirect off;
        proxy_pass http://awx;
        add_header Access-Control-Allow-Origin *;
    }

    location /websocket/ {
        proxy_pass http://awx;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }
}

Then I use ACME certbot to install SSL and listen directives.

Hi. I'm trying to understand the landscape here...
It sounds like current practice and proposed directions to support HTTPS are all adding an additional proxy in front 鈥斅爃aproxy / traefik / an additional nginx?
But IIUC, awx_web image is already running an nginx inside, right? Isn't it possible to modify its config to serve HTTPS, taking certificate from env vars / a mounted volume?

  • My specific use case is running on openshift. From outside the openshift router already gives HTTPS, but I also want to secure communication between router and awx_web container (get rid of insecureEdgeTerminationPolicy). Openshift service signer can generate the cert conveniently, would just need to mount it into the awx_web container and have it use it...

Any progress on getting this PR merged? I find it horrible that a Password Authenticated GUI is not by default SSL.

@edperry I have already submitted a PR for this already though it might need to be rebased.
See https://github.com/ansible/awx/pull/2135#issuecomment-424318303.

I would like to mark this as "really really critical showstopper".
The host that my awx containers are served from on port 8052 is also serving "normal" web content on 80/443 and uses HSTS.
Basically, I can't use AWX. At All. Because after accessing the "normal" content on that host once, any modern browser will refuse to touch anything from that host via normal http.

it would be great if this item gets added as this is a show stopper for those of us testing.

Seems like this can be closed with #3322 having made it in to v4.0.0, though that release does drop the standalone Docker install method.

...wtf? what do you mean, 4.0.0 drops the standalone docker? Guess it'll be back to puppet for me if that's true.

edit: it only means that you have to have docker-compose. phew. now if i could only figure out how to actually make https: happen instead of http...

@lemmy04 right, it doesn鈥檛 drop Docker entirely, just the standalone version, in favor of focusing entirely on using Docker Compose. You can check the v4 release notes here on the Google Group.

Sorry for the panic!

so ... how do I make https: happen? The documentation doesn't really say anything.

@lemmy04 this is highly unlikely to be merged in, and the standalone Docker is a feature that鈥檚 been removed in favor of using Docker Compose.

You might check my PR, #3604, which adds SSL support for docker-compose. It鈥檚 yet to merge in, and I鈥檝e been trying to get it working again with current versions of AWX (there鈥檚 been changes since I opened the PR).

Was this page helpful?
0 / 5 - 0 ratings