草庐IT

Mod_Security

全部标签

Spring Security(安全框架)

一、概念(1)SpringSecurity是一个高度自定义的安全框架。利用SpringIoC/DI和AOP功能,为系统提供了声明式安全访问控制功能,减少了为系统安全而编写大量重复代码的工作。(2)认证(Authentication):应用程序确认用户身份的过程,常见认证:登录。(3)身份(principal)/主体(Subject):认证用户的主要凭证之一。可以是账号、邮箱、手机号等。在java中主体是Object类型。(4)凭证(Credential):用户认证过程中的依据之一。常见就是密码。(5)授权(Authorization):判断用户具有哪些权限或角色。(6)SpringSecuri

Apache + Node.js + mod_proxy。如何将一个域路由到 :3000 and another to :80

问题:我需要在不同域的同一台服务器上托管一个Node应用程序和一个php应用程序。example.com应该正常使用端口80,但node-example.com应该路由到端口3000。使用mod_proxy将所有流量从端口80路由到3000可以正常工作,因此:ServerAdmininfo@node-example.comServerNamenode-example.comServerAliaswww.node-example.comProxyRequestsoffOrderdeny,allowAllowfromallProxyPasshttp://localhost:3000/Pro

Apache + Node.js + mod_proxy。如何将一个域路由到 :3000 and another to :80

问题:我需要在不同域的同一台服务器上托管一个Node应用程序和一个php应用程序。example.com应该正常使用端口80,但node-example.com应该路由到端口3000。使用mod_proxy将所有流量从端口80路由到3000可以正常工作,因此:ServerAdmininfo@node-example.comServerNamenode-example.comServerAliaswww.node-example.comProxyRequestsoffOrderdeny,allowAllowfromallProxyPasshttp://localhost:3000/Pro

Spring Security 替换WebSecurityConfigurerAdapter (Deprecated)的方法

在本文中,我将提供一个解决方案来配置Spring安全性,而无需WebSecurityConfigurerAdapter类。从SpringSecurity5.7开始,WebSecurityConfigurerAdapter类已被弃用,Spring团队鼓励用户转向基于组件的安全配置。 使用WebSecurityConfigurerAdapter在WebSecurityConfigurerAdapter类被弃用之前,我们正在编写这样的代码。我们创建了一个SpringJava配置类,它扩展了WebSecurityConfigurerAdapter类并覆盖了几个configure()方法:@Config

Spring Security 替换WebSecurityConfigurerAdapter (Deprecated)的方法

在本文中,我将提供一个解决方案来配置Spring安全性,而无需WebSecurityConfigurerAdapter类。从SpringSecurity5.7开始,WebSecurityConfigurerAdapter类已被弃用,Spring团队鼓励用户转向基于组件的安全配置。 使用WebSecurityConfigurerAdapter在WebSecurityConfigurerAdapter类被弃用之前,我们正在编写这样的代码。我们创建了一个SpringJava配置类,它扩展了WebSecurityConfigurerAdapter类并覆盖了几个configure()方法:@Config

node.js - WebSockets 和 Apache 代理 : how to configure mod_proxy_wstunnel?

我有:Apache2.4在我服务器的80端口上,mod_proxy和mod_proxy_wstunnel启用Node.js+socket.io在同一个服务器的3001端口访问example.com(使用端口80)重定向到2。感谢thismethod使用以下Apache配置:ServerNameexample.comProxyPass/http://localhost:3001/ProxyPassReverse/http://localhost:3001/ProxyPass/ws://localhost:3001/ProxyPassReverse/ws://localhost:3001/

node.js - WebSockets 和 Apache 代理 : how to configure mod_proxy_wstunnel?

我有:Apache2.4在我服务器的80端口上,mod_proxy和mod_proxy_wstunnel启用Node.js+socket.io在同一个服务器的3001端口访问example.com(使用端口80)重定向到2。感谢thismethod使用以下Apache配置:ServerNameexample.comProxyPass/http://localhost:3001/ProxyPassReverse/http://localhost:3001/ProxyPass/ws://localhost:3001/ProxyPassReverse/ws://localhost:3001/

security - JWT(JSON Web Token)自动延长过期时间

我想对我们的新RESTAPI实现基于JWT的身份验证。但是既然在token中设置了过期时间,是不是可以自动延长呢?如果用户在此期间积极使用该应用程序,我不希望用户在每X分钟后登录一次。那将是一个巨大的用户体验失败。但是延长过期时间会创建一个新token(旧token在过期之前仍然有效)。在每个请求之后生成一个新token对我来说听起来很愚蠢。当多个token同时有效时,这听起来像是一个安全问题。当然,我可以使用黑名单使旧的使用无效,但我需要存储token。JWT的好处之一是无需存储。我发现了Auth0是如何解决它的。他们不仅使用JWTtoken,还使用刷新token:https://a

security - JWT(JSON Web Token)自动延长过期时间

我想对我们的新RESTAPI实现基于JWT的身份验证。但是既然在token中设置了过期时间,是不是可以自动延长呢?如果用户在此期间积极使用该应用程序,我不希望用户在每X分钟后登录一次。那将是一个巨大的用户体验失败。但是延长过期时间会创建一个新token(旧token在过期之前仍然有效)。在每个请求之后生成一个新token对我来说听起来很愚蠢。当多个token同时有效时,这听起来像是一个安全问题。当然,我可以使用黑名单使旧的使用无效,但我需要存储token。JWT的好处之一是无需存储。我发现了Auth0是如何解决它的。他们不仅使用JWTtoken,还使用刷新token:https://a

security - 使用 kubernetes 使用敏感信息填充 Docker 容器

我有一个运行容器的pod,这些容器需要访问APIkey和数据库密码等敏感信息。现在,这些敏感值嵌入到Controller定义中,如下所示:env:-name:DB_PASSWORDvalue:password然后在Docker容器中作为$DB_PASSWORD环境变量可用。一切都相当容易。但是在Secrets上阅读他们的文档,他们明确表示将敏感的配置值放入您的定义中违反了最佳实践,并且可能是一个安全问题。我能想到的唯一其他策略如下:为每个用户社区或命名空间创建一个OpenPGPkey使用crypt将配置值设置为etcd(使用私钥加密)创建一个包含私钥likeso的Kubernetess