启用和保护 Ceph API 模块
IBM Storage Ceph 仪表板模块通过 SSL 加密连接,为存储集群提供RESTful API访问功能。
重要提示: 若禁用 SSL ,用户名和密码将以明文形式发送至 IBM Storage Ceph 控制面板。
先决条件
对 Ceph Monitor 节点的根级别访问权。
确保至少有一个
ceph-mgr守护程序处于活动状态。若使用防火墙,请确保在运行活动
ceph-mgr守护进程的节点上,为 SSL 开放 TCP 端口8443,并为 TCP 开放 端口8080(不包含 SSL )。
过程
登录到 Cephadm shell:
示例
root@host01 ~]# cephadm shell启用 RESTful 插件:
[ceph: root@host01 /]# ceph mgr module enable dashboard配置 SSL 证书。
如果组织的认证中心 (CA) 提供了证书,请使用证书文件进行设置:
语法
ceph dashboard set-ssl-certificate HOST_NAME -i CERT_FILE ceph dashboard set-ssl-certificate-key HOST_NAME -i KEY_FILE示例
[ceph: root@host01 /]# ceph dashboard set-ssl-certificate -i dashboard.crt [ceph: root@host01 /]# ceph dashboard set-ssl-certificate-key -i dashboard.key如果要设置基于唯一节点的证书,请将 HOST_NAME 添加到命令中:
示例
[ceph: root@host01 /]# ceph dashboard set-ssl-certificate host01 -i dashboard.crt [ceph: root@host01 /]# ceph dashboard set-ssl-certificate-key host01 -i dashboard.key或者,您可以生成自签名证书。 然而,使用自签名证书并不能提供 HTTPS全部安全优势:
[ceph: root@host01 /]# ceph dashboard create-self-signed-cert警告: 大多数现代 Web 浏览器都会抱怨自签名证书,这要求您在建立安全连接之前进行确认。
创建用户,设置密码并设置角色:
语法
echo -n "PASSWORD" > PATH_TO_FILE/PASSWORDFILE ceph dashboard ac-user-create USERNAME -i PASSWORDFILE ROLE示例
[ceph: root@host01 /]# echo -n "p@ssw0rd" > /root/dash-password.txt [ceph: root@host01 /]# ceph dashboard ac-user-create user1 -i /root/dash-password.txt administrator此示例创建具有
administrator角色的名为user1的用户。连接到 RESTful 插件 Web 页面。 打开 Web 浏览器,并输入以下 URL:
语法
https://HOST_NAME:8443示例
https://host01:8443如果使用了自签名证书,请确认安全性异常。
参考
ceph dashboard --help 命令。
https://HOST_NAME:8443/doc页面,其中 HOST_NAME 是具有正在运行的ceph-mgr实例的节点的 IP 地址或名称。版本的安全加固指南 Red Hat Enterprise Linux 版本的安全加固指南,请访问 Red Hat Documentation。