Skip to content

Commit

Permalink
Add "repair" BMC user
Browse files Browse the repository at this point in the history
Signed-off-by: morimoto-cybozu <kenji_morimoto@cybozu.co.jp>
  • Loading branch information
morimoto-cybozu committed Oct 26, 2023
1 parent 22ec0e8 commit e04ed6c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Add "repair" BMC user in [#96](https://github.com/cybozu-go/setup-hw/pull/96)
- **Breaking change:** This user is mandatory for iDRAC.

## [1.14.3] - 2023-08-15
- Disable "iDRAC path through I/F" in [#93](https://github.com/cybozu-go/setup-hw/pull/93)
- Factory setting has been changed that iDRAC path through I/F enabled, but it gives problem to neco setup.
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type Credentials struct {
// UserConfig represents a set of BMC user credentials in JSON format.
type UserConfig struct {
Root Credentials `json:"root"`
Repair Credentials `json:"repair"`
Power Credentials `json:"power"`
Support Credentials `json:"support"`
}
Expand Down
6 changes: 6 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ func TestUserConfig(t *testing.T) {
if uc.Root.Password.Salt != "593C31FF6D409480F032AA2FF6EC781E" {
t.Error("wrong root password salt")
}
if uc.Repair.Password.Hash != "78B13CF445B376D74BD1BEBA0B8802AD691D69483E752191D06D3C0AF362DAD8" {
t.Error("wrong repair password hash")
}
if uc.Repair.Password.Salt != "8E4934DDBEEE7C9AE9427A8283D7FA10" {
t.Error("wrong repair password salt")
}
if uc.Power.Password.Raw != "ranranran" {
t.Error("wrong power password")
}
Expand Down
7 changes: 5 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ This file contains credentials of BMC users.
BMC users are statically defined in `setup-hw` as follows:

* `root`: The administrator of BMC.
* `power`: Control power supply.
* `repair`: Restricted user who can execute repair operations, e.g. BMC reset.
* `power`: Restricted user who can control power supply.
* `support`: Read-only account.

All users are mandatory for iDRAC.

Credential types are:

* Raw password
* Hashed password with salt
For iDRAC, use [`idrac-passwd-hash`](../pkg/idrac-passwd-hash) tool to generate them.

Supported credential types varies by BMC types.
iDRAC, BMC embedded in Dell servers, supports all credential types.
iDRAC supports all credential types.

Example:

Expand Down
3 changes: 3 additions & 0 deletions pkg/setup-hw/dell.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ func (dc *dellConfigurator) configUsers(ctx context.Context) error {
if err := dc.configUser(ctx, "4", "power", "0x11", "3", dc.userConfig.Power); err != nil {
return err
}
if err := dc.configUser(ctx, "5", "repair", "0x13", "15", dc.userConfig.Repair); err != nil {
return err
}
return nil
}

Expand Down
6 changes: 6 additions & 0 deletions testdata/bmc-user.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"salt": "593C31FF6D409480F032AA2FF6EC781E"
}
},
"repair": {
"password": {
"hash": "78B13CF445B376D74BD1BEBA0B8802AD691D69483E752191D06D3C0AF362DAD8",
"salt": "8E4934DDBEEE7C9AE9427A8283D7FA10"
}
},
"power": {
"password": {
"raw": "ranranran"
Expand Down

0 comments on commit e04ed6c

Please sign in to comment.