Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

There *__is* no such thing as a civil engineer.


computers / news.software.nntp / Re: readers.conf

SubjectAuthor
* readers.confMiner
`* Re: readers.confJulien ÉLIE
 `* Re: readers.confJulien ÉLIE
  +- Re: readers.confJulien ÉLIE
  `* Re: readers.confMiner
   `* Re: readers.confJulien ÉLIE
    `- Re: readers.confMiner

1
readers.conf

<t0krjp$6fh$1@txtcon.i2p>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=660&group=news.software.nntp#660

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!rocksolid2!txtcon.i2p!.POSTED.127.163.152.53!not-for-mail
From: joh...@doe.invalid (Miner)
Newsgroups: news.software.nntp
Subject: readers.conf
Date: Sun, 13 Mar 2022 13:29:32 -0000 (UTC)
Organization: TxtCon.I2P
Message-ID: <t0krjp$6fh$1@txtcon.i2p>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Mar 2022 13:29:32 -0000 (UTC)
Injection-Info: txtcon.i2p; posting-account="miner"; posting-host="127.163.152.53";
logging-data="6641"; mail-complaints-to="txtcon@i2pmail.org"
 by: Miner - Sun, 13 Mar 2022 13:29 UTC

How to accept connections from a few IP addresses and immediately
reject anything from the same network range?

I did try to do that, but unsuccessful. inn 2.6.4.
auth "blah" {
hosts: "192.168.1.0/24, !192.168.1.5"
default: "<FAIL>"
}

--
Miner

Re: readers.conf

<t12i1g$fkek$1@news.trigofacile.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=663&group=news.software.nntp#663

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176.143-2-105.abo.bbox.fr!not-for-mail
From: iul...@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: readers.conf
Date: Fri, 18 Mar 2022 19:12:00 +0100
Organization: Groupes francophones par TrigoFACILE
Message-ID: <t12i1g$fkek$1@news.trigofacile.com>
References: <t0krjp$6fh$1@txtcon.i2p>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 18 Mar 2022 18:12:00 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176.143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="512468"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.2
Cancel-Lock: sha1:BQr+lMeoWYmhjKuTu3yCXD0Brbc= sha256:BBFgpx6Dvzzp2GDASW2xUTQVBougC3sL0+CBeg6/Kws=
sha1:2z26dFezh9d9Gm9Usq/4F7fuoc4= sha256:xe1x343BkvmVQZhpSrEbYrpcQZMxs33+j7kMTSH2ICQ=
In-Reply-To: <t0krjp$6fh$1@txtcon.i2p>
 by: Julien ÉLIE - Fri, 18 Mar 2022 18:12 UTC

Hi Miner,

> How to accept connections from a few IP addresses and immediately
> reject anything from the same network range?
>
> I did try to do that, but unsuccessful. inn 2.6.4.
>
> auth "blah" {
> hosts: "192.168.1.0/24, !192.168.1.5"
> default: "<FAIL>"
> }

You need at least 2 blocks:
- "auth" to authorize connections as a news reader and assign an
identity to that connection;
- "access" to parameter the access (what a given identity is allowed to do).

auth "blah" {
hosts: "192.168.1.0/24, !192.168.1.5"
default: "<FAIL>"
}

=> It assigns the identity "<FAIL>" to the users in 192.168.1.0/24 but
not 192.168.1.5.

You need an access block to say what "<FAIL>" can do.

With that logic in mind, a working readers.conf file to do that is:

auth blah {
hosts: "192.168.1.0/24, !192.168.1.5"
default: "<SUCCESS>"
}

access full {
users: "<SUCCESS>"
newsgroups: *
}

Of course, more complex cases could be done. That example gives you the
logic. The access block says what the "<SUCCESS>" identity can do.
Connections from an IP which does not match the "auth" block won't be
assigned any identity, and will be immediately rejected.

More information:
https://www.eyrie.org/~eagle/software/inn/docs/readers.conf.html

--
Julien ÉLIE

« J'aimerais qu'on me lâche les cothurnes ! » (Astérix)

Re: readers.conf

<t142go$gncm$1@news.trigofacile.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=664&group=news.software.nntp#664

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176.143-2-105.abo.bbox.fr!not-for-mail
From: iul...@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: readers.conf
Date: Sat, 19 Mar 2022 08:59:20 +0100
Organization: Groupes francophones par TrigoFACILE
Message-ID: <t142go$gncm$1@news.trigofacile.com>
References: <t0krjp$6fh$1@txtcon.i2p> <t12i1g$fkek$1@news.trigofacile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 07:59:20 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176.143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="548246"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.7.0
Cancel-Lock: sha1:pKDxzEDp/a3NnjfTBga1qK8IN/w= sha256:oEEaaGktIShshqazjISKtvJTs2clPRQLwbRA60zbPbg=
sha1:LS5VCguCHxlTyEuEUD35KHbgI5Y= sha256:8E9W5wuddbBpVfi0f0cU6xxBvLdDn9EcNEzBuK3q5pY=
In-Reply-To: <t12i1g$fkek$1@news.trigofacile.com>
 by: Julien ÉLIE - Sat, 19 Mar 2022 07:59 UTC

Hi Miner,

>> How to accept connections from a few IP addresses and immediately
>> reject anything from the same network range?
>>
>> I did try to do that, but unsuccessful. inn 2.6.4.
>>
>> auth "blah" {
>>   hosts: "192.168.1.0/24, !192.168.1.5"
>>   default: "<FAIL>"
>> }
>
> => It assigns the identity "<FAIL>" to the users in 192.168.1.0/24 but
> not 192.168.1.5.

After further investigation, I better understand the issue you're facing.
This syntax does not work. I would tend to think this is a bug, but am
unsure. We have no examples of a "!" syntax in "hosts" lists in
readers.conf...

The code just parses each part of the list, starting from the end. So,
assuming you're connecting from 192.168.1.5, it does:

1/ Does "!192.168.1.5" matches 192.168.1.5? No, so go on trying.
2/ Does "192.168.1.0/24" matches 192.168.1.5? Yes, so the auth block
succeeds.

I would have said at step 1 that the auth block fails, but that's not
what the code does... Any opinion about that, and if it should be changed?

At least the documentation needs fixing as it says for "hosts":
"comma-separated wildmat expressions allowed, but @ is not supported".

> With that logic in mind, a working readers.conf file to do that is:
>
> auth blah {
>   hosts: "192.168.1.0/24, !192.168.1.5"
>   default: "<SUCCESS>"
> }
>
> access full {
>   users: "<SUCCESS>"
>   newsgroups: *
> }

This does not work, unfortunately (in current versions of INN 2.6.x).

Here's a working example:

auth allowed {
hosts: "192.168.1.0/24"
default: "<SUCCESS>"
}

auth disallowed {
hosts: "192.168.1.5"
default: "<FAIL>"
}

access success {
users: "<SUCCESS>"
newsgroups: "*"
}

access fail {
users: "<FAIL>"
reject_with: "Not allowed!"
}

Remember the order is important (the last matching block applies, so the
"disallowed" block should be after the "allowed" block).

The behaviour you asked for (directly rejecting the connection) can be
achieved with the reject_with parameter:

% telnet news.trigofacile.com 119
400 Permission denied: Not allowed!

I hope this answer helps you.

Thanks for this question. It permitted finding that "hole" in our
documentation, or even a bug in the source code!

--
Julien ÉLIE

« Pour aller plus vite, j'additionne toujours de bas en haut : je fais
du même coup l'addition et la preuve. » (Aurélien Scholl)

Re: readers.conf

<t14424$gnru$1@news.trigofacile.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=665&group=news.software.nntp#665

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr!not-for-mail
From: iul...@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: readers.conf
Date: Sat, 19 Mar 2022 09:25:40 +0100
Organization: Groupes francophones par TrigoFACILE
Message-ID: <t14424$gnru$1@news.trigofacile.com>
References: <t0krjp$6fh$1@txtcon.i2p> <t12i1g$fkek$1@news.trigofacile.com>
<t142go$gncm$1@news.trigofacile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 08:25:40 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr:176.143.2.105";
logging-data="548734"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.7.0
Cancel-Lock: sha1:WM9OjSbfht1/KPHUY3t2n1I5LSw= sha256:5U57RvtNn2QM6Nj7dxnb2d/+9r5+Jtmul5/kiJrhYZk=
sha1:wAgwaE1bsEkO1Vb9hdz8ytgOQOg= sha256:IKQVaX3MJ+i0NZ9/XP1sEQC9118TFMXTmzBqZudcqfI=
In-Reply-To: <t142go$gncm$1@news.trigofacile.com>
 by: Julien ÉLIE - Sat, 19 Mar 2022 08:25 UTC

Hi all,

> hosts: "192.168.1.0/24, !192.168.1.5"
>
> After further investigation, I better understand the issue you're facing.
> This syntax does not work.  I would tend to think this is a bug, but am
> unsure.  We have no examples of a "!" syntax in "hosts" lists in
> readers.conf...
>
> The code just parses each part of the list, starting from the end.  So,
> assuming you're connecting from 192.168.1.5, it does:
>
> 1/ Does "!192.168.1.5" matches 192.168.1.5?  No, so go on trying.
> 2/ Does "192.168.1.0/24" matches 192.168.1.5?  Yes, so the auth block
> succeeds.
>
> I would have said at step 1 that the auth block fails, but that's not
> what the code does...  Any opinion about that, and if it should be changed?
>
> At least the documentation needs fixing as it says for "hosts":
> "comma-separated wildmat expressions allowed, but @ is not supported".

After all, I believe it should be fixed for INN 2.7.0. And an example
added.
I've digged a bit in the history. We lost a check during a refactoring.
The MatchHost() function in nnrpd once had near its end:

if (ret && list[iter][0] == '!')
ret = false;

The "!" syntax has not been working since INN 2.5.0 for the hosts pattern.

Many thanks to you, Miner, for your question about that use case!

For the time being, you can use the syntax with 2 blocks I suggested in
my previous message.
The expected syntax with only 1 block should work again in the next
release (INN 2.7.0 normally, as no other INN 2.6.x release is scheduled
unless a blocking issue is found on INN 2.6.5).

--
Julien ÉLIE

« Les amis de la vérité sont ceux qui la cherchent, et non ceux qui se
vantent de l'avoir trouvée. » (Condorcet)

Re: readers.conf

<t155s1$bk5$1@txtcon.i2p>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=666&group=news.software.nntp#666

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!rocksolid2!txtcon.i2p!.POSTED.127.163.152.53!not-for-mail
From: joh...@doe.invalid (Miner)
Newsgroups: news.software.nntp
Subject: Re: readers.conf
Date: Sat, 19 Mar 2022 18:02:42 -0000 (UTC)
Organization: TxtCon.I2P
Message-ID: <t155s1$bk5$1@txtcon.i2p>
References: <t0krjp$6fh$1@txtcon.i2p> <t12i1g$fkek$1@news.trigofacile.com> <t142go$gncm$1@news.trigofacile.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 18:02:42 -0000 (UTC)
Injection-Info: txtcon.i2p; posting-account="miner"; posting-host="127.163.152.53";
logging-data="11909"; mail-complaints-to="txtcon@i2pmail.org"
 by: Miner - Sat, 19 Mar 2022 18:02 UTC

Julien ??LIE wrote:

> Hi Miner,
>
> > > How to accept connections from a few IP addresses and
> > > immediately reject anything from the same network range?
> > >
> > > I did try to do that, but unsuccessful. inn 2.6.4.
> > >
> > > auth "blah" {
> > >   hosts: "192.168.1.0/24, !192.168.1.5"
> > >   default: "<FAIL>"
> > > }
> >
> > => It assigns the identity "<FAIL>" to the users in
> > 192.168.1.0/24 but not 192.168.1.5.
>
> The code just parses each part of the list, starting from the end. So,
> assuming you're connecting from 192.168.1.5, it does:
>
> 1/ Does "!192.168.1.5" matches 192.168.1.5? No, so go on
> trying.
> 2/ Does "192.168.1.0/24" matches 192.168.1.5? Yes, so the auth
> block succeeds.

> I would have said at step 1 that the auth block fails, but
> that's not what the code does... Any opinion about that, and
> if it should be changed?

In my example condition '"192.168.1.0/24, !192.168.1.5"' mean
reject any connection from network 192.168.1.0/24, except
192.168.1.5 host.

In other words: I need to permit connection from a few hosts and
terminate any incoming connection from others immediately.
Currently inn seem does not support selective rules.

>
> At least the documentation needs fixing as it says for "hosts":
> "comma-separated wildmat expressions allowed, but @ is not
> supported".
>
>
> > With that logic in mind, a working readers.conf file to do that is:
> >
> > auth blah {
> >   hosts: "192.168.1.0/24, !192.168.1.5"
> >   default: "<SUCCESS>"
> > }

"default:" value need to be "<FAIL>" - nobody welcome except a
few hosts.

> This does not work, unfortunately (in current versions of INN 2.6.x).
>
> Here's a working example:
>
> auth allowed {
> hosts: "192.168.1.0/24"
> default: "<SUCCESS>"
> }
>
> auth disallowed {
> hosts: "192.168.1.5"
> default: "<FAIL>"
> }
>
> access success {
> users: "<SUCCESS>"
> newsgroups: "*"
> }
>
> access fail {
> users: "<FAIL>"
> reject_with: "Not allowed!"
> }
>
> Remember the order is important (the last matching block
> applies, so the "disallowed" block should be after the
> "allowed" block).

How about?..

auth allowed {
hosts: "192.168.1.5"
default: "<SUCCESS>"
}

auth disallowed {
hosts: "192.168.1.0/24"
default: "<FAIL>"
}

access success {
users: "<SUCCESS>"
newsgroups: "*"
}

access fail {
users: "<FAIL>"
reject_with: "Not allowed!"
}

--
Miner

Re: readers.conf

<t15m9f$hhmm$1@news.trigofacile.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=667&group=news.software.nntp#667

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr!not-for-mail
From: iul...@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: readers.conf
Date: Sat, 19 Mar 2022 23:42:55 +0100
Organization: Groupes francophones par TrigoFACILE
Message-ID: <t15m9f$hhmm$1@news.trigofacile.com>
References: <t0krjp$6fh$1@txtcon.i2p> <t12i1g$fkek$1@news.trigofacile.com>
<t142go$gncm$1@news.trigofacile.com> <t155s1$bk5$1@txtcon.i2p>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 22:42:55 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr:176.143.2.105";
logging-data="575190"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.7.0
Cancel-Lock: sha1:0wa0sglib/mPGlj8Mi0LPcykJZ0= sha256:UUcr6BEeHKikZ3SSyWElVnjNKaKeHyPl9MJvSXObHg0=
sha1:lJ4PHa/q7WnNKlwctm9LItdmuYY= sha256:ca4NNVBYIKvTskzViMf5Pw/eOROpgrXc6fHJl6T5zxM=
In-Reply-To: <t155s1$bk5$1@txtcon.i2p>
 by: Julien ÉLIE - Sat, 19 Mar 2022 22:42 UTC

Hi Miner,

> In my example condition '"192.168.1.0/24, !192.168.1.5"' mean
> reject any connection from network 192.168.1.0/24, except
> 192.168.1.5 host.

Ah, OK. The "hosts" parameter behaves differently. It defines which
hosts are allowed.

> How about?..
>
> auth allowed {
> hosts: "192.168.1.5"
> default: "<SUCCESS>"
> }
>
> auth disallowed {
> hosts: "192.168.1.0/24"
> default: "<FAIL>"
> }
>
> access success {
> users: "<SUCCESS>"
> newsgroups: "*"
> }
>
> access fail {
> users: "<FAIL>"
> reject_with: "Not allowed!"
> }

As the last matching auth block applies, the "disallowed" block should
be before the "allowed" block in your example. Otherwise, 192.168.1.5
matches both blocks and therefore the second one ("disallowed") is selected.

In my previous example, I thought you wanted "everyone except for a few
hosts" so "allowed" is before "disallowed". Here, the logic is "nobody
except for a few hosts" so "disallowed" is before "allowed".

--
Julien ÉLIE

« Un petit pås pøur møi, un grånd bønd pøur l'humanité ! » (Kerøzen)

Re: readers.conf

<t1nfa1$gfc$1@txtcon.i2p>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=685&group=news.software.nntp#685

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!rocksolid2!txtcon.i2p!.POSTED.127.163.152.53!not-for-mail
From: joh...@doe.invalid (Miner)
Newsgroups: news.software.nntp
Subject: Re: readers.conf
Date: Sat, 26 Mar 2022 16:34:10 -0000 (UTC)
Organization: TxtCon.I2P
Message-ID: <t1nfa1$gfc$1@txtcon.i2p>
References: <t0krjp$6fh$1@txtcon.i2p> <t12i1g$fkek$1@news.trigofacile.com> <t142go$gncm$1@news.trigofacile.com> <t155s1$bk5$1@txtcon.i2p> <t15m9f$hhmm$1@news.trigofacile.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 26 Mar 2022 16:34:10 -0000 (UTC)
Injection-Info: txtcon.i2p; posting-account="miner"; posting-host="127.163.152.53";
logging-data="16876"; mail-complaints-to="txtcon@i2pmail.org"
 by: Miner - Sat, 26 Mar 2022 16:34 UTC

Julien ??LIE wrote:

> As the last matching auth block applies, the "disallowed" block
> should be before the "allowed" block in your example.
> Otherwise, 192.168.1.5 matches both blocks and therefore the
> second one ("disallowed") is selected.
>
> In my previous example, I thought you wanted "everyone except
> for a few hosts" so "allowed" is before "disallowed". Here,
> the logic is "nobody except for a few hosts" so "disallowed" is
> before "allowed".

It seems I got now desired behaviour. Thanks.

--
Miner

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor