1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        Cerbos云原生應(yīng)用訪問控制引擎

        聯(lián)合創(chuàng)作 · 2023-09-29 06:58

        Cerbos 是一款云原生應(yīng)用的訪問控制工具,通過為應(yīng)用程序資源編寫上下文感知訪問控制策略來增強(qiáng)授權(quán)控制。

        • 使用直觀的 YAML 配置語言編寫訪問規(guī)則
        • 使用 Git-ops 基礎(chǔ)架構(gòu)來測(cè)試和部署
        • 向 Cerbos PDP 發(fā)出簡(jiǎn)單的 API 請(qǐng)求,以評(píng)估策略并做出動(dòng)態(tài)訪問決策

        用例:

        派生角色:根據(jù)上下文數(shù)據(jù)為用戶動(dòng)態(tài)分配新角色。

        ---
        apiVersion: "api.cerbos.dev/v1"
        derivedRoles:
          name: common_roles
          definitions:
            - name: owner
              parentRoles: ["user"]
              condition:
                match:
                  expr: request.resource.attr.owner == request.principal.id
        
            - name: abuse_moderator
              parentRoles: ["moderator"]
              condition:
                match:
                  expr: request.resource.attr.flagged == true

         資源策略:為資源編寫訪問規(guī)則。

        ---
        apiVersion: api.cerbos.dev/v1
        resourcePolicy:
          importDerivedRoles:
            - common_roles
          resource: "album:object"
          version: "default"
          rules:
            - actions: ['*']
              effect: EFFECT_ALLOW
              derivedRoles:
                - owner
        
            - actions: ['view', 'flag']
              effect: EFFECT_ALLOW
              roles:
                - user
              condition:
                match:
                  expr: request.resource.attr.public == true
        
            - actions: ['view', 'delete']
              effect: EFFECT_ALLOW
              derivedRoles:
                - abuse_moderator
        

        API 請(qǐng)求

        cat <<EOF | curl --silent "http://localhost:3592/api/check?pretty" -d @-
        {
          "requestId":  "test01",
          "actions":  ["view"],
          "resource":  {
            "kind":  "album:object",
            "instances": {
              "XX125": {
                "attr":  {
                  "owner":  "alicia",
                  "id":  "XX125",
                  "public": false,
                  "flagged": false
                }
              }
            }
          },
          "principal":  {
            "id":  "alicia",
            "roles":  ["user"]
          }
        }
        EOF
        

        API 響應(yīng)

        {
          "requestId": "test01",
          "resourceInstances": {
            "XX125": {
              "actions": {
                "view": "EFFECT_ALLOW"
              }
            }
          }
        }
        
        瀏覽 23
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            透逼网| 成人福利午夜A片公司 | a级黄色大片免费视频播放 | 99性爱视频 | 国产白丝视频 | aaaaaa免费看片 | 国产三级电影网址 | 扒开小男生嫩嫩的屁股网站 | 国产五十路 | 友田真希一区二区 |