feat: add mTLS support for secure client-server communication (#3172)#4571
feat: add mTLS support for secure client-server communication (#3172)#4571zs-gabor wants to merge 2 commits into
Conversation
|
@zs-gabor: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@zs-gabor: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
/kind feature /area appsec |
Kérlek ellenőrizd és ha kell javíts a szövegen, amit a Description mezőbe írtam:
📝 Description
This PR implements mutual TLS (mTLS) support to enhance security for communication channels within CrowdSec, addressing the feature request in #3172.
With these changes, clients and servers can now authenticate each other using X.509 certificates, ensuring both encryption and mutual identity verification.
✨ Changes Introduced
Configuration Updates:
* Added configuration options for CA certificate (
ca_cert_file), enable TLS authentication (tls_auth) .Core Functionality:
* In case of TLS auth, checking the existence of the necessary certificates in the "UnmarshalConfig" function.
* I have highlighted the HTTP server settings in a new function "configureHTTPServer" so that the unit test is easier to check for mTLS.
* In the "appsecHandler" in case of TLS authentication, the apiKey check has been excluded.
Testing:
* Added unit/integration tests for mTLS handshake success and failure scenarios (e.g., trusted and untrusted client cert).
🔗 Related Issue
Fixes #3172
🧪 How to Test
Generate Certificates:
Generate a test CA, server certificate, and client certificates using
renew-test-certs.sh(I took the script from the http module and expanded it).Update Configuration:
Enable mTLS in your configuration file (
acquis.d/appsec.yaml):✅ Checklist