🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by Avon Kerr Sat, 29 Aug 2015 06:02
help please - readers.conf setup + authentication via port 563
#86919
Author: Avon Kerr
Date: Sat, 29 Aug 2015 06:02
132 lines
4586 bytes
So many questions, where to start??

1) How to get a secure session via port 563 up and running?


Aug 29 17:27:19 news nnrpd[19844]: starttls: TLSv1 with cipher DHE-RSA-
AES256-SHA (256/256 bits) no authentication
Aug 29 17:27:19 news nnrpd[19844]: avon.news.bbs.geek.nz (192.168.1.90) 
connect - port 119

I can't seem to get a newsreader on my local network to connect to INN 
via port 563 in a secure fashion. The copy of PAN I am using is pointing 
at the correct port on the server but not passing any user name / 
password info as I have nothing set up in INN as yet to handle this nor 
loaded into PAN. So what happens at the moment is  can't get a session 
going on port 563 and it seems to default back to port 119

Do I need to pass some auth info to create a working TSL session or 
should connecting via port 563 and having PAN set to use SSL and trust 
the servers certificate be enough? It seems with or without providing 
bogus user/pass info it's not :(

Then there's my readers.conf -I am wondering if it is the cause of the 
fallback to port 119?

I have been using the following auth groups

## AUTHORISED GROUPS START HERE

# Define Internet Users Group

auth "world" {
    hosts: "*"
    default: "<someone>"
}

# Define Home LAN Group (Unsecure connects via port 119)

auth "localhost" {
    hosts: "localhost, 127.0.0.1, ::1, 192.168.1.0/24, stdin"
    default: "<localhost>"
}


# Define Home LAN Group (Secure connects via port 563)

auth "localsec" {
    key: "localtsl"
    hosts: "localhost, 127.0.0.1, ::1, 192.168.1.0/24, stdin"
    default: "<localsec>"
    require_ssl: true
}


I added the key parameter recently to see if that was what was needed, to 
no avail it seems.




## ACCESS GROUPS START HERE


# Grant that specific identity access to read and post to any newsgroup
# and allow it to post articles with Approved: headers to moderated
# groups.


# Internet Users Access Rules

access "world" {
     users: "<someone>"
     read: "agency.*,nz.*,!junk,!control,!control.*"
     post: "agency.chat,agency.test"
     localtime: true
}

# Home LAN Access Rules

access "localhost" {
    users: "<localhost>"
    newsgroups: "*"
    access: RPA
    localtime: true
}


# Home LAN Testing Secure (Port 563)

access "localsec" {
     users: "<localsec>"
     key: "localtsl"
     read: "agency.*,nz.*,!junk,!control,!control.*"
     post: "agency.chat,agency.test"
     localtime: true
}

Do I need to have auth parameters defined to make the auth group localsec 
work?

Can someone kindly post some feedback or an example readers.conf I can 
use as the basis to get my port 563 connects working?


2) What is the best option to use when trying to set up something for 
users authenticated name / password?

I figured setting up port 563 was key as best practice would seem to 
suggest offering secure TSL connects for the transmission of name/pasword

What I would like to do is ultimately offer something like ES where folks 
can create a login name and password themselves to be able to post but to 
start with I figure even something I can set up myself and let users know 
their login details is a good start.

There seem to be a number of options assisted with setting up ckpasswd to 
use user login/password info. What do you guys think is the best way 
forward? I am wondering about a file created by apache htpasswd as a 
starting point but really unsure etc..

Thanks,  Paul







-- 
Agency News | news.bbs.geek.nz

Re: help please - readers.conf setup + authentication via port 563
#86921
Author: Julien ÉLIE
Date: Sat, 29 Aug 2015 15:22
118 lines
5328 bytes
Hi Paul,

> 1) How to get a secure session via port 563 up and running?
>
> Aug 29 17:27:19 news nnrpd[19844]: starttls: TLSv1 with cipher DHE-RSA-
> AES256-SHA (256/256 bits) no authentication
> Aug 29 17:27:19 news nnrpd[19844]: avon.news.bbs.geek.nz (192.168.1.90)
> connect - port 119
>
> I can't seem to get a newsreader on my local network to connect to INN
> via port 563 in a secure fashion.

