summaryrefslogtreecommitdiff
path: root/src/webserver_main.cpp
diff options
context:
space:
mode:
authorJames Feist <james.feist@linux.intel.com>2020-04-03 20:58:55 +0300
committerJames Feist <james.feist@linux.intel.com>2020-07-16 04:02:55 +0300
commit3909dc82a003893812f598434d6c4558107afa28 (patch)
treeb5c39fbb7d66ad9134a4f0fcecaa12c9346c5752 /src/webserver_main.cpp
parente7808c93f01081ca12e1b4769691b5ae673f9017 (diff)
downloadbmcweb-3909dc82a003893812f598434d6c4558107afa28.tar.xz
Rework Authorization flow
Currently we parse the whole message before authenticating, allowing an attacker the ability to upload a large image, or keep a connection open for the max amount of time easier than it should be. This moves the authentication to the earliest point possible, and restricts unauthenticated users timeouts and max upload sizes. It also makes it so that unauthenticated users cannot keep the connection alive forever by refusing to close the connection. Tested: - login/logout - firmware update - large POST when unauthenticated - timeouts when unauthenticated - slowhttptest Change-Id: Ifa02d8db04eac1821e8950eb85e71634a9e6d265 Signed-off-by: James Feist <james.feist@linux.intel.com>
Diffstat (limited to 'src/webserver_main.cpp')
-rw-r--r--src/webserver_main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index 11e8e925a8..036db5479a 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -6,6 +6,7 @@
#include <dbus_singleton.hpp>
#include <image_upload.hpp>
#include <kvm_websocket.hpp>
+#include <login_routes.hpp>
#include <obmc_console.hpp>
#include <openbmc_dbus_rest.hpp>
@@ -21,7 +22,6 @@
#include <sdbusplus/server.hpp>
#include <security_headers_middleware.hpp>
#include <ssl_key_handler.hpp>
-#include <token_authorization_middleware.hpp>
#include <vm_websocket.hpp>
#include <webassets.hpp>
#include <webserver_common.hpp>
@@ -104,7 +104,7 @@ int main(int argc, char** argv)
crow::ibm_mc_lock::Lock::getInstance();
#endif
- crow::token_authorization::requestRoutes(app);
+ crow::login_routes::requestRoutes(app);
BMCWEB_LOG_INFO << "bmcweb (" << __DATE__ << ": " << __TIME__ << ')';
setupSocket(app);