LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-20-2015, 02:25 AM   #16
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234

Quote:
Originally Posted by kikinovak View Post
And now I vaguely wonder if there is a less cumbersome way so different applications running as different users can "share" a certificate in a standard place between them.

Any suggestions?
Well, here's an idea:
  1. Create a system group called "certs".
  2. Add users "apache" and "prosody" to group "certs".
  3. Change permissions and ownership of your certificate and private key to "root:certs" and 640 (rw-r-----).
  4. Leave the certificate and key in the original directories and create the necessary symlinks to them in /etc/httpd/certs and /etc/prosody/certs.
This way, the users in the "certs" group have read access to the certificate and private key.

Mind you, this is just an idea, I haven't tried any of this nor considered any possible security implications. But in theory it might just work. Or not.
 
1 members found this post helpful.
Old 09-20-2015, 03:44 AM   #17
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Rep: Reputation: Disabled
Hi,

My 2 solutions:
1. More cumbersome: get the habit of creating different key/cert pair for different services as soon as possible at the learning stage
2. Aren't the services initially started as root and then they change the user? If so, the key/cert can be read with no problems at the start-up.

--
Best regards,
Andrzej Telszewski
 
Old 09-20-2015, 05:05 AM   #18
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by kikinovak View Post
The next question that puzzles me is relative to file ownership and permissions. Let me follow up on the example above. I just created a self-signed certificate for the domain "slackbox.fr". The relevant files are:
  • The certificate: /etc/ssl/mycerts/slackbox.fr.crt ;
  • The private key: /etc/ssl/private/slackbox.fr.key.
Both files belong to root:root. The private key has permissions rw-------, and I created a symlink /etc/ssl/certs/slackbox.fr.crt which points to the certificate in /etc/ssl/mycerts.

Let's say I want this certificate to be used by the Apache web server and the Prosody XMPP server. Apache runs as user apache and group apache, and likewise, Prosody runs as user prosody and group prosody. If I want these applications to access the *.crt and *.key files, ownership and permissions have to be set accordingly. But right now, the only sane way I've found is to copy these files to the application-specific directories /etc/httpd/certs and /etc/prosody/certs, and give them respectively to the apache user and group, and to the prosody user and group.
Apache initializes itself as root...
Quote:

And now I vaguely wonder if there is a less cumbersome way so different applications running as different users can "share" a certificate in a standard place between them.

Any suggestions?
As soon as you start "sharing" certificates you open a vulnerability where one such application may be used to steal the certificate used by a different application...
 
Old 09-24-2015, 04:34 AM   #19
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by Cesare View Post
Word of advice: Don't! The "free" may be tempting, but I found the barely working web pages, the non-working verification process, the abysmal customer support and the hidden costs just too painful. Either invest 8€ into a cheap Comodo certificate or wait for general availability of Mozilla's "Let's encrypt" certificates.
I'm puzzled. I just visited the Comodo website. Cheapest SSL certificates start at 76 $. Where did you see a certificate for 8 € ?
 
Old 09-24-2015, 04:41 AM   #20
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by atelszewski View Post
Hi,

My 2 solutions:
1. More cumbersome: get the habit of creating different key/cert pair for different services as soon as possible at the learning stage
This is better security as it separates the signing certificate from that application certificate - which allows for revoking a single certificate. Otherwise you have to revoke all certificates, and cause the root public key to be replaced everywhere.

This is why root certificates are generated with 7-10 year lifetimes, and certificates issued to services only last one year. The users don't have to do anything (having loaded the public key for root certificate) when a service gets a new certficiate just prior expiration.
Quote:
2. Aren't the services initially started as root and then they change the user? If so, the key/cert can be read with no problems at the start-up.
Not always. It usually depends on whether the service is using a privileged port or not, as well as how it is started. For instance, systemd (and inetd/xinetd) will start a service as the specified user as the privileged port is opened by the startup system (being systemd/inetd/xinetd) and passed to the service rather than depend on the service properly dropping privileges.
Quote:
--
Best regards,
Andrzej Telszewski
 
Old 09-24-2015, 05:44 AM   #21
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,670

Rep: Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786
Quote:
Originally Posted by kikinovak View Post
I'm puzzled. I just visited the Comodo website. Cheapest SSL certificates start at 76 $. Where did you see a certificate for 8 € ?
I just got 90 days free of SSL Cert from Comodo
https://ssl.comodo.com/free-ssl-certificate.php
 
Old 09-24-2015, 06:06 AM   #22
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by willysr View Post
I just got 90 days free of SSL Cert from Comodo
https://ssl.comodo.com/free-ssl-certificate.php
I just found out what misled me. I need a multidomain certificate (slackbox.fr, www.slackbox.fr, mail.slackbox.fr, ftp.slackbox.fr, jabber.slackbox.fr, etc.) and these are much more expensive.

I'll try a mix of StartSSL and self-signed.
 
Old 09-24-2015, 06:13 AM   #23
Cesare
Member
 
Registered: Jun 2010
Posts: 65

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by kikinovak View Post
I'm puzzled. I just visited the Comodo website. Cheapest SSL certificates start at 76 $. Where did you see a certificate for 8 € ?
I get mine from namecheap.com for currently 8,07€/year for a domain-validated Comodo PositiveSSL single domain certificate. First year is free if you also register a domain with them. Actually I thought offers like these were common for every domain registrar, but now that you've asked I checked and found a similar offer only at gandi.net.
 
Old 09-29-2015, 10:47 PM   #24
the3dfxdude
Member
 
Registered: May 2007
Posts: 735

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Quote:
Originally Posted by kikinovak View Post
Right, here goes. After another rainy day of experimenting, everything works perfectly. I have written a script to automate certificate generation as much as possible. Here it is:

..snip..

The test report on SSL Labs is now perfect, except of course for the trust part, since the stuff is self-signed.

Cheers,

Niki
Hey thanks for the discussion. I've been studying it the past few days, and the information has been helpful.

(BTW Note the typo in your shell script stateOrProvineName -> stateOrProvinceName)

I also wanted to note, going beyond self-signed is still hard to be "perfect" on the SSL Labs tests. I see 90-95% on ssl configuration, and on the trust part 100%.
 
1 members found this post helpful.
Old 09-29-2015, 10:54 PM   #25
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
Can't help with your specific config details but once you think it's all ready for secure comms try running http://testssl.sh against it.
 
Old 09-30-2015, 02:32 AM   #26
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by the3dfxdude View Post
Hey thanks for the discussion. I've been studying it the past few days, and the information has been helpful.

(BTW Note the typo in your shell script stateOrProvineName -> stateOrProvinceName)
Fixed. Thanks!
 
  


Reply

Tags
ssl, tls



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ssl/tls jmomlhm Linux - Software 3 09-08-2012 01:53 AM
Proftpd and SSL/TLS mikeheggy Linux - Networking 3 12-19-2008 10:01 AM
MITM in SSL/TLS gustavolinux Linux - Security 1 11-17-2008 12:16 PM
vsftpd ssl/tls jefffq Linux - Software 2 07-05-2005 06:38 PM
SSL vs. TLS X11 Linux - Security 8 12-17-2002 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration