estevaobk / 3scaledump

Unofficial tool for dumping a Red Hat 3scale On-premises project
2 stars 6 forks source link

Some logs require an administrator to be logged on OC in order to be fetched #13

Closed samugi closed 5 years ago

samugi commented 5 years ago

For example, status/node.txt may contain the following value: Error from server (Forbidden): nodes is forbidden: User "XXXX" cannot list nodes at the cluster scope: no RBAC policy matched

If the user XXXX does not have the right permission to access the requested details. It would probably be enough to mention in the README that you should be logged as system:admin prior to executing the script. Optionally we could also log something to the command line as a reminder.

estevaobk commented 5 years ago

Thank you Sam, I'll look into this today.

Maybe both is a good idea.

samugi commented 5 years ago

Yes probably logging it at the beginning of the output if a non-admin user is detected would be best (if possible). I would log it as a blocking message that requires confirmation to continue, something like "WARNING: you are running the script without the required privileges to obtain a full project dump, you should run the script as administrator, would you like to proceed anyway? y/N"

estevaobk commented 5 years ago

@samu91gn right now it was added on the end as a warning since it was the quickest method to address the issue but I've created https://github.com/estevaobk/3scaledump/issues/18 to follow it up.

Cheers.

estevaobk commented 5 years ago

Addressed half of the request on https://github.com/estevaobk/3scaledump/commit/49dfc64d549c10e90c1b77c26f69c6f942bc054d.

The other half will be addressed on https://github.com/estevaobk/3scaledump/issues/18.

Current behavior is to display a warning message in the end.

The KCS Article has also been updated with the section: Administrator (Recommended)