Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NSS_ALLOW_SSLKEYLOGFILE=1 is enabled at compile time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Wed Mar 08, 2023 11:09 pm    Post subject: NSS_ALLOW_SSLKEYLOGFILE=1 is enabled at compile time Reply with quote

I was looking at the options passed at compile time of the dev-libs/nss package and I see that in the ebuilds of both the stable and testing versions
3.79.2 and 3.88.1 the export variable NSS_ALLOW_SSLKEYLOGFILE=1 is passed
I searched and apparently it is used for debugging and from the dev-libs/nss-3.42 version they say that it is disabled, my question is why it is enabled
and what function does it fulfill that it is enabled since if it is a release it is not being debugged.

http://udn.realityripple.com/docs/Mozilla/Projects/NSS/Reference/NSS_environment_variables

NSS_ALLOW_SSLKEYLOGFILE Boolean (1 to enable)
Enable NSS support in optimized builds for logging SSL/TLS key material to a logfile if the SSLKEYLOGFILE environment variable.
As of NSS 3.24 this is disabled by default.

https://bugzilla.mozilla.org/show_bug.cgi?id=1515236#c4

Regards.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Wed Mar 08, 2023 11:49 pm    Post subject: Reply with quote

The help from build.sh script says that it can be disabled, that is, it is enabled by default, but there is no use for it disable it to handle --disable-keylog...or I don't see it.

~/adm/work/nss/src/nss-3.88.1/nss $ ./build.sh --help

--disable-keylog disable support for logging key data to a file specified by the SSLKEYLOGFILE environment variable

Regards.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Thu Mar 09, 2023 12:39 am    Post subject: Reply with quote

This is very interesting.

https://markusgraf.net/2021-07-04-FreeBSD-SSLKEYLOGFILE.html

For my taste it should be disabled by default, and be a use in the ebuild, so if someone wants to see what happens with wireshark
rebuild nss with active use and you can sniff the traffic... but not by default as it is now, although I started to test and I don't get nothing with firefox.

Regards.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Thu Mar 09, 2023 1:32 am    Post subject: Reply with quote

Now it works, I was running firefox from a sandbox so it didn't work, when running it from a console, it does send the log.
Code:
$ export SSLKEYLOGFILE="sslkey.log"
$ firefox &
$ tail -f sslkey.log

I will put dev-libs/nss in local tree with NSS_ALLOW_SSLKEYLOGFILE=0 to see if logging is disabled.
I still think this should be disabled by default.

https://firefox-source-docs.mozilla.org/security/nss/legacy/key_log_format/index.html
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21619

PostPosted: Thu Mar 09, 2023 3:23 am    Post subject: Reply with quote

A simple review of git log shows this was first added in bb2d6491fd7b64675fd0ccf1007b40f87b99f674. That commit credits https://github.com/gentoo/gentoo/pull/13990. The request does not describe the rationale for the change.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Thu Mar 09, 2023 5:01 am    Post subject: Reply with quote

It seems to me that it is not necessary to give the reason, it is in plain sight, on top of that it says it openly... to date it makes one think but of course, then one is paranoid.
Quote:
Whissi commented on Dec 15, 2019
Sure, but I'll do it without USE flag.

I was comparing the gentoo .ebuild and the crux Pkgfile and that option appeared that was not in the crux Pkgfile
So I started to investigate what it was for... and what a surprise.
A USE flag was requested and a fixed weld was launched for the whole world...how many more of these will there be to discover?

Regards.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1678

PostPosted: Fri Mar 10, 2023 8:17 am    Post subject: Reply with quote

If you think a change should be made, please file a bug. Posting on the forums doesn't get things anywhere.

With regard to the function: it allows directing NSS to log to a file at runtime. If NSS isn't built with this support, that isn't possible.

Now, as for the change itself: while I generally think that environment variables can't be trusted anyway (this is well-accepted), given this is off by default upstream, it probably makes sense to make it toggleable via a USE flag, if nothing else to avoid confusion or concern.

Note that for NSS, it's a bit different to other ebuilds in a way, because it doesn't use autotools, so users can't use EXTRA_ECONF to pass additional configure arguments. They might be able to pass a variable via /etc/portage/env to enable the logging capability if they want, but I haven't checked if the build system allows that or not.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Fri Mar 10, 2023 7:05 pm    Post subject: Reply with quote

Don't want to clash with the ebuilds developers, they have their reasons for to do things the way they to make,
I respect them, but if don't I like their recipes, modify them or don't use them directly.

Well, I edited it in my local tree by setting the option NSS_ALLOW_SSLKEYLOGFILE=0
Code:
pc-gentoo /usr/local/portage/dev-libs/nss # emerge -av1 dev-libs/nss
 
[ebuild   R    ] dev-libs/nss-3.77::repo_local [3.77::gentoo] USE="-cacert -utils" ABI_X86="(64) -32 (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y

Now it no longer issues the log, if everyone who wants to change things is able to edit ebuilds it wouldn't be such a problem
but when we started we had no idea how things were done and that is a problem, that the options by default are not correct in terms of security.

While in BLFS I have created the packages nss-3.88.1 and firefox-102.8.0 esr and everything works perfectly, the options I pass to nss in the Pkgfile are these:
Code:
# Configure and compile the package:
   cd nss
   make -j1 \
   BUILD_OPT=1 \
   NSPR_INCLUDE_DIR=/usr/include/nspr \
   USE_SYSTEM_ZLIB=1 \
   ZLIB_LIBS=-lz \
   NSS_ENABLE_WERROR=0 \
   USE_64=1 \
   NSS_USE_SYSTEM_SQLITE=1 \
   NSS_DISABLE_GTESTS=1 \
   NSS_ENABLE_TLS_1_3=1 \
   NSS_SEED_ONLY_DEV_URANDOM=1 \
   NSS_ALLOW_SSLKEYLOGFILE=0

