Skip to content

Commit

Permalink
Disable authorization check for system.hostname (#15451)
Browse files Browse the repository at this point in the history
Midcli and potentially other tools check system.hostname and
will fail in STIG mode or when credential doesn't have
FULL_ADMIN RBAC role. This commit changes the endpoint so
that any authenticated session can request the system
hostname.
  • Loading branch information
anodos325 authored Jan 21, 2025
1 parent f8ae8c8 commit 21b2b89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/middlewared/middlewared/plugins/system/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import datetime, timedelta, timezone

from middlewared.schema import accepts, Bool, Datetime, Dict, Float, Int, List, returns, Str
from middlewared.service import private, Service
from middlewared.service import no_authz_required, private, Service
from middlewared.utils import sw_buildtime
from middlewared.utils.cpu import cpu_info

Expand Down Expand Up @@ -51,6 +51,7 @@ async def time_info(self):
}

@private
@no_authz_required
@accepts()
@returns(Str('hostname'))
async def hostname(self):
Expand Down

0 comments on commit 21b2b89

Please sign in to comment.