策略配置

配置

警告

自 Zun 7.0.0 (Wallaby) 起,JSON 格式的策略文件已被弃用。这个 oslopolicy-convert-json-to-yaml 工具将以向后兼容的方式将现有的 JSON 格式策略文件迁移到 YAML。

以下是 Zun 中所有可用策略的概述。有关示例配置文件,请参阅

zun

context_is_admin
默认值:

role:admin

(未提供描述)

admin_or_owner
默认值:

is_admin:True project_id:%(project_id)s

(未提供描述)

admin_api
默认值:

rule:context_is_admin

(未提供描述)

deny_everybody
默认值:

!

默认规则,拒绝所有人。

container:create
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers

创建一个新的容器。

container:create:runtime
默认值:

rule:context_is_admin

操作:
  • POST /v1/containers

使用指定的运行时创建一个新的容器。

container:create:privileged
默认值:

rule:deny_everybody

操作:
  • POST /v1/containers

创建一个新的特权容器。警告:特权容器具有很大的安全风险,因此如果您想启用此功能,请务必小心。

container:create:requested_destination
默认值:

rule:context_is_admin

操作:
  • POST /v1/containers

在请求的计算主机上创建一个容器。

container:create:image_pull_policy
默认值:

rule:context_is_admin

操作:
  • POST /v1/containers

使用指定的镜像拉取策略创建一个新的容器。

container:delete
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • DELETE /v1/containers/{container_ident}

删除一个容器。

container:delete_all_projects
默认值:

rule:context_is_admin

操作:
  • DELETE /v1/containers/{container_ident}

从所有项目中删除一个容器。

container:delete_force
默认值:

rule:context_is_admin

操作:
  • DELETE /v1/containers/{container_ident}

强制删除一个容器。

container:get_one
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}

检索特定容器的详细信息。

container:get_one:host
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers/{container_ident}

  • GET /v1/containers

  • POST /v1/containers

  • PATCH /v1/containers/{container_ident}

检索容器的主机字段。

container:get_one:image_pull_policy
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers/{container_ident}

  • GET /v1/containers

  • POST /v1/containers

  • PATCH /v1/containers/{container_ident}

检索容器的 image_pull_policy 字段。

container:get_one:privileged
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers/{container_ident}

  • GET /v1/containers

  • POST /v1/containers

  • PATCH /v1/containers/{container_ident}

检索容器的 privileged 字段。

container:get_one:runtime
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers/{container_ident}

  • GET /v1/containers

  • POST /v1/containers

  • PATCH /v1/containers/{container_ident}

检索容器的 runtime 字段。

container:get_one_all_projects
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers/{container_ident}

从所有项目中检索特定容器的详细信息。

container:get_all
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers

检索所有容器的详细信息。

container:get_all_all_projects
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers

检索跨项目的全部容器详细信息。

container:update
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • PATCH /v1/containers/{container_ident}

更新一个容器。

container:start
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/start

启动一个容器。

container:stop
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/stop

停止一个容器。

container:reboot
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/reboot

重启一个容器。

container:pause
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/pause

暂停一个容器。

container:unpause
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/unpause

取消暂停一个容器。

container:logs
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}/logs

获取容器的日志

container:execute
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/execute

在正在运行的容器中执行命令

container:execute_resize
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/execute_resize

调整执行命令使用的 TTY 的大小。

container:kill
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/kill

杀死一个正在运行的容器

container:rename
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/rename

重命名一个容器。

container:attach
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}/attach

附加到一个正在运行的容器

container:resize
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/resize

调整容器的大小。

container:top
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}/top

显示容器内部正在运行的进程。

container:get_archive
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}/get_archive

获取容器路径的 tar 归档文件。

container:put_archive
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • PUT /v1/containers/{container_ident}/put_archive

将 tar 归档文件放入容器路径以进行提取

container:stats
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}/stats

显示容器的统计信息

container:commit
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/commit

提交一个容器

container:add_security_group
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/add_security_group

将安全组添加到特定容器。

container:network_detach
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/network_detach

从容器分离网络。

container:network_attach
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/network_attach

将网络附加到容器。

container:remove_security_group
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/remove_security_group

从特定容器中删除安全组。

container:rebuild
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/rebuild

重建一个容器。

container:resize_container
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/containers/{container_ident}/resize_container

调整现有容器的大小。

image:pull
默认值:

rule:context_is_admin

操作:
  • POST /v1/images