Regards.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1678

PostPosted: Fri Mar 10, 2023 7:18 pm    Post subject: Reply with quote

My point is that if you think something is wrong as a default, you can tell us using the proper venue (Bugzilla) and we'll consider it.

That's not clashing, but you and others in this thread feel the same, and I think it's worth changing as well (if nothing else to avoid scaring people).

If everybody just implemented local workarounds for problems, we would be in big trouble. We need bug reports.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Sat Mar 11, 2023 9:24 pm    Post subject: Reply with quote

Without intending to generate controversy, users are the owners of editing the ebuilds and building their own ebuilds in their local trees
,or in external repositories, and if it doesn't give them the ability to handle eclass they can compile from source and install in /usr/local/,
but then no come and complain through the forums or IRC.
This is not a bug, it is a feature wanted by the maintainer of the ebuild, since he liked it so much, he soldered it fixed, so nobody
change it so everyone can enjoy that functionality that will always be available. :(
I could not have created this thread and not say anything, but I do it so that many see how the choice of a few people determines what everyone uses.
The reality is that there should be no one between the source code and the end user...mens in middle.

Regards.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sat Mar 11, 2023 9:42 pm    Post subject: Reply with quote

colo-des wrote:
The reality is that there should be no one between the source code and the end user...mens in middle.

... then we have a Linux from Scratch ...

colo-des wrote:
[...] but I do it so that many see how the choice of a few people determines what everyone uses.

Please go one step further: No programmer (they decide also what they do in their programms) should be between your computer system and you ...

... you see, you cannot do all by yourself ... and then there is always somebody who MUST make a decision ... and sometimes we dont like a decision ... and can discuss it ... 8)

But shouting about others does not help.
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Sat Mar 11, 2023 11:05 pm    Post subject: Reply with quote

Quote:
pietinger

Gentoo is based on source code, with knowledge (which not everyone has, that's true) it can be read,
audited and patched or even uninstall and not be used anymore.
Not even binary programs are saved from the clever ones who do reverse technology... I'm not among those.
It would be very nice and democratic if those who have to make important decisions make public consultations,
it is a little more cumbersome but the responsibility then falls on the majority.

Regards.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sat Mar 11, 2023 11:44 pm    Post subject: Reply with quote

colo-des wrote:
It would be very nice and democratic if those who have to make important decisions make public consultations,
it is a little more cumbersome but the responsibility then falls on the majority.

I agree ... and you have said the right word: "important" ... I have the luck to live in a democratic country ... and our goverment dont care which name a new street will get ...

It is not - realistic - possible to decide everything by many people ... look to our kernel ... how many decide which patch will come into the next version ... and have you seen ... there exists "reverts" ...

I have written a guide for installing a secure Gentoo ... maybe there is a mistake in it ... I hope not ... but if yes, I would be happy if someone would tell me. And yes, I have not allowed to vote about my guide - I just did it.

What have you done the last time ... alone ... without allowness from others ?
Back to top
View user's profile Send private message
colo-des
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 97

PostPosted: Sun Mar 12, 2023 1:17 am    Post subject: Reply with quote

I don't have that luck...where I live as governments change, they tend to change the names of the streets...that says it all.

The development system is based on tests and reports as feedback, it is humanly impossible to determine all the states
of the state machine... that is understandable.
To err is human, only those who have never done anything do not err... although thinking about it, never doing anything is the worst mistake that exists.
For me nothing is completely safe or completely insecure, there are no extremes.

Many years ago around 2005 I made some guides on how to defend ourselves from the tyranny that were the mandriva repositories, I don't know who could have done it.
read or how much it was read, I had no reports, I only did it as the only defense measure, perhaps a reaction to unjustified treatment.
So if the things you do are only used by yourself, you don't have to answer to anyone, but when you know that what you do
many people can use it, you have to be more careful, although as open licenses say... nobody is responsible for anything.

Regards.
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 724
Location: /home

PostPosted: Sun Mar 12, 2023 7:07 am    Post subject: Reply with quote

colo-des wrote:

Don't want to clash with the ebuilds developers, they have their reasons for to do things the way they to make,


Opinions change, maintainers change, times change... you can't do wrong by asking, and if you give a good reason as to _why_, I'm sure the change will be made.

But as sam said, we should try to implement a way of providing EXTRA_ECONF or alike for nss to apply one's settings without having to modify ebuilds. Maybe EXTRA_NSSCONF since as sam also said, it's not really an autotools-based build system. I filed a bug to track the status https://bugs.gentoo.org/900915


colo-des wrote:

I respect them, but if don't I like their recipes, modify them or don't use them directly.


And that's a great reason to learn ebuilds which may help in the long run! And also glad Gentoo gives the opportunity to do this easily.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4146
Location: Bavaria

PostPosted: Sun Mar 12, 2023 7:28 am    Post subject: Reply with quote

colo-des wrote:
To err is human, only those who have never done anything do not err [...]

YES. We are humans and no robots.

colo-des wrote:
[...] but when you know that what you do
many people can use it, you have to be more careful, [...]

Also YES. But you can decide something in best faith ... and later you see it was an unfortunate decision. Then it is time to change it. And most people are happy if someone tell them about ... if I understand @sam_ correct ... " and I think it's worth changing as well" ... ;-)

Many regards,
Peter
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum