BlackArch / blackarch

An ArchLinux based distribution for penetration testers and security researchers.
https://www.blackarch.org
Other
2.78k stars 553 forks source link

PKGBUILD post install steps does not honor pacman proxy #3528

Open Szewcson opened 1 year ago

Szewcson commented 1 year ago

Type: Discussion

Discussion

Since blackarch repo relying not only on pacman but also on many other tools that downloading sources, keys etc., and not every of that tools honoring http_proxy/https_proxy flag maybe it is worth considering adding global flag that will work for whole toolchain? It will be great for users that want use blackarch template inside QubesOS like me, but also for every one who want use blackarch behind proxy.

noraj commented 1 year ago

I'm not sure what you mean here. Tools packaged on BlackArch repository can all be installed via pacman and pacman will follow you proxy (see. https://wiki.archlinux.org/title/Pacman#Pacman_does_not_honor_proxy_settings). If you talk about the BlackArch Linux distribution and not only the BlackArch repository it is as for any Linux operation system, it is composed of many components provided by various people, there the best you can do is use the standard proxy environment variable but of course not all softwares will honor it. It's impossible to provide an unified proxy interface that will work for everything. But since you are using Qubes OS the best you can do to achieve that is to configure a proxy on a network VM (this may help https://www.youtube.com/watch?v=a8YIVqaP8Lk).

Szewcson commented 1 year ago

My Idea was to be able to install/update all blackarch tools in blackarch template vm. Templet VMs on Qubes are by default not connected to internet, they are using QubesUpdateProxy to download updates and new packages. For Arch this proxy is defined for pacman. But when after downloading package using pacman, some post install script is run for downloading some python modules or ruby gems it fails to connect to internet since it don't know about the proxy. Of course I can write some aliases for that but I don't know how many tools is used in such scripts and also sometimes proxy option for some tools not work (like for PGP).

noraj commented 1 year ago

My Idea was to be able to install/update all blackarch tools in blackarch template vm. Templet VMs on Qubes are by default not connected to internet, they are using QubesUpdateProxy to download updates and new packages. For Arch this proxy is defined for pacman. But when after downloading package using pacman, some post install script is run for downloading some python modules or ruby gems it fails to connect to internet since it don't know about the proxy.

Yeah packages with complex dependencies like some python or ruby tools will use a virtual environment and install dependencies in it. maybe everything should occur in build() and package().

Here is an example of how AL does for metasploit https://github.com/archlinux/svntogit-community/blob/packages/metasploit/trunk/PKGBUILD

also sometimes proxy option for some tools not work (like for PGP)

See the mention about dirmngr for PGP.

https://wiki.archlinux.org/title/Pacman#Pacman_does_not_honor_proxy_settings