Re: Postconf and postmap in check_policy_service scripts

2021-07-02 Thread Matus UHLAR - fantomas
>>Matus UHLAR - fantomas: >>>I was curious if I could do a script that would do the same, with the same >>>possible issues. >>> >>>I can do perl, but it looks neither python nor perl have interface to postfix >>>what could e.g. expand maps without calling external commands. On 01.07.21 22:49,

Re: Postconf and postmap in check_policy_service scripts

2021-07-02 Thread Wietse Venema
Matus UHLAR - fantomas: > >>Matus UHLAR - fantomas: > >>>I was curious if I could do a script that would do the same, with the same > >>>possible issues. > >>> > >>>I can do perl, but it looks neither python nor perl have interface to > >>>postfix > >>>what could e.g. expand maps without calling

Re: Postconf and postmap in check_policy_service scripts

2021-07-02 Thread Matus UHLAR - fantomas
Matus UHLAR - fantomas: I was curious if I could do a script that would do the same, with the same possible issues. I can do perl, but it looks neither python nor perl have interface to postfix what could e.g. expand maps without calling external commands. On 01.07.21 22:49, Kevin N. wrote:

Re: Postconf and postmap in check_policy_service scripts

2021-07-01 Thread Kevin N.
Matus UHLAR - fantomas: I was curious if I could do a script that would do the same, with the same possible issues. I can do perl, but it looks neither python nor perl have interface to postfix what could e.g. expand maps without calling external commands. Among other things, it mainly acted

Re: Postconf and postmap in check_policy_service scripts

2021-07-01 Thread Wietse Venema
Matus UHLAR - fantomas: > I was curious if I could do a script that would do the same, with the same > possible issues. > > I can do perl, but it looks neither python nor perl have interface to postfix > what could e.g. expand maps without calling external commands. One solution is when the

Re: Postconf and postmap in check_policy_service scripts

2021-07-01 Thread Matus UHLAR - fantomas
This will limit scalability, but can work with low request rates. However, there is an inherent danger to using arbitrary email addresses from the internet in a shell command line. Depending on how the commands are run, there may be shell command injection opportunities when an email address

Re: Postconf and postmap in check_policy_service scripts

2021-07-01 Thread Kevin N.
Hi Viktor, Thank you for the suggestion. Are there any other general areas that I should be looking out for in this kind of situations? Cheers, K. It appears that some care has been taken to do it right. In principle something like this should be sufficient. You'll need to review the

Re: Postconf and postmap in check_policy_service scripts

2021-07-01 Thread Viktor Dukhovni
On Thu, Jul 01, 2021 at 02:18:06PM +0300, Kevin N. wrote: > From what I can see postconf and postmap are called using Python's > subprocess.Popen, like so: > > subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, >encoding='utf-8', shell=False) > >

Re: Postconf and postmap in check_policy_service scripts

2021-07-01 Thread Kevin N.
Hi Wietse, Thank you for the detailed explanation. This will limit scalability, but can work with low request rates. However, there is an inherent danger to using arbitrary email addresses from the internet in a shell command line. Depending on how the commands are run, there may be shell

Re: Postconf and postmap in check_policy_service scripts

2021-06-30 Thread Wietse Venema
Kevin N.: > Hello everybody, > > On one of our internal Postfix system I noticed that one of the > check_policy_service script is using postconf and postmap to perform > some alias lookups. It uses postconf to get the virtual_alias_maps > parameter, which is then used by postmap to perform the