Is there a special reason for using port 563?
I mean:  do you need a secure session (whatever the port) or do you need 
a secure session via port 563 only?

According to the logs you provide, the connection via port 119 is 
secured (a TLS session has been negotiated).


Note that it is the preferred way to do, per RFC 4642:
     https://tools.ietf.org/html/rfc4642

    In some existing implementations, TCP port 563 has been dedicated to
    NNTP over TLS.  These implementations begin the TLS negotiation
    immediately upon connection and then continue with the initial steps
    of an NNTP session.  This use of TLS on a separate port is
    discouraged for the reasons documented in Section 7 of "Using TLS
    with IMAP, POP3 and ACAP" [TLS-IMAPPOP].

    This specification formalizes the STARTTLS command already in
    occasional use by the installed base.  The STARTTLS command rectifies
    a number of the problems with using a separate port for a "secure"
    protocol variant; it is the preferred way of using TLS with NNTP.



> The copy of PAN I am using is pointing
> at the correct port on the server but not passing any user name /
> password info as I have nothing set up in INN as yet to handle this nor
> loaded into PAN. So what happens at the moment is  can't get a session
> going on port 563 and it seems to default back to port 119

Well, PAN seems to behave pretty well (respectful of the standards) 
according yo your logs.



> Then there's my readers.conf -I am wondering if it is the cause of the
> fallback to port 119?

Just a basic question to be sure:  is nnrpd running as a daemon on port 
563, and pointing to the right readers.conf file?
See the last section of CHECKLIST:
     http://www.eyrie.org/~eagle/software/inn/docs/checklist.html



> auth "localsec" {
>      key: "localtsl"

Your readers.conf file looks right to me.
Note a typo for "localtsl" (instead of "localtls") but it does not 
matter as you spell it twice the same.



> Can someone kindly post some feedback or an example readers.conf I can
> use as the basis to get my port 563 connects working?

I personally use a readers-ssl.conf file dedicated to the nnrpd that 
runs in daemon mode.
Mine is pretty straight-forward!

auth "users-ssl" {
     hosts: "*"
     auth: "ckpasswd -f /home/news/etc/users-ssl"
}

access "users-ssl" {
     newsgroups: "*"
     access: RPAN
}



> 2) What is the best option to use when trying to set up something for
> users authenticated name / password?
>
> I figured setting up port 563 was key as best practice would seem to
> suggest offering secure TSL connects for the transmission of name/pasword

A TLS connection is best practice (either via port 119 or 563).
Another possibility is to use SASL authentication with a mechanism that 
negotiates a secure layer.



> There seem to be a number of options assisted with setting up ckpasswd to
> use user login/password info. What do you guys think is the best way
> forward? I am wondering about a file created by apache htpasswd as a
> starting point but really unsure etc..

It is what I use.  Be sure that the file is not world-readable, but only 
readable by your news user.

If you do not want to use ckpasswd, you can of course use other kinds of 
authentication (via perl_auth or python_auth for instance).  The 
passwords will have to be somewhere anyway (file or database) unless you 
wish to use SASL mechanisms like OPENID20 but I doubt all your users 
will be able to easily authenticate against your news server!

-- 
Julien ÉLIE

« L'éternité, c'est long, surtout vers la fin. » (Woody Allen)

Re: help please - readers.conf setup + authentication via port 563
#86920
Author: Avon Kerr
Date: Sun, 30 Aug 2015 01:25
154 lines
6355 bytes
Hi Julien.

On Sat, 29 Aug 2015 17:22:09 +0200, Julien ÉLIE wrote:
 
> Is there a special reason for using port 563?
> I mean:  do you need a secure session (whatever the port) or do you need
> a secure session via port 563 only?

Well, no, other than the fact the documentation for nnrpd seemed to 
suggest that if I wanted to offer TLS then I should set it up on TCP port 
563. I was unaware I could offer it on port 119 as well??