拉取一个镜像。

image:get_all
默认值:

rule:context_is_admin

操作:
  • GET /v1/images

打印可用镜像列表。

image:get_one
默认值:

rule:context_is_admin

操作:
  • GET /v1/images/{image_id}

检索特定镜像的详细信息。

image:search
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/images/{image_ident}/search

搜索一个镜像。

image:delete
默认值:

rule:context_is_admin

操作:
  • DELETE /v1/images/{image_ident}

删除镜像。

zun-service:delete
默认值:

rule:context_is_admin

操作:
  • DELETE /v1/services

删除一个服务。

zun-service:disable
默认值:

rule:context_is_admin

操作:
  • PUT /v1/services/disable

禁用一个服务。

zun-service:enable
默认值:

rule:context_is_admin

操作:
  • PUT /v1/services/enable

启用一个服务。

zun-service:force_down
默认值:

rule:context_is_admin

操作:
  • PUT /v1/services/force_down

强制关闭一个服务。

zun-service:get_all
默认值:

rule:context_is_admin

操作:
  • GET /v1/services

显示服务的状态。

host:get_all
默认值:

rule:context_is_admin

操作:
  • GET /v1/hosts

列出所有计算主机。

host:get
默认值:

rule:context_is_admin

操作:
  • GET /v1/hosts/{host_ident}

显示特定计算主机的详细信息。

capsule:create
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/capsules/

创建一个 capsule

capsule:delete
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • DELETE /v1/capsules/{capsule_ident}

删除一个 capsule

capsule:delete_all_projects
默认值:

rule:context_is_admin

操作:
  • DELETE /v1/capsules/{capsule_ident}

删除任何项目中的容器。

capsule:get
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/capsules/{capsule_ident}

检索 capsule 的详细信息。

capsule:get:host
默认值:

rule:context_is_admin

操作:
  • GET /v1/capsules/{capsule_ident}

  • GET /v1/capsules

  • POST /v1/capsules

检索 capsule 的主机字段。

capsule:get_one_all_projects
默认值:

rule:context_is_admin

操作:
  • GET /v1/capsules/{capsule_ident}

检索任何项目中的 capsule 的详细信息。

capsule:get_all
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/capsules/

列出所有 capsule。

capsule:get_all_all_projects
默认值:

rule:context_is_admin

操作:
  • GET /v1/capsules/

列出跨项目的全部 capsule。

network:attach_external_network
默认值:

role:admin

操作:
  • POST /v1/containers

将未共享的外部网络附加到容器

network:create
默认值:

role:admin

操作:
  • POST /v1/networks

创建网络

network:delete
默认值:

role:admin

操作:
  • DELETE /v1/networks

删除网络

container:actions
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/containers/{container_ident}/container_actions/

  • GET /v1/containers/{container_ident}/container_actions/{request_id}

列出容器的操作并显示操作详细信息

container:action:events
默认值:

rule:context_is_admin

操作:
  • GET /v1/containers/{container_ident}/container_actions/{request_id}

为容器的操作详细信息添加事件详细信息。

availability_zones:get_all
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/availability_zones

列出可用区

quota:update
默认值:

rule:context_is_admin

操作:
  • PUT /v1/quotas/{project_id}

更新项目的配额

quota:delete
默认值:

rule:context_is_admin

操作:
  • DELETE /v1/quotas/{project_id}

删除项目的配额

quota:get
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/quotas/{project_id}

获取项目的配额

quota:get_default
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/quotas/defaults

获取项目的默认配额

quota_class:update
默认值:

rule:context_is_admin

操作:
  • PUT /v1/quota_classes/{quota_class_name}

更新特定配额类的配额

quota_class:get
默认值:

rule:context_is_admin

操作:
  • GET /v1/quota_classes/{quota_class_name}

列出特定配额类的配额

registry:create
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • POST /v1/registries

创建一个新的注册表。

registry:delete
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • DELETE /v1/registries/{registry_ident}

删除一个注册表。

registry:get_one
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/registries/{registry_ident}

检索特定注册表的详细信息。

registry:get_all
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • GET /v1/registries

检索所有注册表的详细信息。

registry:get_all_all_projects
默认值:

rule:context_is_admin

操作:
  • GET /v1/registries

检索跨项目的全部注册表详细信息。

registry:update
默认值:

is_admin:True project_id:%(project_id)s

操作:
  • PATCH /v1/registries/{registry_ident}

更新一个注册表。