使用HTTP基本认证的python烧瓶REST API的安全 [英] Security of python flask REST API using HTTP Basic Authentication

查看:231
本文介绍了使用HTTP基本认证的python烧瓶REST API的安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的服务器上运行了python flask,暴露了iOS应用正在使用的REST API。我正在使用Flask-HTTPAuth:模块使用HTTP基本认证。我想知道这是多么安全,因为用户名:密码字符串将在每个请求发送。



我需要使用HTTPS吗?



谢谢!

对不起英文不好。仍然在学习。

解决方案

您目前的系统非常不安全,任何人都可以在运输过程中看到登录信息。 / p>

添加安全HTTP的最简单方法是安装一个像nginx这样的代理服务器。然后nginx被配置为安全的HTTP,但是它将所有的请求转发给在私有套接字上监听的Flask应用程序,而不需要加密。 nginx.org/en/docs/http/configuring_https_servers.htmlrel =nofollow>这个链接会把你发送到安全HTTP的nginx文档。


I have python flask running on my server exposing a REST API that is being consumed by an iOS app. I'm using HTTP Basic Authentication using the Flask-HTTPAuth: module. I wanted to know how secure this is because the username:password string would be sent on every request.

Do I need to use HTTPS instead?

Thanks!

Sorry for bad english. Still learning.

解决方案

Your current system is (very!) insecure, the login information can be seen during transit by anyone.

The easiest way to add secure HTTP is to install a proxy server like nginx. Then nginx is configured for secure HTTP, but it relays all the requests to the Flask application listening on a private socket without encryption.

This link will send you to the nginx documentation on secure HTTP.

这篇关于使用HTTP基本认证的python烧瓶REST API的安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