> 
> According to the logs you provide, the connection via port 119 is
> secured (a TLS session has been negotiated).

Interesting, as I just read the log in a way that it had fallen back to 
port 119 and assumed it was not a secure session anymore.

> 
> 
> Note that it is the preferred way to do, per RFC 4642:
>      https://tools.ietf.org/html/rfc4642
> 
>     In some existing implementations, TCP port 563 has been dedicated to
>     NNTP over TLS.  These implementations begin the TLS negotiation
>     immediately upon connection and then continue with the initial steps
>     of an NNTP session.  This use of TLS on a separate port is
>     discouraged for the reasons documented in Section 7 of "Using TLS
>     with IMAP, POP3 and ACAP" [TLS-IMAPPOP].
> 
>     This specification formalizes the STARTTLS command already in
>     occasional use by the installed base.  The STARTTLS command
>     rectifies a number of the problems with using a separate port for a
>     "secure" protocol variant; it is the preferred way of using TLS with
>     NNTP.
> 

Curious, the TLS Support section of  the nnrpd docs do not make this clear.


> 
>> Then there's my readers.conf -I am wondering if it is the cause of the
>> fallback to port 119?
> 
> Just a basic question to be sure:  is nnrpd running as a daemon on port
> 563, and pointing to the right readers.conf file?
> See the last section of CHECKLIST:
>      http://www.eyrie.org/~eagle/software/inn/docs/checklist.html


In my case I set up inetd to run the following

nntps stream tcp nowait news /usr/lib/news/bin/nnrpd -S

while /etc/services defines port 563 as nntps


> 
>> auth "localsec" {
>>      key: "localtsl"
> 
> Your readers.conf file looks right to me.
> Note a typo for "localtsl" (instead of "localtls") but it does not
> matter as you spell it twice the same.

Whoops.. thanks, at least the spelling is the same, all be it wrong.

> 
> 
> 
>> Can someone kindly post some feedback or an example readers.conf I can
>> use as the basis to get my port 563 connects working?
> 
> I personally use a readers-ssl.conf file dedicated to the nnrpd that
> runs in daemon mode.
> Mine is pretty straight-forward!


I figured by not running nnrpd in daemon mode I would ensure any changes I 
made to readers.conf would be reflected quickly rather than having to kill 
and then restart a process to make the changes stick.

I guess I could always add a readers-ssl.conf file to /etc/news and add 
the -c /etc/news/readers-ssl.conf

So the full like should like the following ..

nntps stream tcp nowait news /usr/lib/news/bin/nnrpd -c /etc/news/readers-
ssl.conf -S

Is that correct?

> 
> auth "users-ssl" {
>      hosts: "*"
>      auth: "ckpasswd -f /home/news/etc/users-ssl"
> }
> 
> access "users-ssl" {
>      newsgroups: "*"
>      access: RPAN
> }

Thank you for the above, can this also be used for non TLS logins?

I mean even if you had a filename with user:password in it and the 
password had been encrypted by using something like htpassword would a 
user be able to login using plain unencrypted port 119?

By adding a line like auth: "ckpasswd -f /home/news/etc/users-ssl" into an 
auth group that didn't have "require_ssl: true" enabled?

Also do you know if the use of quotation marks is needed when setting a 
key? so is it key: "keyname" or is key: keyname ok to do?

> 
>> There seem to be a number of options assisted with setting up ckpasswd
>> to use user login/password info. What do you guys think is the best way
>> forward? I am wondering about a file created by apache htpasswd as a
>> starting point but really unsure etc..
> 
> It is what I use.  Be sure that the file is not world-readable, but only
> readable by your news user.

I will try and do this, but a bit unsure as to how to point the output of

    % htpasswd -nbd user pass
    user:LIfOpbjNaEQYE

    % perl -e 'print "user:".crypt("pass", "LI")."\n";'
    user:LIfOpbjNaEQYE

to a specific file name... I'll have a go and see what I can figure out.


> 
> If you do not want to use ckpasswd, you can of course use other kinds of
> authentication (via perl_auth or python_auth for instance).  The
> passwords will have to be somewhere anyway (file or database) unless you
> wish to use SASL mechanisms like OPENID20 but I doubt all your users
> will be able to easily authenticate against your news server!

It's all beyond me how to set something like this up but it seems like if 
I want a user to be able to login and create their own account and 
password I would have to set something like this up?

For now even getting a file set up that works on both 119 and 563 for 
people to authenticate and therefore be able to post is my goal..

Best, Paul

Re: help please - readers.conf setup + authentication via port 563
#86927
Author: Julien ÉLIE
Date: Sun, 30 Aug 2015 13:50
123 lines
5595 bytes
Hi Paul,

>> Is there a special reason for using port 563?
>> I mean:  do you need a secure session (whatever the port) or do you need
>> a secure session via port 563 only?
>
> Well, no, other than the fact the documentation for nnrpd seemed to
> suggest that if I wanted to offer TLS then I should set it up on TCP port
> 563. I was unaware I could offer it on port 119 as well??

How your suggestion of improvement could be taken into account?
Maybe in the "TLS SUPPORT" section of the documentation for nnrpd?

Currently:
"Most news clients currently do not use the STARTTLS command, however, 
and instead expect to connect to a separate port (563) and start a TLS 
negotiation immediately."

Suggestion:
"There are two common ways for a news client to negotiate a TLS 
connection:  either via the use of the STARTTLS command on the usual 
NNTP port (119) or via the now discouraged way (per RFC 4642) to 
immediately negotiate an encrypted session upon connection on a 
dedicated port (usually 563).  As most news clients currently do not use 
the STARTTLS command, and instead expect to connect to a separate port 
(563) and start a TLS negotiation immediately, it is still useful to 
provide a legacy way for these news clients to encrypt the NNTP session."



> Curious, the TLS Support section of the nnrpd docs do not make this clear.

Well, not necessarily "curious" but just not up-to-date or not clear 
enough :)

