【已评审】redfish接口支持支持用户或VNC密码校验

背景

现网进行客户定制时需要设置密码等敏感信息,设置完成后需要校验敏感信息是否与之前设置的一致。
涉及范围:本地用户密码、VNC密码
要求:仅支持管理员用户调用,需要进行二次鉴权

关联ISSUE

支持BMC用户密码校验
支持VNC密码校验

评审点

  1. 新增用户密码校验redfish接口/redfish/v1/AccountService/Accounts/:accountid/Actions/Oem/{{OemIdentifier}}/ManagerAccount.VerifyPassword
  2. 新增VNC密码校验redfish接口/redfish/v1/Managers/:managerid/VncService/Actions/VncService.VerifyPassword
  3. 资源协作接口bmc.kepler.AccountService.ManagerAccount新增方法VerifyPassword

详细描述

评审点1:新增用户密码校验redfish接口

资源URI :/redfish/v1/AccountService/Accounts/:accountid/Actions/Oem/{{OemIdentifier}}/ManagerAccount.VerifyPassword
资源版本 :openUBMCManagerAccount.v1_11_0
命令类型:POST
变化类型:新增接口
操作权限 :UserMgmt
应用场景:管理员校验用户密码
请求参数 :

属性名 类型 示例/取值约束 readonly 易变属性 实现patch 操作权限 描述
Password String 密码字符串(长度0到512字节) 否 否 否 UserMgmt 待校验的密码
SessionAccountPassword String 当前会话密码字符串(长度0到512字节) 否 否 否 UserMgmt 当前会话密码,用于二次鉴权

ActionInfo: /redfish/v1/AccountService/Accounts/:accountid/VerifyPasswordActionInfo

{
  "@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo",
  "@odata.id": "/redfish/v1/AccountService/Accounts/${Uri/accountid}/VerifyPasswordActionInfo",
  "@odata.type": "#ActionInfo.v1_0_1.ActionInfo",
  "Id": "VerifyPasswordActionInfo",
  "Name": "Verify Password Action Info",
  "Parameters": [{
        "Name": "Password", 
        "Required": true,
        "DataType": "string",
        "Sensitive": true
        "MaxLength": 512
    },
    {
      "Name": "SessionAccountPassword",
      "Required": true,
      "DataType": "string",
      "Sensitive": true,
      "MaxLength": 512
    }]
}

校验成功响应体:

{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "iBMC.1.0.VerifyPasswordSuccess",
        "RelatedProperties": [
          "#/ManagerAccount.VerifyPassword"
        ],
        "Message": "Password Verify successfully.",
        "MessageArgs": [],
        "Severity": "OK",
        "Resolution": "None"
      }
    ]
  }
}

校验密码失败响应体:

{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "Base.1.0.ActionParameterValueError",
        "Message": "The value for the parameter 'Password' in the action 'VerifyPassword' is invalid.",
        "Severity": "Warning",
        "Resolution": "Correct the value for the parameter in the request body and resubmit the request if the operation failed.",
        "RelatedProperties": ["#/Password"]
      }
    ]
  }
}

Schema定义 :

{
    "definitions": {
        "VerifyPassword": {
            "patternProperties": {
                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
                    "type": [
                        "array",
                        "boolean",
                        "number",
                        "null",
                        "object",
                        "string"
                    ],
                    "description": "This property shall specify a valid odata or Redfish property."
                }
            },
            "type": "object",
            "parameters": {
                "Password": {
                    "requiredParameter": true,
                    "type": "string"
                },
                "SessionAccountPassword":{
                    "requiredParameter": true,
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "properties": {
                "title": {
                    "type": "string",
                    "description": "Friendly action name"
                },
                "target": {
                    "type": "string",
                    "format": "uri",
                    "description": "Link to invoke action"
                },
                "@Redfish.ActionInfo": {
                    "description": "The term can be applied to an action to specify a URI to an ActionInfo resource that describes the parameters supported by this instance of the action.",
                    "type": "string",
                    "format": "uri-reference",
                    "readonly": true
                }
            },
            "description": "This action is used to verify user password.",
            "longDescription": "This action is used to verify user password."

        },
        "{{OemIdentifier}}Actions": {
            "type": "object",
            "patternProperties": {
                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
                    "type": [
                        "array",
                        "boolean",
                        "number",
                        "null",
                        "object",
                        "string"
                    ],
                    "description": "This property shall specify a valid odata or Redfish property."
                }
            },
            "additionalProperties": false,
            "properties": {
                "#ManagerAccount.VerifyPassword": {
                    "$ref": "#/definitions/VerifyPassword"
                }
            },
            "readonly": true
        }
    }
}

评审点2:新增VNC密码校验redfish接口

资源URI :/redfish/v1/Managers/:managerid/VncService/Actions/VncService.VerifyPassword
资源版本 :HwVncService.v1_0_0
变化类型:新增接口
命令类型:POST
操作权限 :UserMgmt
应用场景:管理员校验VNC密码
请求参数 :

