V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zxCoder
V2EX  ›  问与答

mongodb 有数据库存取控制吗

  •  
  •   zxCoder · 2020-11-20 11:54:23 +08:00 · 706 次点击
    这是一个创建于 1255 天前的主题,其中的信息可能已经有所发展或是发生改变。

    导师给了个很奇怪的毕设题目,在 mongodb 基础上实现数据库的存取控制,我寻思这不是 db 都有额基本功能吗?

    自主存取控制( Discretionary Access Control 简称 DAC ):

    • 用户对不同的数据对象有不同的存取权限。
    • 不同的用户对同一对象也有不同的权限。
    • 用户还可以将其拥有的存取权限转授给其他用户。

    强制存取控制( Mandatory Access Control 简称 MAC ):

    • 每一个数据库对象被标以一定的密级。
    • 每一个用户被授予某一个级别的许可证。
    • 对于任意一个对象,只有具备合法许可证的用户才可以存取。
    8 条回复    2020-11-20 19:50:59 +08:00
    auxox
        1
    auxox  
       2020-11-20 12:49:45 +08:00
    DAC 这块 mongo 是明确支持的。参见: https://docs.mongodb.com/manual/core/authorization/
    有一点很好奇,这个题目的意思是在 mongo 的 codebase 上加额外的功能吗
    zxCoder
        2
    zxCoder  
    OP
       2020-11-20 13:03:51 +08:00
    @auxox 应该是可以加一个中间层的意思吧...老师一直强调 mongodb 不支持存取控制,听得我云里雾里,回来一查不太对劲
    zxCoder
        3
    zxCoder  
    OP
       2020-11-20 13:11:45 +08:00
    @auxox 是不是说 mongodb 的权限控制粒度只是到角色和文档,有没有像关系型数据库中对某些列或者是某些元祖的访问权限控制
    zxCoder
        4
    zxCoder  
    OP
       2020-11-20 13:13:06 +08:00
    Privileges
    A privilege consists of a specified resource and the actions permitted on the resource.

    A resource is a database, collection, set of collections, or the cluster. If the resource is the cluster, the affiliated actions affect the state of the system rather than a specific database or collection. For information on the resource documents, see Resource Document.

    An action specifies the operation allowed on the resource. For available actions see Privilege Actions.
    @auxox
    EPr2hh6LADQWqRVH
        5
    EPr2hh6LADQWqRVH  
       2020-11-20 13:16:38 +08:00
    毕设不得你自己实现么。。
    你用人家功能算啥。。。

    真 import 论文么。。。
    auxox
        6
    auxox  
       2020-11-20 14:31:29 +08:00
    @zxCoder mongo 权限控制粒度没有那么细,最小的粒度是集合,也就是 rdbms 中的表。话说 mysql 或者 pg 有针对特定记录进行访问控制的功能吗,如果支持的话,那对于记录数为千万级的表,这块怎么实现呢。。。
    zxCoder
        7
    zxCoder  
    OP
       2020-11-20 19:07:49 +08:00
    @avastms ...
    zxCoder
        8
    zxCoder  
    OP
       2020-11-20 19:50:59 +08:00
    @auxox 找老师问了一下 确实大致工作就是要实现更小的粒度的存取控制。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   965 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:32 · PVG 05:32 · LAX 14:32 · JFK 17:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.