Suggestions of improvement are welcome on all our documentation, so 
please do not hesitate to share your comments!



> So the full like should like the following ..
>
> nntps stream tcp nowait news /usr/lib/news/bin/nnrpd -c /etc/news/readers-
> ssl.conf -S
>
> Is that correct?

Hmm...  Sound also like there is a typo in the nnrpd documentation 
because "nnrpd" appears twice in the line!
That line looks right to me.  Do you confirm it works fine for you?  (no 
need to add a call to the "tcpd" wrapper before nnrpd?  does it work for 
both tcp4 and tcp6?)

I for one do not use inetd.conf but an init.d script that runs nnrpd in 
daemon mode.



>> auth "users-ssl" {
>>       hosts: "*"
>>       auth: "ckpasswd -f /home/news/etc/users-ssl"
>> }
>>
>> access "users-ssl" {
>>       newsgroups: "*"
>>       access: RPAN
>> }
>
> Thank you for the above, can this also be used for non TLS logins?

Yes, though the name "users-ssl" is not the best for that!



> I mean even if you had a filename with user:password in it and the
> password had been encrypted by using something like htpassword would a
> user be able to login using plain unencrypted port 119?

Yes he would be able to authenticate.



> By adding a line like auth: "ckpasswd -f /home/news/etc/users-ssl" into an
> auth group that didn't have "require_ssl: true" enabled?

Also.
Anyway, that behaviour depends on the implementation of the news client 
software.  You can't forbid a client to try to authenticate on an 
unencrypted connection...  A well-behaved news client could warn that he 
did not manage to negotiate a TLS connection and maybe ask whether it 
should try to authenticate anyway.



> Also do you know if the use of quotation marks is needed when setting a
> key? so is it key: "keyname" or is key: keyname ok to do?

If there is no space in the string, it is OK not to use quotation marks.



>> If you do not want to use ckpasswd, you can of course use other kinds of
>> authentication (via perl_auth or python_auth for instance).  The
>> passwords will have to be somewhere anyway (file or database) unless you
>> wish to use SASL mechanisms like OPENID20 but I doubt all your users
>> will be able to easily authenticate against your news server!
>
> It's all beyond me how to set something like this up but it seems like if
> I want a user to be able to login and create their own account and
> password I would have to set something like this up?

