Gate the script library on the grant that pushes scripts
The script library was gated on applications.*, so anyone holding the software-delivery grant could rewrite the bytes of a script that a separately trusted operator later pushed to a bay. The push was gated on endpoints.runscript; the CONTENT of what got pushed was not. An installer is a vendor artefact, but a script here is arbitrary PowerShell this site wrote that the agent runs as SYSTEM, so the write and the push must require the same trust. All six script routes now require endpoints.runscript, including the body download - reading the bytes is not a lesser act than listing them. Core names the permission as a string rather than importing it from the endpoints plugin so the module stays importable with the plugin absent. This tightens access and there is deliberately no backfill: the operator scope reaches applications.create/edit, so operator-scope holders lose the library. Granting them endpoints.runscript on upgrade would undo the change and hand every operator remote SYSTEM code execution, since the same grant gates the push. A test pins that no prebuilt scope confers it. Adds the System Scripts settings page and card. The route requires the permission rather than admin, because the grant is meant for non-admin operators and the sibling admin gate would lock them out of the library the grant exists for. The settings icon map gains terminal and key; the agent-key card had been asking for key since it shipped and silently drawing a puzzle piece. The library had no test coverage before this.
This commit is contained in:
@@ -320,6 +320,21 @@ class EndpointsPlugin(BasePlugin):
|
||||
'agent, and configure what it reports.',
|
||||
'position': 27,
|
||||
},
|
||||
# Its own card rather than a section of the agent key page: the
|
||||
# audience differs. Key management is admin-only, while the script
|
||||
# library is reachable by any endpoints.runscript holder, and
|
||||
# burying it under an admin page would hide it from exactly the
|
||||
# operators the grant exists for.
|
||||
{
|
||||
'group': 'Endpoints',
|
||||
'to': '/settings/endpoints/scripts',
|
||||
'icon': 'terminal',
|
||||
'title': 'System Scripts',
|
||||
'description': 'PowerShell the agent can run on an endpoint. '
|
||||
'Runs as SYSTEM; used to trigger scheduled '
|
||||
'tasks already registered on the endpoint.',
|
||||
'position': 28,
|
||||
},
|
||||
]
|
||||
|
||||
def get_navigation_items(self) -> List[Dict]:
|
||||
|
||||
Reference in New Issue
Block a user