カスタムポリシー

カスタムポリシーはユーザが独自に作成できるポリシーで、必要に応じて細かく操作権限を設定することができます。

作成方法

  1. 「アクセス管理」ページのポリシータブにある「ポリシーを追加」をクリック 一覧
  2. ポリシー名を入力し、操作権限を設定し「保存」をクリック ポリシー作成
  3. 作成したポリシーが一覧に追加されます ポリシー一覧

仕様

ポリシーフォーマット

カスタムポリシーは JSON 形式で記述します。以下のフォーマットに従って作成してください。

{
  "version": 1,
  "statements": [
    {
      "effect": "allow" | "deny",
      "actions": [
        "*" | "specific action",
        ...
      ],
      "resources": [
        "*" | "actcast:{resource_type}:{resource_id}",
        ...
      ]
    },
    ...
  ]
}

version

Actcast Policy のバージョンを指定します。
現時点では 1 のみ有効です。

effect

effect には allow または deny を指定します。
deny は常に allow よりも優先され、statements に記述のないアクションはデフォルトで deny として扱われます。

actions

actions には許可または拒否するアクションを指定します。
アクションには全てのアクションを意味する * または 設定可能なアクション & リソース一覧 に記載されている特定のアクションを指定することができます。

resources

resources には対象となるリソースを指定します。
リソースには全てのリソースを意味する * または actcast:{resource_type}:{resource_id} という形式の 設定可能なアクション & リソース一覧 に記載されている特定のリソースを指定することができます。

リソースの resource_id は特定の ID の他に * も指定することが出来るため、以下の例は全て有効なリソースです。

  • *
  • actcast:act:*
  • actcast:act:123

設定可能なアクション & リソース一覧