Not necessarily.  You could also automatically add a new "user:pass" or 
"user:pass:comment" line at the end of your users file fater the 
creation of an account.

-- 
Julien ÉLIE

« Utiliser vi n'est pas un péché, c'est une punition. Car souvenez-
   vous que vi-vi-vi est l'éditeur de la Bête. » (Stallman, Church of
   Emacs)

Re: help please - readers.conf setup + authentication via port 563
#86929
Author: Avon Kerr
Date: Mon, 31 Aug 2015 07:53
119 lines
5454 bytes
Hi Julien.

On Sun, 30 Aug 2015 15:50:34 +0200, Julien ÉLIE wrote:
 
> Suggestion:
> "There are two common ways for a news client to negotiate a TLS
> connection:  either via the use of the STARTTLS command on the usual
> NNTP port (119) or via the now discouraged way (per RFC 4642) to
> immediately negotiate an encrypted session upon connection on a
> dedicated port (usually 563).  As most news clients currently do not use
> the STARTTLS command, and instead expect to connect to a separate port
> (563) and start a TLS negotiation immediately, it is still useful to
> provide a legacy way for these news clients to encrypt the NNTP
> session."

Yes I think this is a good idea, it reads well.

> Suggestions of improvement are welcome on all our documentation, so
> please do not hesitate to share your comments!

Thank you I will certainly do so as I come across things.

>> So the full like should like the following ..
>>
>> nntps stream tcp nowait news /usr/lib/news/bin/nnrpd -c
>> /etc/news/readers-
>> ssl.conf -S
>>
>> Is that correct?
> 
> Hmm...  Sound also like there is a typo in the nnrpd documentation
> because "nnrpd" appears twice in the line!

Yes you are right, that looks like a typo to me also... see we found 
something together :)

> That line looks right to me.  Do you confirm it works fine for you?  (no
> need to add a call to the "tcpd" wrapper before nnrpd?  does it work for
> both tcp4 and tcp6?)

Not sure if you are talking about the original line in the nnrpd document 
or the one I typed above?

If it is the latter then I can't answer that yet as that was a suggested 
line that I thought I could use if I opted to use a different file such as 
readers-ssl.conf

At present I just use the following that does include the typo but it 
seems to work in so far as you have connected on port 563 and seen it 
trying to setup a TLS connection. Perhaps I should amend it?

nntps stream tcp nowait news /usr/lib/news/bin/nnrpd nnrpd -S


> Yes, though the name "users-ssl" is not the best for that!

Indeed :)


>> I mean even if you had a filename with user:password in it and the
>> password had been encrypted by using something like htpassword would a
>> user be able to login using plain unencrypted port 119?
> 
> Yes he would be able to authenticate.

OK thanks.

>> By adding a line like auth: "ckpasswd -f /home/news/etc/users-ssl" into
>> an auth group that didn't have "require_ssl: true" enabled?
> 
> Also.

OK.

> Anyway, that behaviour depends on the implementation of the news client
> software.  You can't forbid a client to try to authenticate on an
> unencrypted connection...  A well-behaved news client could warn that he
> did not manage to negotiate a TLS connection and maybe ask whether it
> should try to authenticate anyway.

What are some examples (in your view) of well behaved clients? At present 
my testing and user experince extends to NewsXpress, PAN and Thunderbird 
of which the latter did not seem to work - I think.



>> Also do you know if the use of quotation marks is needed when setting a
>> key? so is it key: "keyname" or is key: keyname ok to do?
> 
> If there is no space in the string, it is OK not to use quotation marks.

Thanks, and afterwards I did find this reference in the docs. Thanks for 
the confirmation.

>> It's all beyond me how to set something like this up but it seems like
>> if I want a user to be able to login and create their own account and
>> password I would have to set something like this up?
> 
> Not necessarily.  You could also automatically add a new "user:pass" or
> "user:pass:comment" line at the end of your users file fater the
> creation of an account.

