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

Allow to configure a predefined sslPolicy #773

Open
jmapro opened this issue Mar 24, 2020 · 16 comments
Open

Allow to configure a predefined sslPolicy #773

jmapro opened this issue Mar 24, 2020 · 16 comments
Assignees

Comments

@jmapro
Copy link

jmapro commented Mar 24, 2020

Is your feature request related to a problem? Please describe.
I need to disallow TLSv1_0 and TLSv1_1 by using the predefined policy AppGwSslPolicy20170401S. But each time I push this configuration on the application gateway, it's overwrited by the Ingress Controller.

Describe the solution you'd like
Ssl policy is global to the application gateway, so having an annotation like appgw.ingress.kubernetes.io/ssl-policy: "AppGwSSlPolicy20170401S" would be great.

@akshaysngupta
Copy link
Member

@jmapro AGIC should not overwrite SSL policy. I tried on my test setup and the policy is retained on updates. Can you check if there is no other component/CI/CD reverting the gateway ?

@jmapro
Copy link
Author

jmapro commented Apr 6, 2020

Hello @akshaysngupta , Thanks for your answer. I've done more tests and my issue seems coming from Terraform and not AGIC.

But having a solution to configure such parameter from Kubernetes would be great :)

@joelharkes
Copy link
Contributor

I'm using only AGIC but also my SSL Policy i setup is gone, (how) is that possible?

don't use anything else than basic AGIC setup + Cert manager.

@joelharkes
Copy link
Contributor

joelharkes commented May 13, 2020

I tried disabling tls1.1 and 1.2:

$gw = Get-AzApplicationGateway -Name ag-name -ResourceGroup rg-name
Get-AzApplicationGatewaySslPolicy -ApplicationGateway $gw
# response from get
Set-AzApplicationGatewaySslPolicy -ApplicationGateway $gw -PolicyType Predefined -PolicyName AppGwSslPolicy20170401S  -MinProtocolVersion TLSv1_2 -DisabledSslProtocols TLSv1_0,TLSv1_1
Get-AzApplicationGatewaySslPolicy -ApplicationGateway $gw

response:

DisabledSslProtocols     : {TLSv1_0, TLSv1_1}
PolicyType               : Predefined
PolicyName               : AppGwSslPolicy20170401S
CipherSuites             : 
MinProtocolVersion       : TLSv1_2
DisabledSslProtocolsText : [
                             "TLSv1_0",
                             "TLSv1_1"
                           ]
CipherSuitesText         : null

and a day later:

$gw = Get-AzApplicationGateway -Name ag-name -ResourceGroup rg-name
Get-AzApplicationGatewaySslPolicy -ApplicationGateway $gw
#setting is gone

ssl Policy seems gone.

DisabledSslProtocols is absolutely a must for security perspective

@martwana
Copy link

I'm also seeing this behaviour. Why is this not supported out the box?

We've just had a bunch of TLSv1.0 warnings in our Pen Test, but because AGIC provisions and manages the load balancer, we cannot control this value.

Can I get an ETA on this feature being available?

@martwana
Copy link

@akshaysngupta

@joelharkes
Copy link
Contributor

Actually my comment was wrong, i do think i was able to fix it with the script i just had an issue in the script

@akshaysngupta
Copy link
Member

AGIC doesn't modify the SSL policy attached to the gateway. As @joelharkes mentioned, please check if you have script that is modify the policy.

@fvillain
Copy link

fvillain commented Oct 11, 2021

Oh yes it does. It overrides everything that was already declared in fact.

Edit: in my use-case, i do this:

  1. create application-gateway with our own ssl policy through terraform azure provider
  2. create the ingress handled by AGIC

Step 2 is overriding everything done in step 1.

@simone
Copy link

simone commented Nov 4, 2021

Guys, I need to do the same, disable TLS 1.0 and 1.1. When I create a new default SSL policy in the Application gateway, after few seconds the policy is deleted automatically. Probably because AGIC ingress rewrite all the rules and in this reconciliation the SSL Policy disappears.

According with Reconciliation feature
https://azure.github.io/application-gateway-kubernetes-ingress/features/agic-reconcile/
To address the problem above, AGIC periodically checks if the latest gateway configuration is different from what it cached, and reconcile if needed to make gateway configuration is eventual correct.

Reconciliation is very useful, but if enabled let you no chance to configure the SSL Policy because it is not supported by AGIC annotations.

@frbosch
Copy link

frbosch commented Jan 14, 2022

Edit: See my comment below. It looks like SSL Profiles getting removed by AGIC. I can confirm that a custom SSL Policy is not overridden.

@martwana
Copy link

martwana commented Jan 14, 2022 via email

@frbosch
Copy link

frbosch commented Jan 14, 2022

@martwana Thanks, for your feedback. I was using SSL Profiles, and they seem to be removed by AGIC. Setting the SSL policy under Listeners beforehand works.

@aidapsibr
Copy link

Am I right in interpreting that there is currently no way to set a default policy and AGIC removes listener policies, so in effect, forces you to use insecure protocols?

@aidapsibr
Copy link

Since the new preview ssl policies call out that it will upgrade the entire gateway and you can't mix v1 and v2 policies, maybe that is a work around?

@kevinkupski
Copy link

I was able to successfully configure an SSL profile via Terraform

"azurerm_application_gateway" "k8s_ingress" {
  ...
  ssl_profile {
    name = "appGatewaySslProfile"
    ssl_policy {
      policy_type = "Predefined"
      policy_name = "AppGwSslPolicy20220101S"

    }
  }
}

...and then use it via the appgw-ssl-profile annotation. It provisions correctly and applies the correct policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants