Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate ManagerConsole and HostConsole access #15

Closed
gtmills opened this issue Sep 26, 2022 · 4 comments
Closed

Separate ManagerConsole and HostConsole access #15

gtmills opened this issue Sep 26, 2022 · 4 comments

Comments

@gtmills
Copy link
Member

gtmills commented Sep 26, 2022

Redfish has both ManagerConsole and HostConsole. OpenBMC only has 1 group for these "ssh"
In https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50835/ ssh was mapped to both ManagerConsole and HostConsole.

It makes sense these are different "can log into the BMC console" is different than "can log into the host console" and users could have one and not the other.

We should solve this before https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50965 goes in because switching would change behavior in a breaking way.

In IPMI, these are a difference between operator and admin roles.

https://github.com/openbmc/docs/blob/master/architecture/user-management.md#supported-group-roles

std::vector<std::string> groupsMgr = {"web", "redfish", "ipmi", "ssh"};

@ninadpalsule
Copy link
Contributor

@gtmills @ratagupt @rthomaiy Any plans to separate ssh into userGroup HostConsole and ManagerConsole? I am interested in getting the acountType PATCH support (https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50965) and this is a requite for PATCH. This is where the accountType split is discussed : https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50835. I think it is easiest to add new group named hostConsole and keep managerConsole mapped to ssh.

@joseph-reynolds
Copy link

joseph-reynolds commented Feb 15, 2023

Another wrinkle is that the SSH interface ssh -p 2200 someuser@${BMCIP} currently checks if the user is in the "priv-admin" group, which implicitly means only users who have the "admin" privilege role (aka the Redfish Administrator role) are allowed to SSH to the BMC. Once we have a proper hostconsole group, this could be changed.

And (if desired) to keep the same behavior when new users are created, the default for the Redfish AccountTypes property would be to add the "ssh" and "hostconsole" groups exactly when role=Administrator.
[Edit: shortened hostconsoleaccess to hostconsole.]

geissonator pushed a commit to openbmc/openbmc that referenced this issue Apr 21, 2023
The new pre-defined usergroup named "hostconsole" is added to
differentiate access between host console and manager console.
The only users allowed to interact with host console are part of the
"hostconsole" group.

This is a fixed is the github issue:
openbmc/phosphor-user-manager#15

In commit https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50835 ssh was
mapped to both ManagerConsole and HostConsole. The split is discussed
in the commit https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50835?tab=comments

Note: The changes are spread across multiple repositories listed under
"Related commits:"

The openbmc changes are as follows:
- Removed a dependency on dropbear.default file. Added a new environment
  file dropbear.env for obmc-console. If we want to add port specific
  configuration then we can add dropbear.%i.env file.
- The DROPBEAR_EXTRA_ARGS variable updated to include "-G hostconsole"
  flag.
- New update script added to add new hostconsole group and also add all
  users part of the priv-admin group to this new group.
- Similarly changes are made to add new group during install time and
  add root user in this group.

Tested:
  Loaded on system and qemu eumulator. Made sure that the only user
  can ssh to host console are member of hostconsole group.

Related commits:
  docs: https://gerrit.openbmc.org/c/openbmc/docs/+/60968
  phosphor-user-manager: https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/61583
  openbmc: https://gerrit.openbmc.org/c/openbmc/openbmc/+/61582
  obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/61581
  bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/61580

Change-Id: Icced48da188fb76828bf4ff5c705d6f1300ae3e7
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
@gtmills
Copy link
Member Author

gtmills commented May 22, 2023

This merged. Thanks @ninadpalsule !
I am going to close this.

@gtmills gtmills closed this as completed May 22, 2023
jamin-aspeed pushed a commit to AspeedTech-BMC/openbmc that referenced this issue Jun 29, 2023
The new pre-defined usergroup named "hostconsole" is added to
differentiate access between host console and manager console.
The only users allowed to interact with host console are part of the
"hostconsole" group.

This is a fixed is the github issue:
openbmc/phosphor-user-manager#15

In commit https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50835 ssh was
mapped to both ManagerConsole and HostConsole. The split is discussed
in the commit https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50835?tab=comments

Note: The changes are spread across multiple repositories listed under
"Related commits:"

The openbmc changes are as follows:
- Removed a dependency on dropbear.default file. Added a new environment
  file dropbear.env for obmc-console. If we want to add port specific
  configuration then we can add dropbear.%i.env file.
- The DROPBEAR_EXTRA_ARGS variable updated to include "-G hostconsole"
  flag.
- New update script added to add new hostconsole group and also add all
  users part of the priv-admin group to this new group.
- Similarly changes are made to add new group during install time and
  add root user in this group.

Tested:
  Loaded on system and qemu eumulator. Made sure that the only user
  can ssh to host console are member of hostconsole group.

Related commits:
  docs: https://gerrit.openbmc.org/c/openbmc/docs/+/60968
  phosphor-user-manager: https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/61583
  openbmc: https://gerrit.openbmc.org/c/openbmc/openbmc/+/61582
  obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/61581
  bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/61580

Change-Id: Icced48da188fb76828bf4ff5c705d6f1300ae3e7
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants