Skip to content

Raise the session privilege on demand: privilege(MaximumAvailable), ipmicli -L auto - #195

Merged
bertysentry merged 2 commits into
mainfrom
194-raise-the-session-privilege-on-demand-run-at-user-raise-on-d4h-up-to-what-the-account-allows
Oct 18, 2026
Merged

bertysentry merged 2 commits into
mainfrom
194-raise-the-session-privilege-on-demand-run-at-user-raise-on-d4h-up-to-what-the-account-allows

Conversation

@bertysentry

Copy link
Copy Markdown
Contributor

Closes #194.

What changes

  • IpmiClient.Builder.privilege(PrivilegeLevel.MaximumAvailable) is accepted: the session logs in with the highest role the account is allowed (Administrator, then Operator and User when the BMC refuses the role at RAKP 2 with 0Ah/09h), is set to User right after the handshake, and is raised with Set Session Privilege Level only when the BMC refuses a command for insufficient privilege (D4h): to Operator, then to Administrator, and the refused command, which the BMC did not carry out, is sent again (even a send-once control command). A level the BMC refuses (80h, 81h, or anything else: a revoked session answers D4h to the raise too, HP iLO 4 answers Get SDR with InsufficientPrivilege (D4h) intermittently and the whole walk fails #146) is the ceiling of the session for its lifetime. A raw request whose D4h is returned, not thrown, is raised the same way.
  • In the protocol core, openSession() of a connection created with MaximumAvailable runs the login ladder and sets the session to User (some BMCs start it at the requested maximum, Low-level sessions stay at the User privilege on iDRAC, iLO 5, XCC and Cisco IMC: openSession() never sends Set Session Privilege Level #165); the SOL console still raises such a session itself.
  • ipmicli -L auto, with its own hint when the D4h comes at the ceiling of the account.
  • FakeRmcpPlusBmc: privilegeLimit(int) (unauthorized role at RAKP 2, 81h at Set Session Privilege Level), startsAtMaximum(boolean), sendMessagePrivilege(int), getPrivilege().
  • Documentation: configuration (new "Raising the session on demand" section), sensors, CLI, preparing the BMC, troubleshooting, upgrading, README.

Departure from the issue: no role 0h at login

The issue proposed requesting role 0h ("highest level matching proposed algorithms", IPMI 2.0 section 13.17) at Open Session and RAKP 1. Live on the lab it is unusable:

BMC Role 0h at login
HPE iLO 5, Dell iDRAC 8, Dell iDRAC F200, Cisco IMC, Cisco UCS C240 refused: Illegal or unrecognized parameter
GIGABYTE (AMI) refused: Invalid authentication algorithm
Dell iDRAC 6 refused: Invalid integrity check value
Lenovo IMM, Supermicro, NetApp HCI (Supermicro), Fujitsu iRMC, svp-pc login succeeds, then Set Session Privilege Level to any level answers D4h

So the login requests a concrete role, from Administrator down. On the Lenovo IMM, a session logged in at Administrator lowers to User (02), and a session logged in at User cannot be raised (81h): the session maximum is the login role, as the issue assumed.

Live results (2026-10-17, ipmicli standalone jar)

Check BMC Result
Login at -L auto, Get Session Info (raw 0x06 0x3d 0x00) Lenovo IMM, HPE iLO 5, Dell iDRAC 8, Supermicro, Fujitsu iRMC, GIGABYTE privilege byte 02 (User) on every one, including the BMCs that start the session at the requested maximum
Raise to Operator Lenovo IMM, identify 1 at -L auto OK
Raise to Administrator GIGABYTE, Send Message to the Intel ME at 2Ch on channel 6 sent raw: D4h at -L user and at -L operator 00h at -L auto (two raises)
sensors --long at -L user and -L auto GIGABYTE identical (its SDR has no sensor owned by another controller)

Not reproduced on real hardware: the role refusal at RAKP 2 (an account below Administrator). Every lab account, the iLO metricshub service account included, is Administrator, so that branch of the ladder, the 81h ceiling and the revoked-session case are covered by the fake BMC only (RmcpPlusSessionTest, IpmiClientTest, IpmiCliTest). A User-level lab account would let the ladder be checked live.

Build

mvn verify site passes (checkstyle, PMD, CPD at 100 tokens, SpotBugs, Javadoc). Two existing tests were adjusted for the new behaviour: the -L usage message, and the SOL test that counts the Set Session Privilege Level of a MaximumAvailable session (one more: the drop to User).

🤖 Generated with Claude Code

…pmicli -L auto

The builder accepts PrivilegeLevel.MaximumAvailable: the session logs in with
the highest role the account is allowed (Administrator, then Operator and User
when the BMC refuses the role), is set to User right after the handshake, and
is raised with Set Session Privilege Level only when the BMC refuses a command
for insufficient privilege (D4h), to Operator then Administrator, the refused
command being sent again. A level the BMC refuses is the ceiling of the session
for its lifetime, and a session the BMC revoked is asked once. A raw request
whose D4h is returned, not thrown, is raised the same way. ipmicli takes
-L auto, with its own hint at the ceiling.

The role 0h of the specification (highest level matching the proposed
algorithms) is not used: on the lab it is refused at Open Session by iLO 5,
iDRAC and Cisco IMC BMCs, and leaves a session that IMM, Supermicro and iRMC
BMCs will not set to any level (D4h on Set Session Privilege Level).

The fake BMC models the limit of the account (unauthorized role at RAKP 2,
81h at Set Session Privilege Level), a session started at its maximum, and
the privilege Send Message needs.

Closes #194

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T22:30:19.957342Z c1d7bca New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 968db1eba8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/java/org/metricshub/ipmi/client/IpmiClient.java
Comment thread src/main/java/org/metricshub/ipmi/client/IpmiClient.java
Comment thread src/main/java/org/metricshub/ipmi/client/IpmiClient.java
… no ceiling on a busy raise

Review of PR #195: the SOL console raises a MaximumAvailable session to
Operator before Administrator, as far as the account allows, and the client
records the level the console reached so that the next D4h is raised from
there. A Set Session Privilege Level the caller sends itself, typed or raw,
updates the level the client tracks. Only 80h, 81h and D4h on the raise set
the ceiling of the session: any other code is the failure of the raise,
thrown as such and tried again at the next D4h.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bertysentry
bertysentry merged commit 77e3a36 into main Oct 18, 2026
4 checks passed
@bertysentry
bertysentry deleted the 194-raise-the-session-privilege-on-demand-run-at-user-raise-on-d4h-up-to-what-the-account-allows branch October 18, 2026 21:32
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

Successfully merging this pull request may close these issues.

Raise the session privilege on demand: run at User, raise on D4h up to what the account allows

1 participant