The thing is I am not a coder nor programmer so I am unsure how to script 
anything that assists a user or newsadmin create and/or update a user 
account and password in INN. That would be a helpful utility or suggested 
few bits of code to include as examples in the INN2 documentation. 

As always, thanks for taking the time to reply to my queries and for your 
help which is greatly appreciated.

Best, Paul




-- 
Agency News | news.bbs.geek.nz

Re: help please - readers.conf setup + authentication via port 563
#86935
Author: Julien ÉLIE
Date: Mon, 31 Aug 2015 20:03
65 lines
3759 bytes
Hi Paul,

>> Suggestion:
>> "There are two common ways for a news client to negotiate a TLS
>> connection:  either via the use of the STARTTLS command on the usual
>> NNTP port (119) or via the now discouraged way (per RFC 4642) to
>> immediately negotiate an encrypted session upon connection on a
>> dedicated port (usually 563).  As most news clients currently do not use
>> the STARTTLS command, and instead expect to connect to a separate port
>> (563) and start a TLS negotiation immediately, it is still useful to
>> provide a legacy way for these news clients to encrypt the NNTP
>> session."
>
> Yes I think this is a good idea, it reads well.

Thanks, adopted for INN 2.6.0.


>> Suggestions of improvement are welcome on all our documentation, so
>> please do not hesitate to share your comments!
>
> Thank you I will certainly do so as I come across things.

OK, that's kind of you.  We'll take your suggestions into account for 
future releases (2.6.1+) because INN 2.6.0 will soon be released.


>> Hmm...  Sound also like there is a typo in the nnrpd documentation
>> because "nnrpd" appears twice in the line!
>
> Yes you are right, that looks like a typo to me also... see we found
> something together :)

Well, that was not a typo in fact.
   https://en.wikipedia.org/wiki/Inetd
"telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd -a"
so the entire command line is really repeated.  "inetd is told to launch 
the program /usr/sbin/telnetd with the command line arguments telnetd -a".


> nntps stream tcp nowait news /usr/lib/news/bin/nnrpd nnrpd -S

Looks good, then.


>> Anyway, that behaviour depends on the implementation of the news client
>> software.  You can't forbid a client to try to authenticate on an
>> unencrypted connection...  A well-behaved news client could warn that he
>> did not manage to negotiate a TLS connection and maybe ask whether it
>> should try to authenticate anyway.
>
> What are some examples (in your view) of well behaved clients? At present
> my testing and user experince extends to NewsXpress, PAN and Thunderbird
> of which the latter did not seem to work - I think.

One of the most RFC-compliant is tin to my mind, but others are also 
great (like gnus...).

-- 
Julien ÉLIE

« – Nous voyageons plus vite que la lumière !
   – Alors comment y voir clair dans tout ça ? » (Astérix)

Re: help please - readers.conf setup + authentication via port 563
#86938
Author: Avon Kerr
Date: Tue, 01 Sep 2015 08:13
42 lines
2394 bytes
Hi Julien,

On Mon, 31 Aug 2015 22:03:19 +0200, Julien ÉLIE wrote:

> Thanks, adopted for INN 2.6.0.

Good stuff, thanks.

>> Thank you I will certainly do so as I come across things.
> 
> OK, that's kind of you.  We'll take your suggestions into account for
> future releases (2.6.1+) because INN 2.6.0 will soon be released.

Well I'm new at it but as I find things I will be sure to ask so 
hopefully we can pick up the odd thing and refine it further.

> Well, that was not a typo in fact.
>    https://en.wikipedia.org/wiki/Inetd
> "telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd -a"
> so the entire command line is really repeated.  "inetd is told to launch
> the program /usr/sbin/telnetd with the command line arguments telnetd
> -a".
> 
> 
>> nntps stream tcp nowait news /usr/lib/news/bin/nnrpd nnrpd -S
> 
> Looks good, then.

Ok, good to know. I will leave my setting well alone.

> One of the most RFC-compliant is tin to my mind, but others are also
> great (like gnus...).

TIN was the first usenet reader I ever used, good suggestion thanks I 
will go hunt out a copy.

Best, Paul

-- 
Agency News | news.bbs.geek.nz

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads