-
Notifications
You must be signed in to change notification settings - Fork 386
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
Support IPsec Certificate-based Authentication #3778
Conversation
d1105d2
to
3e4b14c
Compare
b3cfb9d
to
b909b81
Compare
Codecov Report
@@ Coverage Diff @@
## main #3778 +/- ##
==========================================
- Coverage 62.12% 60.73% -1.39%
==========================================
Files 281 290 +9
Lines 40096 41219 +1123
==========================================
+ Hits 24909 25035 +126
- Misses 13215 14154 +939
- Partials 1972 2030 +58
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/certificatesigningrequest/approver_controller.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we need a feature gate for this.
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/certificatesigningrequest/approver_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/certificatesigningrequest/approver_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/certificatesigningrequest/approver_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/certificatesigningrequest/approver_controller.go
Outdated
Show resolved
Hide resolved
During the manual tests, i found that keeping certificate names while rotating certificates will not work. Not only because the monitor script of OVS will not detect such changes, strongswan will also not load the certificate as long as the cert defined in |
7b3fc2c
to
ec94ce3
Compare
/test-e2e |
/test-e2e |
d29d0c9
to
8cc89f4
Compare
82e6835
to
4d9392d
Compare
pkg/agent/controller/ipseccertificate/ipsec_certificate_controller.go
Outdated
Show resolved
Hide resolved
dbabdac
to
60e1db2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
/test-all |
Introduce a new authentication mode for IPsec tunnel encryption. A new config `ipsec.authenticationMode` is added to the Agent. Now Antrea supports both "psk" and "cert" modes for IPsec authentication If "cert" is enabled, Antrea Agent will request IPsec certificates by Kubernetes CertificateSigningRequests API with signer name `antrea.io/antrea-agent-ipsec-tunnel`. Antrea Controller will validate the requests and issue certificates if the request is permitted. The signer `antrea.io/antrea-agent-ipsec-tunnel` in Antrea Controller has the following properties: - Trust distribution - CA certificate will be saved as a ConfigMap `antrea-ipsec-ca` in `kube-system` namespace. - Permitted subjects - organizations are exactly ["antrea.io"], common name must be one of the Node names. - Permitted x509 extension - honors key usage and DNSName extensions, forbids other subjectAltName extensions. DNS name must be the same as the common name. - Permitted key usages - exactly ["ipsec tunnel"] - Expiration/certificate lifetime - defaults to 1 year. - CA bit allowed/disallowed - not allowed. The CSRs can be automatically approved by default. Antrea Controller will validate Pod identity to provide maximum security if the Kubernetes `BoundServiceAccountTokenVolume` feature gate is enabled. Antrea Agents will renew certificates automatically when the certificate reaches approximately 80% of the lifetime. This feature requires feature gate `IPsecCertAuth` to be enabled. Closes: antrea-io#3765 Signed-off-by: Xu Liu <xliu2@vmware.com>
/test-all |
/test-networkpolicy |
5 similar comments
/test-networkpolicy |
/test-networkpolicy |
/test-networkpolicy |
/test-networkpolicy |
/test-networkpolicy |
Introduce a new authentication mode for IPsec tunnel encryption.
A new config
ipsec.authenticationMode
is added to the Agent.Now Antrea supports both "psk" and "cert" modes for IPsec
authentication If "cert" is enabled, Antrea Agent will request IPsec
certificates by Kubernetes CertificateSigningRequests API with
signer name
antrea.io/antrea-agent-ipsec-tunnel
. Antrea Controllerwill validate the requests and issue certificates if the request is
permitted.
The signer
antrea.io/antrea-agent-ipsec-tunnel
in Antrea Controllerhas the following properties:
antrea-ipsec-ca
inkube-system
namespace.name must be one of the Node names.
extensions, forbids other subjectAltName extensions. DNS name
must be the same as the common name.
The CSRs can be automatically approved by default. Antrea Controller
will validate Pod identity to provide maximum security if the Kubernetes
BoundServiceAccountTokenVolume
feature gate is enabled. AntreaAgents will renew certificates automatically when the certificate
reaches approximately 80% of the lifetime.
This feature requires feature gate
IPsecCertAuth
to be enabled.Closes: #3765
Signed-off-by: Xu Liu xliu2@vmware.com