属性名 类型 示例/取值约束 readonly 易变属性 实现patch 操作权限 描述
Password String 密码字符串(长度0到512字节) 否 否 否 UserMgmt 待校验的密码
SessionAccountPassword String 当前会话密码字符串(长度0到512字节) 否 否 否 UserMgmt 当前会话密码,用于二次鉴权

ActionInfo:/redfish/v1/Managers/:managerid/VncService/VerifyPasswordActionInfo

"Type": "GET",
"RspBody": {
  "@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo",
  "@odata.id": "/redfish/v1/Managers/${Uri/managerid}/VncService/VerifyPasswordActionInfo", 
  "@odata.type": "#ActionInfo.v1_0_1.ActionInfo",
  "Id": "VerifyPasswordActionInfo",
  "Name": "Verify VNC Password Action Info",
  "Parameters": [{
        "Name": "Password", 
        "Required": true,
        "DataType": "string",
        "Sensitive": true,
        "MaxLength": 8
    },
    {
      "Name": "SessionAccountPassword",
      "Required": true,
      "DataType": "string",
      "Sensitive": true,
      "MaxLength": 512
    }],
}

校验成功响应体:

{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "iBMC.1.0.VerifyPasswordSuccess",
        "RelatedProperties": [
          "#/VncService.VerifyPassword"
        ],
        "Message": "Password Verify successfully.",
        "MessageArgs": [],
        "Severity": "OK",
        "Resolution": "None"
      }
    ]
  }
}

校验密码失败响应体:(与用户密码/BIOS密码校验保持一致)

{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "Base.1.0.ActionParameterValueError",
        "Message": "The value for the parameter 'Password' in the action 'VerifyPassword' is invalid.",
        "Severity": "Warning",
        "Resolution": "Correct the value for the parameter in the request body and resubmit the request if the operation failed.",
        "RelatedProperties": ["#/Password"]
      }
    ]
  }
}

Schema定义 :

{
    "definitions": {
        "VerifyPassword": {
            "patternProperties": {
                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
                    "type": [
                        "array",
                        "boolean",
                        "number",
                        "null",
                        "object",
                        "string"
                    ],
                    "description": "This property shall specify a valid odata or Redfish property."
                }
            },
            "type": "object",
            "parameters": {
                "Password": {
                    "requiredParameter": true,
                    "type": "string"
                },
                "SessionAccountPassword":{
                    "requiredParameter": true,
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "properties": {
                "title": {
                    "type": "string",
                    "description": "Friendly action name"
                },
                "target": {
                    "type": "string",
                    "format": "uri",
                    "description": "Link to invoke action"
                },
                "@Redfish.ActionInfo": {
                    "description": "The term can be applied to an action to specify a URI to an ActionInfo resource that describes the parameters supported by this instance of the action.",
                    "type": "string",
                    "format": "uri-reference",
                    "readonly": true
                }
            },
            "description": "This action is used to verify VNC password.",
            "longDescription": "This action is used to verify VNC password."

        },
        "{{OemIdentifier}}Actions": {
            "type": "object",
            "patternProperties": {
                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
                    "type": [
                        "array",
                        "boolean",
                        "number",
                        "null",
                        "object",
                        "string"
                    ],
                    "description": "This property shall specify a valid odata or Redfish property."
                }
            },
            "additionalProperties": false,
            "properties": {
                "#VncService.VerifyPassword": {
                    "$ref": "#/definitions/VerifyPassword"
                }
            },
            "readonly": true
        }
    }
}

评审点3 资源协作接口bmc.kepler.AccountService.ManagerAccount新增方法VerifyPassword

资源path: /bmc/kepler/AccountService/Accounts/:ManagerAccountId
资源Interface: bmc.kepler.AccountService.ManagerAccount
变化类型: 新增方法
方法描述:

方法名称 请求签名 请求参数描述 响应签名 响应参数描述 方法描述 | 访问权限
VerifyPassword s Password: 表示需要校验的密码串 - - 验证用户密码 - UserMgmt

JSON定义:

"bmc.kepler.AccountService.ManagerAccount": {
	"VerifyPassword": {
		"privilege": ["UserMgmt"],
		"req": {
			"Password": {
				"baseType": "String",
				"description": "需要验证的密码"
			}
		},
		"rsp": {},
		"description": "提供密码校验能力"
	}
}

是否准备好AI预审

是

评审结论

同意新增接口:

  1. 用户密码校验redfish接口/redfish/v1/AccountService/Accounts/:accountid/Actions/Oem/{{OemIdentifier}}/ManagerAccount.VerifyPassword
    命令类型:POST,操作权限 :UserMgmt,入参:Password 和 SessionAccountPassword,
    新增标准错误码:ActionParameterValueError,用于密码校验错误场景返回
  2. 新增VNC密码校验redfish接口/redfish/v1/Managers/:managerid/VncService/Actions/VncService.VerifyPassword
    命令类型:POST,操作权限 :UserMgmt,入参:Password 和 SessionAccountPassword,
  3. 资源协作接口bmc.kepler.AccountService.ManagerAccount新增方法VerifyPassword
    操作权限 :UserMgmt,入参:Password

