在 Redis 中存储访问令牌
Storing access token in Redis
我正在使用 Redis 来存储访问令牌。我想知道在保存到redis之前是否需要加密令牌。如果是,请解释 why.I 我正在使用 C# 和 Stackexchange.Redis 库。
的安全部分所述
Redis is designed to be accessed by trusted clients inside trusted environments. This means that usually it is not a good idea to expose the Redis instance directly to the internet or, in general, to an environment where untrusted clients can directly access the Redis TCP port or UNIX socket.
因此,最好保护实例而不是其中的每个单独数据。 Redis不支持加密,正如你提到的你需要在应用层处理。您需要使用 encrypt/decrypt 方法包装命令。
为了额外的安全,我认为您必须通过在配置文件中设置密码来使用 authentication
。它可以很长,并将保存在配置文件中,因此每个命令都需要 auth
作为先决条件。
如果您担心与 Redis 通信的实例的安全性,那是另一个话题。 auth
就像加密秘密一样无济于事。由于这两个秘密都在攻击者手中,他可以检索到原始数据。
我正在使用 Redis 来存储访问令牌。我想知道在保存到redis之前是否需要加密令牌。如果是,请解释 why.I 我正在使用 C# 和 Stackexchange.Redis 库。
Redis is designed to be accessed by trusted clients inside trusted environments. This means that usually it is not a good idea to expose the Redis instance directly to the internet or, in general, to an environment where untrusted clients can directly access the Redis TCP port or UNIX socket.
因此,最好保护实例而不是其中的每个单独数据。 Redis不支持加密,正如你提到的你需要在应用层处理。您需要使用 encrypt/decrypt 方法包装命令。
为了额外的安全,我认为您必须通过在配置文件中设置密码来使用 authentication
。它可以很长,并将保存在配置文件中,因此每个命令都需要 auth
作为先决条件。
如果您担心与 Redis 通信的实例的安全性,那是另一个话题。 auth
就像加密秘密一样无济于事。由于这两个秘密都在攻击者手中,他可以检索到原始数据。