Skip to Content.
Sympa Menu

perfsonar-user - Re: [perfsonar-user] memcached and firewall rules

Subject: perfSONAR User Q&A and Other Discussion

List archive

Re: [perfsonar-user] memcached and firewall rules


Chronological Thread 
  • From: Hervey Allen <>
  • To: Andrew Lake <>, Hans Kuhn <>
  • Cc:
  • Subject: Re: [perfsonar-user] memcached and firewall rules
  • Date: Mon, 12 Feb 2018 09:52:27 -0800
  • Ironport-phdr: 9a23:Gvj+9xcjII881us1+QbKH1v0lGMj4u6mDksu8pMizoh2WeGdxcW+ZB7h7PlgxGXEQZ/co6odzbaO6ua4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahfL9+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v9LlgRgP2hygbNj456GDXhdJ2jKJHuxKquhhzz5fJbI2JKPZye6XQds4YS2VcRMZcTzFPDJ2yb4UPCOoPPuhWoIfyqFQMsRSwChKhBP/2yjJSmnP6waM33uYnHArb3AIgBdUOsHHModv3KqgSS/61w7fIzD7ec/5W3TP955bOchs8pvyMXax/cdDPyUYxFwLIlVOQqZf/PzyJzOgNtHKb7+V5WO+plmUppQZxoj21ycctjInEnoQVykve9Spl2oo1Ise4SEFjbd68DpRQrS+aN5BxQsMkWW5oojw2yrsYtp6nZCQKx5UnxwLfa/yaaIeE+A7sVOGUITtginJqYq6wiAip/kinze38VdO430pNripAlNTHq3MD1wTL58SaVPdw/V2t1SiR2w3d8O1IPEA5mKjBJ5I83rI8joQfvEXfEiL0nUj7j6Cbelk49uWt9ejrfqjqqoOZOoNqjwzxLrghltGlDuk9LwcDXWeW+eq52b3t/UD1XbdHg/gsnaTdrZzXI9kQqLSjDA9PyIkj7g6yDze439QcmnkKNFdFdwiGj4jtIV3OJuv4De2jjFi2lzdr3f/GMqXgApXLMHfDjK/scatj50Nf0gY/085T6pxOBr0cIP/+WFX9uMHEAhMhNgy72efnCNFz1oMEXmKPB7eUMKPMvl+S+OIgPemNaZQTuDbmMfgq++TijXgjmV8SZaWpx4cYaGikHvR6JEWUeWLsjckbEWcEpQo+S+rqh0eYUTJKenayRLwz5isgBYKiDIfDXZytgKef0CuhH51WYHxGBU6WEXfuaYqER+kAZDiMLcB8jzxXHYSmHqYn2Qujq0fewrlqZr7d/CEJnZ/4kt54+7uX3TE78yc8LNmd1SnZT2hyhUsOXCU9mqdlrhou5E2E1P1YjuZGGM0bzvdNXwFyYZ7R1fJ3Gvj0QRjKONCTRwD1EZ2dHTgtQ4dpkJc1aEFnFoDn10ib0g==
  • Organization: Network Startup Resource Center

On 2/12/18 6:21 AM, Andrew Lake wrote:
> Hi,
>
> I created an issue here: https://github.com/perfsonar/project/issues/1193
>

Thanks Andy.

> I understood the original email to say that it was expected this is
> already happening, which it is not. I agree it would be more complete to
> have it listen on localhost only and not solely rely on the firewall to
> block the port.
>

Yes. I agree. To note, in /etc/sysconfig/memcached

If you add:

OPTIONS="-l 127.0.0.1,::1"

at the bottom of the file this will bind the daemon to localhost for
both ipv4 and ipv6. But, if you don't want the daemon to listen at all
on v6, then you just do:

OPTIONS="-l 127.0.0.1"

I actually could not find a v4 and v6 example, so guessed at the syntax.

- Hervey

