【待评审】裸金属场景支持可信计算下的带内通道加固

背景

裸金属云环境,增加可信计算功能,使用了Host/BMC通信独立通道。裸金属场景作为业务面与管理面隔离的场景,需要保证带内外的通道隔离,防止Host侧基于此通道,发送管理命令来攻击并控制BMC。需要BMC支持通道使用白名单的方式控制数据流量, 仅处理Host侧过来的可信计算业务数据,丢弃其他访问数据

关联ISSUE

整体方案

评审点

新增Redfish属性以及资源协助接口属性,增强裸金属场景带内外通道数据保护能力

详细描述

评审点1:/redfish/v1/Managers/{manager_id}/SmsService 资源新增属性

资源URI:/redfish/v1/Managers/{manager_id}/SmsService
资源版本:hwsmsservice.v1_0_0.json

属性列表
注1 :列表内属性默认均支持GET 操作。
注2: 若属性在Schema中未显式定义 readonly 关键字,则默认为只读

属性名 类型 示例/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
VethFirewall Object Veth虚拟网卡的防火墙配置策略
Mode String Host可以对BMC的Veth网卡通信模式,枚举值:WhiteList / BlackList
WhiteList:仅允许WhiteListPorts中配置的端口访问
BlackList:允许不在BlackListPorts中配置的端口访问
false 读:ReadOnly
写:SecurityMgmt
用于设置Veth通道访问模式配置
WhiteListPorts array(元素类型:integer) 举例:[22,80,443]端口号的列表,取值范围1~65535,最多50个元素
为空时,所有端口禁止访问
false 读:ReadOnly
写:SecurityMgmt
用于设置Veth通道端口过滤规则是否使能
BlackListPorts array(元素类型:integer) 举例:[22,80,443]端口号的列表,取值范围1~65535,最多50个元素
为空时,所有端口均可访问
false 读:ReadOnly
写:SecurityMgmt
用于设置Veth通道端口过滤规则是否使能
HostCdevAllowedChannels string 枚举值:TPCM / ALL / NONE
TPCM: 仅允许Cdev通道的TPCM业务
ALL: 允许所有使用Cdev通道的业务
NONE: Cdev通道所有业务均不可用
false 读:ReadOnly
写:SecurityMgmt
用于设置Cdev通道使用场景

配置样例:

{
    "VethFirewall": {
        "Mode": "WhiteList",
        "WhiteListPorts": [22, 23, 443],
        "BlackListPorts": []
    },
    "HostCdevAllowedChannels": "TPCM"
}

Schema定义

{
    "VethFirewall": {
        "type": "object",
        "properties": {
            "Mode": {
                "type": "string",
                "enum": [
                    "WhiteList",
                    "BlackList"
                ],
                "readonly": false,
                "description": "The mode of the veth channel firewall."
            },
            "WhiteListPorts": {
                "type": "array",
                "items": {
                    "type": "integer"
                },
                "readonly": false,
                "description": "List of whitelist ports for the veth."
            },
            "BlackListPorts": {
                "type": "array",
                "items": {
                    "type": "integer"
                },
                "readonly": false,
                "description": "List of blacklist ports for the veth."
            }
        },
        "additionalProperties": false,
        "description": "Veth channel firewall config.",
        "longDescription": "Veth channel firewall config."
    },
    "HostCdevAllowedChannels": {
        "type": "string",
        "enum": [
            "TPCM",
            "ALL",
            "NONE"
        ],
        "readonly": false,
        "description": "The availabel scenario for cdev channel."
    }
}

裸金属场景:

CdevChannelEnabled: false
ChannelType: PCIe-Veth
VethDriverEnabled: true
VethFirewall:
    {
        Mode: "WhiteList",
        WhiteListPorts: [6666, 7777]
    }
HostCdevAllowedChannels: "TPCM"

非裸金属场景:

CdevChannelEnabled: true / false
ChannelType: PCIe-Veth / PCIe-Cdev / USB-Linux 
VethDriverEnabled: true / false
VethFirewall:
    {
        Mode: "BlackList",
        BlackListPorts: [ ]
    }
HostCdevAllowedChannels: "ALL"

评审结论

遗留问题