Let's Encrypt used for..

I'm currently using LE for WebAdmin and UserPortal.  Just curious if anyone else is using LE for anything else besides WebAdmin and User Portal?  What other configurations can we use Let's Encrypt?

 

Thanks

  • It is an access problem. If I am using the admin user/password instead when login to https://<sophos>:4444/api/ then I also get access to the key field. I was using a user that was not part of the SuperAdmins-groups. I was reading the UTM-RESTful-API manual and it stated: "Note – This cannot be the admin user. We recommend mapping the token to a user with reduced permissions." So I assumed that one should not be using an accounts in the SuperAdmins-group, but that seems to be the only way forward to get access to the private keys.

  • Update:

    Only way to get access to the key-field (private key) is that the user is added to the SuperAdmin-group. Also I have to delete and create a new API-token after adding the user to the group. Doing these two steps and I finally have access to the key-field. If you know a different way then to use a SuperAdmin-account, please let me know. Thanks again for a great script!

  • Halloj and welcome to the UTM Community!

    Thanks for contributing that important piece of information!

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Has anyone  also have a powershell script for doing the same and maybe can share this to us?

  • Hi All.

    I have been trying to use scorpionkings script but it does not seem to work for me.

    The script seems to fail in getting the cert.

    When I run the script I get:

    [root@serverone ~]# "/storage/Scripts/GetCertFromFirewall.sh"
    unable to load certificate
    140446836869008:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: TRUSTED CERTIFICATE
    unable to load certificate
    140231396804496:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: TRUSTED CERTIFICATE
    jq: error: Could not open file /tmp/utm-le-cert_all: No such file or directory
    jq: error: Could not open file /tmp/utm-le-cert_all: No such file or directory
    unable to load certificate
    140529080334224:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:707:Expecting: TRUSTED CERTIFICATE
    rm: cannot remove ‘/tmp/utm-le-cert_all’: No such file or directory

    I opened the livelog on the firewall and got this:

    2019:08:29-09:17:52 firewall restd[5483]: [80C549CD05C279AE4BDED51B2607D101|] [ConfdHelper] withConfdConnection Setting StatusUnauthorized: No authentication header found
    2019:08:29-09:17:52 firewall restd[5483]: [80C549CD05C279AE4BDED51B2607D101|] Completed GET 401 /api/objects/ca/host_key_cert/REF_VZAwHBxXYPZe in 277.618µs

    Has something changed with the API call as the curl command does not seem to match the method of auth in the restapi manual ?

    The cert downloads correctley when I use a browser to open the URL (although I auth with User/Pass)

    Has anyone any ideas what cuold be the problem ?

    Thanks

  • The plain auth key did not work for me.

    It seems that there is an encryption needed.

     

    The following did work for me:

    - Open API in Browser
    - Open key (via "Try It out" in "GET /objects/ca/host_key_cert/")
    - Copy the key given in the "curl"-field (after "Authorization: Basic ")
    - Use this token in script

  • Hi Sebastian,

    Sorry I meant to have updated this, I found the problem.

    The API Key was not being encoded to base64 before sending to the UTM, The fix was quite easy:-

    utmapikey=$(echo -n token:$token | base64)
    fullutmapiurl=$utmapiurl$certref

    curl -k -X GET --header "Accept: application/json" --header "Authorization: Basic ${utmapikey}" "${fullutmapiurl}" -o "$curloutfile" > /tmp/getcert_utm_curl 2>&1

     

     

    Jeff