遗留问题

SessionAccountPassword描述修改“当前会话密码,用于二次鉴权” – OK
资源协作接口入参长度描述补充 – OK
资源协作接口补充description – OK
资源协作接口去掉斜体 – OK
schema定义补充 – OK
补充错误码描述(400错误码)-- OK

预审答案内容由AI生成,仅供参考:

帖子评审结论:【待评审】redfish接口支持支持用户或VNC密码校验

帖子相关性:相关(Redfish 相关: 帖子内容包含 ‘redfish’ 关键字)

  • 总评审点数:3
  • MDB 资源协作接口评审点:1
  • Redfish 相关评审点:2
  • 其他评审点:0

总体结果:不通过(1/3 个评审点通过)

评审点 1:新增用户密码校验redfish接口/redfish/v1/AccountService/Accounts/:accountid/Actions/Oem/{{OemIdentifier}}/Account.VerifyPassword【Redfish】

结果:不通过

  • URI 示例生成:通过
  • Schema 验证:通过(5 项通过)
    • Schema 来源:DMTF ✓,OEM ✗(实际参与校验:DMTF)
    • 入口 schema 文件:dmtf/ActionInfo.v1_0_1.json(DMTF 官方 schema(SchemaFiles/dmtf))
    • Schema 依据:静态校验直接依据:DMTF 官方 schema(SchemaFiles/dmtf)(dmtf/ActionInfo.v1_0_1.json)
  • 规则合规性检查:不通过(1/18 项失败)
    • 规则合规性失败项(必须项):
      规则ID:RULE-001
      级别:必须项
      问题描述:发现 DataType 属性值使用了大写的 “String”,Redfish 原始类型名必须使用小写形式
      处理建议:将 Parameters 数组中的 “DataType”: “String” 修改为 “DataType”: “string”,Redfish 原始类型名(string、boolean、integer、number、array、object、null)必须使用小写形式

评审点 2:新增VNC密码校验redfish接口/redfish/v1/Managers/:managerid/VncService/Actions/VncService.VerifyPassword【Redfish】

结果:通过

  • URI 示例生成:通过
  • Schema 验证:通过(5 项通过)
    • Schema 来源:DMTF ✓,OEM ✗(实际参与校验:DMTF)
    • 入口 schema 文件:dmtf/ActionInfo.v1_0_1.json(DMTF 官方 schema(SchemaFiles/dmtf))
    • Schema 依据:静态校验直接依据:DMTF 官方 schema(SchemaFiles/dmtf)(dmtf/ActionInfo.v1_0_1.json)
  • 规则合规性检查:通过(18 项检查全部通过)

评审点 3:新增资源协作接口VerifyPassword【MDB】

结果:不通过

  • 规则合规性检查:不通过(3/26 项失败)
    • 规则合规性失败项(必须项):
      规则ID:MDB-REVIEW-002
      级别:必须项
      问题描述:新增接口评审点正文为空,缺少能力描述、消费方/场景、变更原因和影响说明,导致无法判断接口必要性、契约边界及影响范围。
      处理建议:请补充接口 VerifyPassword 的能力描述、使用场景/消费方、变更原因以及接口影响说明(如北向影响、持久化影响、兼容性等),确保评审信息完整。

      规则ID:MDB-NAMING-005
      级别:必须项
      问题描述:接口名 VerifyPassword 缺少 bmc. 前缀,且层级不足,无法判断领域或资源归属。
      处理建议:建议修改接口名,增加 bmc. 前缀及领域层级,例如 bmc.Auth 或 bmc.UserManagement,VerifyPassword 更适合作为该接口下的方法名。

      规则ID:MDB-METHOD-016
      级别:必须项
      问题描述:标题声明新增方法 VerifyPassword,但正文为空,缺少方法名称、请求/响应签名、方法描述、访问权限等必要信息。
      处理建议:请在正文中补充方法定义表,包含方法名称、请求签名、响应签名、方法描述、访问权限等必要字段。

    • 警告项(建议性):
      规则ID:MDB-RISK-004
      级别:建议性
      问题描述:VerifyPassword 接口属于认证/授权强触发场景,但正文未说明权限控制、防误操作、审计日志等风险控制措施
      处理建议:severity=‘should’ 建议性规则,建议修改以提升规范符合性

      规则ID:MDB-NAMING-007
      级别:建议性
      问题描述:接口名 VerifyPassword 使用动宾结构,不符合资源协作接口通常采用名词体现资源实体的命名惯例。
      处理建议:severity=‘should’ 建议性规则,建议修改以提升规范符合性