可能になる操作 アクション リソース 備考
Device —— —— ——
デバイスの一覧表示 list:device actcast:device:* リソースは actcast:device:* のみ指定可能
デバイスタグの一覧表示 list:device_tag actcast:device:* リソースは actcast:device:* のみ指定可能
デバイスの新規登録 create:device actcast:device:* リソースは actcast:device:* のみ指定可能
Take Photo の実行 create:device_photo actcast:device:{resource_id}
デバイスの LED の点滅 create:blink_led_command actcast:device:{resource_id}
ファームウェアアップデートの実行 create:firmware_update_command actcast:device:{resource_id}
デバイスの再起動 create:reboot_command actcast:device:{resource_id}
デバイスのシャットダウン create:shutdown_command actcast:device:{resource_id}
メジャーファームウェアアップデートの実行 create:major_firmware_update_command actcast:device:{resource_id}
デバイスステータスの更新 create:device_status_command actcast:device:{resource_id}
デバイスの詳細表示 read:device actcast:device:{resource_id}
Take Photo の画像表示 read:device_photo actcast:device:{resource_id}
デバイスログの表示 read:device_log actcast:device:{resource_id}
イベントログの表示 read:event_log actcast:device:{resource_id}
Act log の表示 read:act_log actcast:device:{resource_id}
デバイスの Act の表示 read:device_act actcast:device:{resource_id}
デバイス名の変更 update:device_name actcast:device:{resource_id}
デバイスのホスト名の変更 update:device_hostname actcast:device:{resource_id}
デバイスの Wi-Fi 設定の変更 update:device_wifi_setting actcast:device:{resource_id}
デバイスのファームウェアアップデート禁止設定の変更 update:device_prevent_update_setting actcast:device:{resource_id}
デバイスのファームウェア設定の変更 update:device_firmware_config actcast:device:{resource_id}
デバイスの自動再起動設定の変更 update:device_auto_reboot_setting actcast:device:{resource_id}
デバイスの mDNS 設定の更新 update:device_mdns_setting actcast:device:{resource_id}
デバイスの開発者モードの設定 update:device_dev_mode actcast:device:{resource_id}
デバイスタグの更新 update:device_tag actcast:device:{resource_id}
デバイスの Act の更新 update:device_act actcast:device:{resource_id}
デバイスの登録解除 delete:device actcast:device:{resource_id}
デバイスの Act のアンインストール delete:device_act actcast:device:{resource_id}
App —— —— ——
アプリの一覧表示 list:app actcast:app:* リソースは actcast:app:* のみ指定可能
アプリの新規作成 create:app actcast:app:* リソースは actcast:app:* のみ指定可能
アプリの詳細表示 read:app actcast:app:{resource_id}
アプリの更新 update:app actcast:app:{resource_id}
アプリの削除 delete:app actcast:app:{resource_id}
Act —— —— ——
Act の一覧表示 list:act actcast:act:* リソースは actcast:act:* のみ指定可能
Act の新規作成 create:act actcast:act:* リソースは actcast:act:* のみ指定可能
Act の詳細表示 read:act actcast:act:{resource_id}
Act の更新 update:act actcast:act:{resource_id}
Act の削除 delete:act actcast:act:{resource_id}
Cast —— —— ——
Cast の一覧表示 list:cast actcast:act:{resource_id}
Cast の新規作成 create:cast actcast:act:{resource_id}
Cast の詳細表示 read:cast actcast:act:{resource_id}
Cast の更新 update:cast actcast:act:{resource_id}
Cast の削除 delete:cast actcast:act:{resource_id}
SystemCast —— —— ——
SystemCast の一覧表示 list:system_cast actcast:system_cast:* リソースは actcast:system_cast:* のみ指定可能
SystemCast の新規作成 create:system_cast actcast:system_cast:* リソースは actcast:system_cast:* のみ指定可能
SystemCast の詳細表示 read:system_cast actcast:system_cast:{resource_id}
SystemCast の更新 update:system_cast actcast:system_cast:{resource_id}
SystemCast の削除 delete:system_cast actcast:system_cast:{resource_id}
Group —— —— ——
グループ情報の詳細表示 read:group actcast:group:{resource_id}
グループ情報の更新 update:group actcast:group:{resource_id}
GroupMember —— —— ——
グループメンバの一覧表示 list:group_member actcast:group_member:* リソースは actcast:group_member:* のみ指定可能
グループメンバの詳細表示 read:group_member actcast:group_member:{resource_id}
Media —— —— ——
メディアの一覧表示 list:media actcast:media:* リソースは actcast:media:* のみ指定可能
メディアの新規作成 create:media actcast:media:* リソースは actcast:media:* のみ指定可能
メディアの削除 delete:media actcast:media:{resource_id}
ApiToken —— —— ——
API Token の一覧表示 list:api_token actcast:api_token:* リソースは actcast:api_token:* のみ指定可能
API Token の新規作成 create:api_token actcast:api_token:* リソースは actcast:api_token:* のみ指定可能
API Token の詳細表示 read:api_token actcast:api_token:{resource_id}
API Token の削除 delete:api_token actcast:api_token:{resource_id}
DeveloperToken —— —— ——
Developer Token の一覧表示 list:developer_token actcast:developer_token:* リソースは actcast:developer_token:* のみ指定可能
Developer Token の新規作成 create:developer_token actcast:developer_token:* リソースは actcast:developer_token:* のみ指定可能
Developer Token の削除 delete:developer_token actcast:developer_token:{resource_id}

statements が複数存在する場合の挙動

statements が複数存在する場合、いくつかのルールに基づいてアクセス権限が判定されます。

allowdeny が混在する場合

deny は常に allow よりも優先されるため、以下のケースでは全ての cast リソースに対して delete:cast アクションは拒否されます。

{
  "version": 1,
  "statements": [
    {
      "effect": "allow",
      "actions": [
        "*"
      ],
      "resources": ["*"]
    },
    {
      "effect": "deny",
      "actions": [
        "delete:cast"
      ],
      "resources": ["*"]
    }
  ]
}

同一のアクションを持つ statement が複数存在する場合

同一のアクションを持つ statement が複数存在する場合、その中の一つでも allow と判定されればそのリソースへのアクションは許可されます。
そのため、以下のケースでは全ての act リソースに対して read:act アクションが許可されます。

{
  "version": 1,
  "statements": [
    {
      "effect": "allow",
      "actions": [
        "read:act"
      ],
      "resources": ["*"]
    },
    {
      "effect": "allow",
      "actions": [
        "read:act"
      ],
      "resources": ["actcast:act:123"]
    }
  ]
}
最終更新日