You are not logged in.

#1 2016-12-04 22:05:50

Fred Barclay
Member
From: /home
Registered: 2015-02-27
Posts: 123

<SOLVED>Security considerations on AUR

Hullo mates! Long-time LMDE user here looking to jump into Arch. I've dabbled a bit with it in the past and I think it may be time to put Arch through its paces and possibly consider a switch.

So, having read the wiki article about the AUR and duly noting the warnings, I've got just one question/clarification:
How can I verify that a package on the AUR is not malicious, whether intentionally or by accident, if I've already verified that the source code is fine?

As an example, firejail is already available in Community, but let's say I wanted to install firejail-git from the AUR. I have already read all the source code on GitHub to firejail and I trust it. Looking at the snaphot I downloaded from the AUR, I see two files: .SRCINFO and PKGBUILD. I've read both of them and they look fine as well. At this point, can I be reasonably certain that running makepkg and then installing the .pkg.tar.xz file is safe?

What would be common pitfalls to look out for? It seems like it would be a good idea for me to check the source url in PKGBUILD (in this case git+https://github.com/netblue30/firejail.git) and make sure it resolves to a trusted url; is that correct?

Any other suggestions/ideas/warnings?

Thanks!

Last edited by Fred Barclay (2017-01-02 02:39:37)

Offline

#2 2016-12-04 22:13:31

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: <SOLVED>Security considerations on AUR

I'd say "all" you have to do is read the PKGBUILD and make sure it is downloading the right sources and it isn't doing anything fishy. Another thing to pay attention to is any .install files, as those will run when the package is installed.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2016-12-04 22:17:41

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: <SOLVED>Security considerations on AUR

Fred Barclay wrote:

So, having read the wiki article about the AUR and duly noting the warnings, I've got just one question/clarification:
How can I verify that a package on the AUR is not malicious, whether intentionally or by accident, if I've already verified that the source code is fine?

Aye, there's the rub.  All of the auditing of PKGBUILDS, the verification of hashes, the signatures of the maintainers are all great.  You can verify that the code you are going to run is  the code that the person who packed it intended you to run.  The question is, what is it they intend for that source code to do?  Aside from auditing the code, or following community sensus that a given set of source files are safe and verifiable, all you can do is decide the extend to which you trust the entity that wrote that code.

Edit:  Having re-read your post I could take a different take on it.  You do understand that AUR "Packages" are not binaries, but rather build the package from source (generally). So, if you have read and trust the source, the package itself will be built by you on your machine -- it does not come from the AUR.

Last edited by ewaller (2016-12-04 22:20:20)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2016-12-06 18:27:08

Fred Barclay
Member
From: /home
Registered: 2015-02-27
Posts: 123

Re: <SOLVED>Security considerations on AUR

ewaller wrote:

ou do understand that AUR "Packages" are not binaries, but rather build the package from source (generally).

Correct - that is what I was thinking.

So if I can trust the source, and if the PKGBUILD and any other included files look good, then I can trust the resulting package when I build it, right?

Offline

#5 2016-12-06 18:37:03

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: <SOLVED>Security considerations on AUR

Fred Barclay wrote:

So if I can trust the source, and if the PKGBUILD and any other included files look good, then I can trust the resulting package when I build it, right?

I do, certainly where it comes to my security.  Were I protecting other peoples' sensitive data I might check more closely.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2016-12-06 19:55:40

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: <SOLVED>Security considerations on AUR

Would you spot a sneaky, malicious code change in C code? smile

Offline

#7 2016-12-06 20:08:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: <SOLVED>Security considerations on AUR

Nope wink

The presumption was that the source is trusted and that it not become adulterated.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2016-12-06 22:57:58

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: <SOLVED>Security considerations on AUR

Fred Barclay wrote:

How can I verify that a package on the AUR is not malicious, whether intentionally or by accident...

"Malicious" means it was intentional, so what are you asking?

There aren't "common pitfalls", because AUR packages aren't hand grenades. BASH isn't the safest of languages, but pkgbuild scripts are small enough for weirdness to be obvious to at least some of the observers.

Offline

#9 2016-12-08 16:33:54

Fred Barclay
Member
From: /home
Registered: 2015-02-27
Posts: 123

Re: <SOLVED>Security considerations on AUR

brebs wrote:

"Malicious" means it was intentional, so what are you asking?

Hmmm... what would be the proper word then? I mean that the code is harmful or presented a security threat, even if it were not the author's intent.

ewaller wrote:

Were I protecting other peoples' sensitive data I might check more closely.

Could you explain a bit more? What might you check more closely?

Offline

#10 2016-12-08 16:57:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: <SOLVED>Security considerations on AUR

Is there a point to this thread on which we can converge? Or is this a never ending philosophical discussion?

Specifically, say you were building a system that processed credit card transactions -- you would probably want to take the steps necessary to meet the requirements of PCI-DSS.  This would include code reviews, penetration testing and surveillance of the system watching for attacks.  A system that processes classified information for the US department of energy might want to look at a document like DOE M 471.2-2 for guidance.   There are endless examples of requirements documents that you can use in your Systems Engineering process.

Last edited by ewaller (2016-12-08 18:35:51)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2016-12-08 17:00:20

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: <SOLVED>Security considerations on AUR

Fred Barclay wrote:

Could you explain a bit more? What might you check more closely?

For example, can you trust your compiler? cf. https://reproducible-builds.org/docs/

However, this is a general topic and outside the scope of the AUR.

Last edited by Alad (2016-12-08 17:01:10)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#12 2016-12-08 18:02:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: <SOLVED>Security considerations on AUR

Alad wrote:

$DEITY, I love reading Ken Thompson.  Nice Link


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#13 2017-01-02 02:39:10

Fred Barclay
Member
From: /home
Registered: 2015-02-27
Posts: 123

Re: <SOLVED>Security considerations on AUR

ewaller wrote:

Is there a point to this thread on which we can converge? Or is this a never ending philosophical discussion?

Sorry for the late reply - been busy encrypting my disk and installing Arch + the holidays. I must have misunderstood your earlier post - I had thought you meant that if you were helping a friend with the AUR that you might be more careful than if you yourself were installing something from it. Anyways, I see what you mean now.

Thanks to everyone who helped me! I feel a bit better about the AUR now. smile

Last edited by Fred Barclay (2017-01-02 02:41:10)

Offline

Board footer

Powered by FluxBB