JoaoJandre commented on PR #13935:
URL: https://github.com/apache/cloudstack/pull/13935#issuecomment-6988266670
> @JoaoJandre I tested this on a KVM lab (Oracle Linux 9, advanced zone)
with KBOSS, first on 24.0 without this PR, then the PR packages. The agent
package installs `guestfs-tools` and `libguestfs` on the hosts by itself, and
listing file systems and files, downloading a file, a folder and a symlink, the
"Browse backup files" tab and KBOSS backup/restore all work for the root admin.
Bad paths and an offering without `allowextractfile` are refused on download.
>
> Two questions:
>
> 1. Which roles should be able to use this? With the PR packages,
`listBackupFilesystems`, `listBackupFiles` and `downloadBackupFile` are only in
the root admin's `listApis`. For a user and a domain admin they are not listed
and the call gives "unknown command", while `createBackup`, `listBackups` and
`restoreBackup` are listed for both. Is the feature meant to be root admin
only, or should users be able to get files back from their own VM backups?
>
> 2. What exactly should `allowextractfile` control? On a KBOSS backup
whose offering does not have `allowextractfile`, `downloadBackupFile` is
refused ("... as its backup offering does not allow it."), but
`listBackupFilesystems` and `listBackupFiles` still list the contents (for
example the file names under `/root`), and the backup shows `browsable: true`,
so the "Browse backup files" tab is offered for it too. Is listing meant to be
allowed without the setting, with only the download blocked?
>
>
> Also noticed:
>
> * `listBackupFiles` returns all entries whatever `keyword`, `page` and
`pagesize` are set to (for example `keyword=host` on `/etc` returns all 218
entries).
>
> * A missing folder or file, or bad input, gives "Unable to
list/download files of backup [...]. Please check the logs."
>
>
> Thanks!
@RosiKyu Regarding your first question, these APIs were not included in the
default roles, but custom roles can add permission for the APIs. Regarding your
second question, you got it correctly, you can list the filesystems/files of a
backup regardless of the configuration, but you cannot download a file unless
the offering allows it, this is intended.
For the page, pagesize and keyword, I believe these parameters should not be
available in these APIs. Since guestfish does not support pagination, we would
have to get everything from the backup anyway and filter it inside ACS. I will
remove these parameters from these two APIs.
For your last note, could you give me an example (with reproducible steps)
of when does this happen?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]