All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: mTLS on bmcweb
@ 2020-06-08  2:48 Ed Tanous
  2020-06-10  3:50 ` Zhenfei Tai
  0 siblings, 1 reply; 14+ messages in thread
From: Ed Tanous @ 2020-06-08  2:48 UTC (permalink / raw)
  To: openbmc

>> I did more testing and found the reason why it accepts any client
certification.

It looks like you never got a great answer to this.

There's a slight conflict between needs here.  On the one hand, bmcweb
needs to support multiple authentication mechanisms, some of which are
compatible with standards that are more or less set in stone (Redfish,
Dbus-rest api, ect).  On the other hand, a lot of people looking to
turn on mutual TLS auth are doing so to reduce the scope of code they
have to "trust" for authentication down to only the SSL library, which
(hopefully) is rigorously tested.  The problem arises here that there
are modes, like Redfish and the webui, that require certain assets to
be available without authentication.  In the case of Redfish, it
requires the introspectable schema files, in the case of the webui,
the static pages that make it up need to be loaded so the UI launches
and the user sees a login page.  (Unrelated note, we make more than is
needed available here, but that's a different problem.)

When I first built the patch to do mutual TLS, my intention was to at
least try to support as many authentication mechanisms as I could,
hence the code you're looking at now that only uses the mutual TLS
auth as a _possible_ authentication mechanism, leaving the final
decision be made by the auth code in bmcweb.  One thing that seems to
have gotten lost in translation somewhere between that code and when
it hit master is that if mutual TLS is the only enabled authentication
mechanism at that point in time, we know that we're not operating in
any standards that would require static assets, and bmcweb can simply
deny the connection on the front end, like you would expect, in the
code that you've already found.

TL;DR;

Add something like this:

// Get the current auth config
AuthConfigMethods& methods =
crow::persistent_data::SessionStore::getInstance().getAuthMethodsConfig();
// if only mTLS is enabled, we can close the connection immediately,
as no other auth methods will be tried.
if (methods. xtoken == false &&
methods.cookie == false &&
methods.sessionToken == false &&
methods.basic = false &&
methods.tls == true){
    return false;
}

Here:
https://github.com/openbmc/bmcweb/blame/master/http/http_connection.h#L302

...and I suspect it'll work like you want.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* mTLS on bmcweb
@ 2020-04-22 21:58 Zhenfei Tai
  0 siblings, 0 replies; 14+ messages in thread
From: Zhenfei Tai @ 2020-04-22 21:58 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

Hi,

I'm trying out bmcweb mTLS which should be enabled by default by
https://github.com/openbmc/bmcweb/blob/master/CMakeLists.txt#L89

In my test, I created a self signed key and certificate pair, stacked them
up into server.pem in /etc/ssl/certs/https that bmcweb uses.

However when I tried to curl bmcweb service, I was able to get response by
only supplying the cert.

curl --cacert cert.pem  https://${bmc}/redfish/v1

With the mTLS enabled, I expected it should error out since no client
certificate is provided.

Could someone with relevant knowledge help with my question?

Thanks,
Zhenfei

[-- Attachment #2: Type: text/html, Size: 929 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-06-10  3:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1237.1587601186.5884.openbmc@lists.ozlabs.org>
2020-04-23 10:47 ` mTLS on bmcweb P. K. Lee (李柏寬)
2020-04-23 15:50   ` Joseph Reynolds
2020-04-23 16:36     ` Zhenfei Tai
2020-04-23 17:35       ` Richard Hanley
2020-04-24 17:03         ` Wiktor Gołgowski
2020-04-30 13:27           ` P. K. Lee (李柏寬)
2020-04-30 18:34             ` Zhenfei Tai
2020-04-30 19:09               ` Zhenfei Tai
2020-04-30 23:39                 ` Zhenfei Tai
2020-05-04  2:27                   ` P. K. Lee (李柏寬)
2020-05-06 11:13                     ` Zbyszek
2020-06-08  2:48 Ed Tanous
2020-06-10  3:50 ` Zhenfei Tai
  -- strict thread matches above, loose matches on Subject: below --
2020-04-22 21:58 Zhenfei Tai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.