CoSec v1.10.1 发布,基于 RBAC 和策略的多租户响应式安全框架
CoSec
基于 RBAC 和策略的多租户响应式安全框架。
更新内容(v1.10.1) 🎉 🎉 🎉
特性:新增
ContainsConditionMatcher
。{ "name": "TestContains", "effect": "allow", "actions": [ { "type": "all" } ], "condition": { "type": "contains", "part": "request.attributes.ipRegion", "pattern": "上海" } }
认证
授权
OAuth
建模类图
安全网关服务
授权策略流程
内置策略匹配器
ActionMatcher
如何自定义 ActionMatcher
(SPI)
class CustomActionMatcherFactory : ActionMatcherFactory { companion object { const val TYPE = "[CustomActionType]" } override val type: String get() = TYPE override fun create(onfiguration: Configuration): ActionMatcher { return CustomActionMatcher(onfiguration) } } class CustomActionMatcher(configuration: Configuration) : AbstractActionMatcher(CustomActionMatcherFactory.TYPE, configuration) { override val type: String get() = CustomActionMatcherFactory.TYPE override fun internalMatch(request: Request, securityContext: SecurityContext): Boolean { //Custom matching logic } }
META-INF/services/me.ahoo.cosec.policy.action.ActionMatcherFactory
# CustomActionMatcherFactory fully qualified name
ConditionMatcher
如何自定义 ConditionMatcher
(SPI)
class CustomConditionMatcherFactory : ConditionMatcherFactory { companion object { const val TYPE = "[CustomConditionType]" } override val type: String get() = TYPE override fun create(configuration: Configuration): ConditionMatcher { return CustomConditionMatcher(configuration) } } class CustomConditionMatcher(configuration: Configuration) : AbstractActionMatcher(CustomActionMatcherFactory.TYPE, configuration) { override val type: String get() = CustomConditionMatcherFactory.TYPE override fun internalMatch(request: Request, securityContext: SecurityContext): Boolean { //Custom matching logic } }
META-INF/services/me.ahoo.cosec.policy.condition.ConditionMatcherFactory
# CustomConditionMatcherFactory fully qualified name
策略 Schema
策略 Demo
{ "id": "id", "name": "name", "category": "category", "description": "description", "type": "global", "tenantId": "tenantId", "statements": [ { "name": "Anonymous", "effect": "allow", "actions": [ { "type": "path", "pattern": "/auth/register" }, { "type": "path", "pattern": "/auth/login" } ] }, { "name": "UserScope", "effect": "allow", "actions": [ { "type": "path", "pattern": "/user/#{principal.id}/*" } ], "condition": { "type": "authenticated" } }, { "name": "Developer", "effect": "allow", "actions": [ { "type": "all" } ], "condition": { "type": "in", "part": "context.principal.id", "in": [ "developerId" ] } }, { "name": "RequestOriginDeny", "effect": "deny", "actions": [ { "type": "all" } ], "condition": { "type": "reg", "negate": true, "part": "request.origin", "pattern": "^(http|https)://github.com" } }, { "name": "IpBlacklist", "effect": "deny", "actions": [ { "type": "all" } ], "condition": { "type": "path", "part": "request.remoteIp", "path": { "caseSensitive": false, "separator": ".", "decodeAndParseSegments": false }, "pattern": "192.168.0.*" } }, { "name": "RegionWhitelist", "effect": "deny", "actions": [ { "type": "all" } ], "condition": { "negate": true, "type": "reg", "part": "request.attributes.ipRegion", "pattern": "^中国\\|0\\|(上海|广东省)\\|.*" } }, { "name": "AllowDeveloperOrIpRange", "effect": "allow", "actions": [ { "type": "all" } ], "condition": { "type": "bool", "bool": { "and": [ { "type": "authenticated" } ], "or": [ { "type": "in", "part": "context.principal.id", "in": [ "developerId" ] }, { "type": "path", "part": "request.remoteIp", "path": { "caseSensitive": false, "separator": ".", "decodeAndParseSegments": false }, "pattern": "192.168.0.*" } ] } } } ] }
感谢
CoSec 权限策略设计参考 AWS IAM 。

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
渠成企业软件百宝箱 2.6 版本发布,新增解决方案市场
大家好,渠成企业软件百宝箱 2.6 版本发布了,新增解决方案市场,并上架禅道 DevOps 解决方案。 渠成官网为您提供渠成软件百宝箱的试用,您可以在应用市场选取需要的应用体验安装与试用,我们还提供每一款应用的演示服务,让您快速体验不同的应用。 一、新增功能 1.1 新增解决方案市场 新增“解决方案”市场,并上架了禅道 DevOps 解决方案。渠成平台会陆续上架更多的解决方案,您可以通过解决方案市场找到适合自己使用场景的解决方案,并且一键安装。 二、2.6 版本详细更新列表 2.1 新特性 新增解决方案市场 上架禅道 DevOps 解决方案 2.2 应用更新 ModStartCMS 更新到 5.5.0 Drawio 更新到 20.8.3 Gogs 更新到 0.12.10 ZenDAS 更新到 1.3.0 2.3 变更 内部邮件代理服务支持了 STARTTLS 域名管理模块,对上传的证书类型做了更好的兼容 Gogs 集成了邮件功能 相关文档 ModStartCMS 更新到 5.5.0 Drawio 更新到 v20.8.3
- 下一篇
Apache Sling App CMS <1.1.4 存在反射型XSS漏洞
漏洞描述 Apache Sling 是一个基于可扩展内容树(extensible content tree)的 RESTful Web 应用框架。 1.1.4 之前版本的 Apache Sling 中的 cms.js#confirmMessage 方法未对用户可控的 title 和 message 参数进行过滤,攻击者可通过将恶意字符如(";alert('XSS'))加载到 startcontent.jsp 页面的 title 和 message 参数中,当用户访问该页面时远程执行恶意 javascript 代码。 漏洞名称 Apache Sling App CMS <1.1.4 存在反射型XSS漏洞 漏洞类型 XSS 发现时间 2023-01-10 漏洞影响广度 小 MPS编号 MPS-2022-67148 CVE编号 CVE-2022-46769 CNVD编号 - 影响范围 org.apache.sling:org.apache.sling.cms@[0.9.0, 1.1.4) 修复方案 升级org.apache.sling:org.apache.sling.cms到 1.1...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- SpringBoot2整合Thymeleaf,官方推荐html解决方案
- CentOS关闭SELinux安全模块
- CentOS8安装Docker,最新的服务器搭配容器使用
- CentOS7,CentOS8安装Elasticsearch6.8.6
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- MySQL8.0.19开启GTID主从同步CentOS8
- Red5直播服务器,属于Java语言的直播服务器