Skip to content

rgw/sts: log trust-policy denials with request prefix - #72336

Merged
anrao19 merged 1 commit into
ceph:mainfrom
kchheda3:wip-rgw-sts-log-req-prefix
Nov 3, 2026
Merged

anrao19 merged 1 commit into
ceph:mainfrom
kchheda3:wip-rgw-sts-log-req-prefix

Conversation

@kchheda3

@kchheda3 kchheda3 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

The trust-policy deny/pass messages in RGWSTSAssumeRole::verify_permission() and RGWSTSAssumeRoleWithWebIdentity::verify_permission() were logged with ldout(), so they carry no req <id> prefix. When a request authenticates successfully and is then denied by the role's trust policy, searching the logs by request id shows the authentication but not the denial, and the 403 looks unexplained.

Switch the four ldout(s->cct, 0) calls to ldpp_dout(this, 0), matching the neighbouring error paths in the same functions. Log-only change; no behaviour change.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

The deny/pass messages in RGWSTSAssumeRole::verify_permission() and
RGWSTSAssumeRoleWithWebIdentity::verify_permission() used ldout(), so
they lacked the "req <id>" prefix and could not be correlated with the
rest of the request's log lines. An authenticated request that is then
rejected by the role's trust policy looked like an unexplained 403.
Use ldpp_dout(this, ...) like the surrounding error paths.

Signed-off-by: Krunal Chheda <[email protected]>
@kchheda3
kchheda3 requested a review from a team as a code owner October 2, 2026 15:45
@github-actions github-actions Bot added the rgw label Oct 2, 2026

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good change, but they probably shouldn't be at log level 0

@kchheda3

kchheda3 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

good change, but they probably shouldn't be at log level 0

errors have been logged at 0 at lot of places ?

@cbodley

cbodley commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

errors have been logged at 0 at lot of places ?

true, but the question is whether an admin needs to see the message by default in their rgw log. log levels 0 and 1 should only be used for errors that may need admin intervention. some auth errors may indicate a broken configuration in rgw. but here, we're just rejecting a request based on iam policy which is under the control of the end user/account. we return that http error to the client, so there's no need to escalate this to a cluster admin. if an admin wants to help a user understand why this is failing, they can raise the log level for debugging

@kchheda3

kchheda3 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

errors have been logged at 0 at lot of places ?

true, but the question is whether an admin needs to see the message by default in their rgw log. log levels 0 and 1 should only be used for errors that may need admin intervention. some auth errors may indicate a broken configuration in rgw. but here, we're just rejecting a request based on iam policy which is under the control of the end user/account. we return that http error to the client, so there's no need to escalate this to a cluster admin. if an admin wants to help a user understand why this is failing, they can raise the log level for debugging

fair point on distinguishing between admin errors and client specific errors
but problem is if user sets the policy in-correct, assumerole response does not say anything about permission denied, and then clients rely on admin for checking logs and getting back, so its easier to trace in event of errors.
Since these errors are just single line error and not meant to spam the logs, i think it can be at 0 or 1 ?

@anrao19

anrao19 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-10-16-04:47.

@anrao19

anrao19 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-10-16-04:47.

pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/81818.
@kchheda3, if no further testing is needed then this pr can be merged

@anrao19
anrao19 merged commit 8fbdc0f into ceph:main Nov 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants