Guarding Against CSRF Vulnerability in Redis

本文涉及的产品
云数据库 Tair(兼容Redis),内存型 2GB
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: What is Redis CSRF vulnerability and how can we guarantee the security of Redis?

AliPoly_Security_2016_Annual_Report

Abstract: What is Redis CSRF vulnerability and how can we guarantee the security of Redis? Redis's CSRF vulnerability was exposed in February 2017, and the author of Redis has fixed the vulnerability in the latest release of Redis 3.2.7. This article briefly introduces the concept of CSRF vulnerability and the best practices to keep Redis instances secure.

What is CSRF?

Cross-site request forgery (CSRF or XSRF), also known as "One Click Attack" or "Session Riding", is a form of malicious website use.

46_1

The figure above shows a simple model of CSRF attacks. A user visits the malicious website Web B, which returns an HTTP message to the user asking the user to visit website Web A. If the user has set Web A as a trusted site, the access request will be executed as if the user sent the request on his/her own.

Redis CSRF Attack Model


46_2

Based on the principle of CSRF above, malicious websites may make a user send an HTTP request to Redis. Because Redis supports text protocols, and will not break off the connection in the case of illegal protocols during protocol resolution, the attacker can then add a Redis command after the normal HTTP request to execute the command on Redis. If the user and Redis do not use a password for verification, the Redis command will then be executed normally. The attacker can then encrypt data to extort money, just like the MongoDB ransom incident in January 2017.

Repairing the Kernel

The author of Redis fixed the problem in Redis v3.2.7, implementing special processing for the POST and Host: keywords, logging the events, and disconnecting to avoid execution of subsequent legal requests to Redis.

Redis Security Risks

Earlier, Redis exposed a security vulnerability that hackers may get the root permission of Redis services under certain conditions. The causes of these security vulnerabilities can be primarily attributed to users' lack of use and understanding of Redis's security mechanisms, as well as lack of Redis O&M experience. In comparison, Alibaba Cloud ApsaraDB for Redis provides more secure solutions for your on-cloud Redis services.

ApsaraDB for Redis Security Code

Intranet access to avoid Internet access

Alibaba Cloud ApsaraDB for Redis only provides trusted intranet access. You cannot access Alibaba Cloud ApsaraDB for Redis via the Internet.

Physical network isolation

Alibaba Cloud ApsaraDB for Redis's physical network and user network are physically isolated. Users' virtual machines are not allowed to directly access the backend physical machine network.

VPC network isolation

If you are an Alibaba Cloud user using the VPC network, only the services in the same VPC are inter-accessible.

Whitelist

Alibaba Cloud ApsaraDB for Redis supports whitelist settings. The feature is currently not available in the console yet. With this feature, you can set a whitelist for allowed users directly using the console.

Password access

Alibaba Cloud ApsaraDB for Redis enforces password authentication for instances in the classic network. You are recommended to set a complex password to prevent it from being cracked.

Access permission isolation

Each backend instance of Alibaba Cloud ApsaraDB for Redis is isolated in the ACL and accessible directory. Each instance is only allowed to access the path of its own instance so that inter-instance interference can be avoided.

Disabling dangerous commands

Alibaba Cloud ApsaraDB for Redis disables some dangerous system management commands such as "config" and "save". If you want to modify this parameter, you need to pass the secondary authentication in the console. This also avoids direct operations on the backend configuration files and management commands.

Security monitoring

Alibaba Cloud ApsaraDB for Redis has a complete security monitoring system for physical machines. It regularly scans and updates the security monitoring policies to discover security risks as soon as possible.

Redis cluster password

Native Redis 3.0 cluster version does not support password verification. Alibaba Cloud ApsaraDB for Redis cluster version supports password verification, which improves security.

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
运维 NoSQL Redis
Redis cluster三主三从集群快速部署(十一)
部署三主三从redis cluster集群 架构图
463 0
Redis cluster三主三从集群快速部署(十一)
|
NoSQL Redis Windows
Redis——常用命令操作
 一,启动   Centos6       进入到redis安装目录: cd redis-2.8.17     进入src目录: cd src     启动server:  ./redis-server    使用配置文件启动: .
1129 0
|
NoSQL Ubuntu Linux
redis在windows10上跑起来
原文:redis在windows10上跑起来 今天,开始学习redis,发现大多数redis都是在Linux上面运行的,可是我想把它放到windows上面运行,经过查找资料,在GitHub上面发现了一篇关于如何在window上让redis跑起来的文章,https://github.com/ServiceStack/redis-windows 这是网址,这篇文章提供了3种方法,用你喜欢使用的。
1675 0
|
NoSQL Java Redis
NoSQL之Redis(四)--- RedisCluster概念以及搭建
之前已经在博文中介绍了redis以及redis的简单实用,但是在实际的项目中用单机版redis还是很少的基本上都是实用redis集群。
2645 0
|
运维 NoSQL Redis
美团在Redis上踩过的一些坑-5.redis cluster遇到的一些问题
   转载请注明出处哈:http://carlosfu.iteye.com/blog/2254154      由于演讲时间有限,有关Redis-Cluster,演讲者没做太多介绍,简单的介绍了一些Redis-Cluster概念作用和遇到的两个问题,我们在Redis-Cluster也有很多运维经验,将来的文章会介绍。
2041 0
|
NoSQL Redis Java
Redis详解(三)------ redis的五大数据类型详细用法
  我们说 Redis 相对于 Memcache 等其他的缓存产品,有一个比较明显的优势就是 Redis 不仅仅支持简单的key-value类型的数据,同时还提供list,set,zset,hash等数据结构的存储。
1603 0
|
NoSQL 数据库 Redis
云数据库Redis版数据库如何进行管理?
本文将简单介绍如何操作云数据库Redis版。云数据库Redis版有两种操作模式,分别为视图模式和命令窗口模式。 云数据库Redis版共支持DB0到DB255,共256个分库。 在视图模式下,可在左侧菜单栏通过按钮操作进行数据的增删改查。
4684 0
|
缓存 NoSQL PHP
Windows 下 ThinkPHP5 配置 redis 缓存
Windows 下 ThinkPHP5 配置 redis 缓存
2759 0