LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2024, 04:03 AM   #1
dalacor
Member
 
Registered: Feb 2019
Distribution: Slackware
Posts: 173

Rep: Reputation: Disabled
slackpkg update gpg command tries to ping server


I have disabled icmp on my server as I don't need to ping anything and icmp does present a small security risk.

However, I have noticed that every time I run the slackpkg update gpg command to update Slackware, it always attempts to ping the site before failing and then allows me to update Slackware.

Is there anyway to disable the ping aspect of this command.
 
Old 05-10-2024, 04:26 AM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,854

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by dalacor View Post
I have disabled icmp on my server as I don't need to ping anything and icmp does present a small security risk.
What security risk? There will be a risk of networking problems if you have disabled destination unreachable or fragmentation needed ICMP packets.
Quote:
Originally Posted by dalacor View Post
I have noticed that every time I run the slackpkg update gpg command to update Slackware...
What do you mean by 'every time'? When you run slackpkg for the first time ever, it will download and install the gpg key automatically. You should not install it ever again.
Quote:
Is there anyway to disable the ping aspect of this command.
It's in /usr/libexec/slackpkg/core-functions.sh. Look for function get_gpg_key. Change the first line
Code:
        if ping -c 1 www.slackware.com &>/dev/null; then
to
Code:
        if true; then
 
Old 05-10-2024, 06:08 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,915

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
Some sites do have a policy of blocking icmp echo which could prevent what would have otherwise been a successful download from even being attempted.

Seems both overcomplicated and redundant. Why not just run:
gpg --fetch-keys "https://www.slackware.com/infra/keys/GPG-KEY"

... and then check the return value.
 
Old 05-11-2024, 05:12 AM   #4
dalacor
Member
 
Registered: Feb 2019
Distribution: Slackware
Posts: 173

Original Poster
Rep: Reputation: Disabled
I didn't realise that you only needed to run slackpkg update gpg once only. I just assumed that the key got updated periodically. If I don't need to run this command every time I update Slackware, then I am not worried about the ping issue - if this will only occur when I install Slackware for the first.

My current upgrade instructions are as follows:

Quote:
slackpkg update gpg
slackpkg update
slackpkg upgrade slackpkg
Then check mirrors and blacklist file as above as this will be reset.
slackpkg new-config

slackpkg update gpg
slackpkg update
slackpkg upgrade aaa_glibc-solibs

Reboot after this step, to make sure that everything after this is upgraded using the new aaa_glibc-solibs libraries. Then run update gpg and update again and then install-new

slackpkg install-new (You need to install new packages when upgrading existing packages if you are running Slackware current because sometimes upgraded packages on current need software)

slackpkg upgrade-all
Select O to overwrite all old files with new files. Slackware does show what files have been updated.

slackpkg clean-system

Then reboot Slackware.
I have always followed this religiously ever since I borked the system by not rebooting after updating aaa_glibc-solibs libraries. Once I have done all that, I then run the procedure again, but with the kernel updates allowed in the blacklist file to update kernel itself.

Why block/restrict/ icmp, dns and ntp connections?

https://www.paloaltonetworks.co.uk/c...-dns-tunneling

https://blogs.blackberry.com/en/2023...and-prevention

https://www.blackhillsinfosec.com/dn...cobalt-strike/

The above explain how dns can be abused by bad actors. Somewhere I saw similar articles for using ntp port 123 being abused by bad actors.
ICMP can technically be abused by bad actors as well. For me, the key thing is that I don't use ping for anything. The only thing that is blocked in the firewall is the ping for slackware update hence the question. Given that there are real world examples of abuse of dns and ntp open ports, it doesn't make any sense to open icmp ports if I don't even use icmp.

However, I will mark the question as solved because if I only have to run gpg update once when installing Slackware, then it's not an issue.
 
Old 05-11-2024, 05:28 AM   #5
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,854

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Yes, the Slackware Linux Project gpg key was created 2003-02-26 and it will expire 2038-01-19. There is no need to reinstall it before expiration.

About ICMP. It's not about you not wanting to use the ping command but ICMP is needed for the networking to operate. See, for example https://en.wikipedia.org/wiki/Path_MTU_Discovery.
 
Old 05-13-2024, 08:30 AM   #6
dalacor
Member
 
Registered: Feb 2019
Distribution: Slackware
Posts: 173

Original Poster
Rep: Reputation: Disabled
Thank you. I have updated my documentation to reflect that the key will only need to be updated in 2038 so only needs to be installed once when you install Slackware and run for the first time.

I don't know if the reason that I don't see the message is because it's considered part of an established session, but I don't see any dropped connections relating to icmp. However, it could just be because the server in question only accesses around a dozen or so websites mainly for updates. The only and single error message is the the gpg update issue.

I will look into the Path MTU Discovery issue. The initial search results indicate that this is more likely to be a problem with older technology and software. But I will research it properly when I have more time. However as I don't see any error messages in the firewall logs, I am not sure that this is an issue for this server.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware64 15.0 can't update slackpkg or update gpg key for slackpkg ccoffee Slackware 3 01-08-2023 04:48 PM
[SOLVED] I have run slackpkg update gpg instead of slackpkg update amikoyan Slackware 13 08-15-2021 02:12 AM
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 10:06 AM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration