Skip to content

Commit 998163a

Browse files
rm-youcgoncalves
authored andcommitted
Fix urgent amphora two-way auth security bug
The value of gunicorn's option 'cert_reqs` for client-cert requirement does not take a boolean, but rather `ssl.CERT_REQUIRED` which is `2`. Story: 2006660 Task: 36916 SecurityImpact: CVE-2019-17134 Depends-On: https://review.opendev.org/#/c/686724/ Change-Id: I5619f5e40d7c9a2ee7741bf4664c0d2d08963992 (cherry picked from commit 2c9af84)
1 parent de49210 commit 998163a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

octavia/cmd/agent.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def main():
7474
'timeout': CONF.amphora_agent.agent_request_read_timeout,
7575
'certfile': CONF.amphora_agent.agent_server_cert,
7676
'ca_certs': CONF.amphora_agent.agent_server_ca,
77-
'cert_reqs': True,
77+
'cert_reqs': ssl.CERT_REQUIRED,
7878
'ssl_version': getattr(ssl, "PROTOCOL_%s" % proto),
7979
'preload_app': True,
8080
'accesslog': '/var/log/amphora-agent.log',

octavia/tests/unit/cmd/test_agent.py

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
12+
import ssl
1213

1314
import mock
1415

@@ -36,5 +37,11 @@ def test_main(self, mock_service, mock_process, mock_server, mock_amp):
3637

3738
agent.main()
3839

40+
# Ensure gunicorn is initialized with the correct cert_reqs option.
41+
# This option is what enforces use of a valid client certificate.
42+
self.assertEqual(
43+
ssl.CERT_REQUIRED,
44+
mock_amp.call_args[0][1]['cert_reqs'])
45+
3946
mock_health_proc.start.assert_called_once_with()
4047
mock_amp_instance.run.assert_called_once()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
security:
3+
- |
4+
Correctly require two-way certificate authentication to connect to the
5+
amphora agent API (CVE-2019-17134).

0 commit comments

Comments
 (0)