Open lifeunexpected opened 6 years ago
I think the best way to handle this is to prevent the uploading of sensitive data on the client. To accomplish that, a filtering function could be build into the process
method inreportcommon
.
This would require that the admin puts filtering config on the clients that need it.
yes that would probably be even better since no unwanted or sensetive data ever leaves the client machine
Something changed in version 4.3.x so now the "unset($mylist['console_user']);" dont work anymore is it possible to add exceptions to what you want imported in the .env file or do you have to change it in the vendor --> MunkiReport --> Machine --> machine_model.php file like before ? I cant seem to figure out how to to it at least but i wanted to log less info them it set by default.
You could hack the submit script and set console_user
and long_username
to an empty string:
I have tried doing that with
Original report_info['console_user'] = "%s" % osutils.getconsoleuser() report_info['long_username'] = reportcommon.get_long_username(report_info['console_user'])
Modified: report_info['console_user'] = "" report_info['long_username'] = ""
But i must be doing something wrong or not doing it in the correct places.
The modules i am using is munkiinfo, munkireport, managedinstalls and the defualts modules that might always be active.
I looked in the folder munkireport-php/vendor/munkireport/machine and the sub files to see if i could understand what file i might need to modifie.
I also looked into https://github.com/munkireport/munkireport-php/tree/master/public/assets/client_installer - Postflight, preflight and submit.preflight without any luck with getting the information i want completely removed to be removed.
If you change the sources, you need to send a new package to your clients with the modified code. Or you could just send a patched file to your clients with Munki (which may be easier to do)
In munkireport v2 i managed to disable parts of the module "report data" and other modules that had parts i didnt want/need becuase of privacy concerns, but i v3 when i use the same method it causes a problem that clients cant connect.
Q: What are you trying to accomplish?
A: Not getting unwanted or not needed information into MunkiReport because of privacy concerns.
The way i used to do it in v2 was this way but that stopped working i v3 :confused: can i disable them in the config.php file? // $this->rs['console_user'] = ''; // $this->rs['long_username'] = ''; // $this->rs['remote_ip'] = '';
A user named tuxedo gave me this solution, but a supported solution built into MunkiReport-PHP would be better.
// Remove serial_number from mylist, use the cleaned serial that was provided in the constructor. unset($mylist['serial_number']);