> Thanks,
> Andy
>
>
>
> On February 9, 2018 at 5:29:20 PM, Hervey Allen
> (
> <mailto:>)
> wrote:
>
>> On 2/9/18 11:40 AM, Hans Kuhn wrote:
>> > Hi Andrew,
>> >
>> > I agree that the correct solution security-wise is to bind memcached to
>> > localhost.
>> >
>> > It appears the upstream package maintainer’s default for memcached is
>> > currently being used, and that perfsonar would need to modify
>> > /etc/sysconfig/memcached after installation to bind memcached to
>> > localhost.
>> >
>> > Is there a way to submit a feature request to make this the default for
>> > the perfsonar-testpoint bundle?
>> >
>> > thanks, Hans
>> >
>>
>> I was thinking of submitting this too the developer list and see what
>> people say.
>>
>> I use netstat -ltu to see the open port.
>>
>> - Hervey
>>
>> > On 9 Feb 2018, at 11:06, Andrew Lake wrote:
>> >
>> >> Hi,
>> >>
>> >> Updating the firewall is not going to change where any services listens,
>> >> but if anything tries to connect, the firewall will not allow it
>> >> through.
>> >> Using netstat locally (which I am guessing is the output you shared)
>> >> is not
>> >> going to tell you anything about what the firewall allows through.
>> >> Running
>> >> something like "firewall-cmd --list-all” will show you your firewall
>> >> rules.
>> >>
>> >> Thanks,
>> >> Andy
>> >>
>> >>
>> >>
>> >> On February 9, 2018 at 1:42:42 PM, Hervey Allen
>> >> (
>> >>
>> >> <mailto:>)
>> >> wrote:
>> >>
>> >> On 2/9/18 6:18 AM, Andrew Lake wrote:
>> >>> Hi,
>> >>>
>> >>> The only things that needs access to memcached comes from localhost.
>> >>> The
>> >>> esmond archiving plugin in pscheduler uses it as a cache between
>> >>> archiving processes to speed-up some requests. You can safely block it.
>> >>>
>> >>> For a list of the ports that need to be open
>> >>> see http://docs.perfsonar.net/manage_security.html. If you would like a
>> >>> default set of firewall rules installed for you run ‘yum install
>> >>> perfsonar-toolkit-security’ on your testpoint which will setup rules on
>> >>> the host that only allow the listed ports through.
>> >>>
>> >>> Hope that helps,
>> >>> Andy
>> >>>
>> >>
>> >> I thought I'd give a quick update.
>> >>
>> >> I had installed the perfSONAR Testpoint bundle but had not done:
>> >>
>> >> # yum install perfsonar-toolkit-security
>> >>
>> >> nor
>> >>
>> >> /usr/lib/perfsonar/scripts/configure_firewall install
>> >>
>> >> Before doing either here is what listening services looked like:
>> >>
>> >> Proto Recv-Q Send-Q Local Address Foreign Address State
>> >> tcp 0 0 0.0.0.0:memcache 0.0.0.0:* LISTEN
>> >> tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
>> >> tcp 0 0 localhost:postgres 0.0.0.0:* LISTEN
>> >> tcp6 0 0 [::]:owamp-control [::]:* LISTEN
>> >> tcp6 0 0 [::]:memcache [::]:* LISTEN
>> >> tcp6 0 0 [::]:ssh [::]:* LISTEN
>> >> tcp6 0 0 [::]:4823 [::]:* LISTEN
>> >> udp 0 0 0.0.0.0:memcache 0.0.0.0:*
>> >> udp6 0 0 [::]:memcache [::]:*
>> >>
>> >> After doing both and restarting firewalld:
>> >>
>> >> # systemctl restart firewalld
>> >>
>> >> I'm still seeing:
>> >>
>> >> tcp 0 0 0.0.0.0:memcache 0.0.0.0:* LISTEN
>> >> tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
>> >> tcp 0 0 localhost:postgres 0.0.0.0:* LISTEN
>> >> tcp6 0 0 [::]:owamp-control [::]:* LISTEN
>> >> tcp6 0 0 [::]:memcache [::]:* LISTEN
>> >> tcp6 0 0 [::]:ssh [::]:* LISTEN
>> >> tcp6 0 0 [::]:4823 [::]:* LISTEN
>> >> udp 0 0 0.0.0.0:memcache 0.0.0.0:*
>> >> udp6 0 0 [::]:memcache [::]:*
>> >>
>> >> Or, more specifically:
>> >>
>> >> tcp 0 0 0.0.0.0:memcache 0.0.0.0:* LISTEN
>> >> tcp6 0 0 [::]:memcache [::]:* LISTEN
>> >> udp 0 0 0.0.0.0:memcache 0.0.0.0:*
>> >> udp6 0 0 [::]:memcache [::]:*
>> >>
>> >> For the moment my fix is to edit:
>> >>
>> >> /etc/sysconfig/memcached
>> >>
>> >> And change the default configuration of:
>> >>
>> >> PORT="11211"
>> >> USER="memcached"
>> >> MAXCONN="1024"
>> >> CACHESIZE="64"
>> >> OPTIONS=""
>> >>
>> >> to:
>> >>
>> >> PORT="11211"
>> >> USER="memcached"
>> >> MAXCONN="1024"
>> >> CACHESIZE="64"
>> >> OPTIONS="-l 127.0.0.1,::1"
>> >>
>> >> After doing:
>> >>
>> >> # systemctl restart memcached
>> >>
>> >> I now see:
>> >>
>> >> tcp 0 0 localhost:memcache 0.0.0.0:* LISTEN
>> >> tcp6 0 0 ip6-localhost:memcache [::]:* LISTEN
>> >> udp 0 0 localhost:memcache 0.0.0.0:*
>> >> udp6 0 0 ip6-localhost:memcache [::]:*
>> >>
>> >> double-checking by using telnet to port 11211 from both the localhost
>> >> and a remote host verified that I could not longer make any external
>> >> connections to memcache.
>> >>
>> >> Cheers,
>> >> - Hervey
>> >>
>> >>>
>> >>>
>> >>> On February 8, 2018 at 4:54:03 PM, Hervey Allen
>> >>> (
>> >>>
>> >>> <mailto:>
>> >>> <mailto:
>> >>>
>> >>> <mailto:>>)
>> >>> wrote:
>> >>>
>> >>>> Hi All - Our IT Security group contacted us to say that the memcached
>> >>>> process was open on our perfSONAR Testpoint bundle instance we had
>> >>>> installed.
>> >>>>
>> >>>> It is...
>> >>>>
>> >>>> Question - I have the perfSONAR default firewall rules in place.
>> >>>> This is
>> >>>> running on a CentOS 7 box. What specifically needs to talk to this
>> >>>> service? Is this a service that is installed with Postgres? That's
>> >>>> what
>> >>>> I think is happening.
>> >>>>
>> >>>> Does Esmond need access to memcache from an archive host? Anything
>> >>>> else?
>> >>>> Based on the release notes for 4.0rc3:
>> >>>>
>> >>>> "Added memcached support to esmond archiver for tracking metadata
>> >>>> objects already created in order to increase archiver performance"
>> >>>>
>> >>>> I think this is the case.
>> >>>>
>> >>>> I'm trying to figure out proper strategy for recommending what to do
>> >>>> with the open memcached service.
>> >>>>
>> >>>> I believe adding a firewall rule to only allow access to memcached on
>> >>>> the perfSONAR Testpoint Bundle node and from wherever we have Esmond
>> >>>> is
>> >>>> what makes sense?
>> >>>>
>> >>>> Comments or recommendations are most welcome.
>> >>>>
>> >>>> Thank you!
>> >>>>
>> >>>> - Hervey
>> >>>>
>> >>>>
>> >>>>
>> >>>> Network Startup Resource Center
>> >>>> https://nsrc.org/
>> >>
>> >>
>> >> -- 
>> >> Hervey Allen Assistant Director, Network Startup Resource Center
>> >>
>> >>
>> >> <mailto:>
>> >> http://nsrc.org/ :
>> http://facebook.com/nsrc.org
>> >> GPG Fingerprint: AC08 31CB E453 6C65 2AB3 4EDB CEEB 5A74 C6E5 624F
>>
>>
>> --
>> Hervey Allen Assistant Director, Network Startup Resource Center
>>
>>
>> <mailto:>
>> http://nsrc.org/ :
>> http://facebook.com/nsrc.org
>> GPG Fingerprint: AC08 31CB E453 6C65 2AB3 4EDB CEEB 5A74 C6E5 624F


--
Hervey Allen Assistant Director, Network Startup Resource Center

http://nsrc.org/ : http://facebook.com/nsrc.org
GPG Fingerprint: AC08 31CB E453 6C65 2AB3 4EDB CEEB 5A74 C6E5 624F



Archive powered by MHonArc 2.6.19.

Top of Page