Git Product home page Git Product logo

sovereign's Introduction

Build Status CII Best Practices

Introduction

Sovereign is a set of Ansible playbooks that you can use to build and maintain your own personal cloud based entirely on open source software, so you’re in control.

If you’ve never used Ansible before, you might find these playbooks useful to learn from, since they show off a fair bit of what the tool can do.

The original author's background and motivations might be of interest. tl;dr: frustrations with Google Apps and concerns about privacy and long-term support.

Sovereign offers useful cloud services while being reasonably secure and low-maintenance. Use it to set up your server, SSH in every couple weeks, but mostly forget about it.

Services Provided

What do you get if you point Sovereign at a server? All kinds of good stuff!

  • IMAP over SSL via Dovecot, complete with full text search provided by Solr.
  • POP3 over SSL, also via Dovecot
  • SMTP over SSL via Postfix, including a nice set of DNSBLs to discard spam before it ever hits your filters.
  • Virtual domains for your email, backed by PostgreSQL.
  • Spam fighting via Rspamd.
  • Mail server verification using DKIM and DMARC so the Internet knows your mailserver is legit.
  • Secure on-disk storage for email and more via EncFS.
  • Webmail via Roundcube.
  • Mobile push notifications via Z-Push.
  • Email client automatic configuration.
  • Jabber/XMPP instant messaging via Prosody.
  • An RSS Reader via Selfoss.
  • CalDAV and CardDAV to keep your calendars and contacts in sync, via ownCloud.
  • Your own private storage cloud via ownCloud.
  • Your own VPN server via OpenVPN.
  • An IRC bouncer via ZNC.
  • Monit to keep everything running smoothly (and alert you when it’s not).
  • collectd to collect system statistics.
  • Web hosting (ex: for your blog) via Apache.
  • Firewall management via Uncomplicated Firewall (ufw).
  • Intrusion prevention via fail2ban and rootkit detection via rkhunter.
  • SSH configuration preventing root login and insecure password authentication
  • RFC6238 two-factor authentication compatible with Google Authenticator and various hardware tokens
  • Nightly backups to Tarsnap.
  • Git hosting via cgit and gitolite.
  • Read-it-later via Wallabag
  • A bunch of nice-to-have tools like mosh and htop that make life with a server a little easier.

Don’t want one or more of the above services? Comment out the relevant role in site.yml. Or get more granular and comment out the associated include: directive in one of the playbooks.

Usage

What You’ll Need

  1. A VPS (or bare-metal server if you wanna ball hard). My VPS is hosted at Linode. You’ll probably want at least 512 MB of RAM between Apache, Solr, and PostgreSQL. Mine has 1024.
  2. 64-bit Debian 8.3 or an equivalent Linux distribution. (You can use whatever distro you want, but deviating from Debian will require more tweaks to the playbooks. See Ansible’s different packaging modules.)
  3. A Tarsnap account with some credit in it. You could comment this out if you want to use a different backup service. Consider paying your hosting provider for backups or using an additional backup service for redundancy.

You do not need to acquire an SSL certificate. The SSL certificates you need will be obtained from Let's Encrypt automatically when you deploy your server.

Installation

On the remote server

The following steps are done on the remote server by sshing into it and running these commands.

1. Install required packages e.g aptitude is required on Debian

apt-get install sudo python

2. Get a Tarsnap machine key

If you haven’t already, download and install Tarsnap, or use brew install tarsnap if you use Homebrew.

Create a new machine key for your server:

tarsnap-keygen --keyfile roles/tarsnap/files/decrypted_tarsnap.key --user [email protected] --machine example.com

Download a copy of this key and keep it somewhere safe! There's no point having backups if you can't retrieve them when needed.

3. Prep the server

For goodness sake, change the root password:

passwd

Create a user account for Ansible to do its thing through:

useradd --create-home deploy
passwd deploy

Authorize your ssh key if you want passwordless ssh login (optional):

mkdir /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
nano /home/deploy/.ssh/authorized_keys
chmod 400 /home/deploy/.ssh/authorized_keys
chown deploy:deploy /home/deploy -R
echo 'deploy ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/deploy

Your new account will be automatically set up for passwordless sudo. Or you can just add your deploy user to the sudo group.

adduser deploy sudo

On your local machine

Ansible (the tool setting up your server) runs locally on your computer and sends commands to the remote server. Download this repository somewhere on your machine, either through Clone or Download > Download ZIP above, wget, or git as below

git clone https://github.com/sovereign/sovereign.git

4. Configure your installation

Modify the settings in the group_vars/sovereign folder to your liking. If you want to see how they’re used in context, just search for the corresponding string. All of the variables in group_vars/sovereign must be set for sovereign to function.

For Git hosting, copy your public key into place:

cp ~/.ssh/id_rsa.pub roles/git/files/gitolite.pub

Finally, replace the host.example.net in the file hosts. If your SSH daemon listens on a non-standard port, add a colon and the port number after the IP address. In that case you also need to add your custom port to the task Set firewall rules for web traffic and SSH in the file roles/common/tasks/ufw.yml.

5. Set up DNS

If you’ve just bought a new domain name, point it at Linode’s DNS Manager or similar. Most VPS services (and even some domain registrars) offer a managed DNS service that you can use for this at no charge. If you’re using an existing domain that’s already managed elsewhere, you can probably just modify a few records.

Create A or CNAME records which point to your server's IP address:

  • example.com
  • mail.example.com
  • www.example.com (for Web hosting)
  • autoconfig.example.com (for email client automatic configuration)
  • read.example.com (for Wallabag)
  • news.example.com (for Selfoss)
  • cloud.example.com (for ownCloud)
  • git.example.com (for cgit)

6. Run the Ansible Playbooks

First, make sure you’ve got Ansible 1.9.3+ installed.

To run the whole dang thing:

ansible-playbook -i ./hosts --ask-sudo-pass site.yml

If you chose to make a passwordless sudo deploy user, you can omit the --ask-sudo-pass argument.

To run just one or more piece, use tags. I try to tag all my includes for easy isolated development. For example, to focus in on your firewall setup:

ansible-playbook -i ./hosts --tags=ufw site.yml

You might find that it fails at one point or another. This is probably because something needs to be done manually, usually because there’s no good way of automating it. Fortunately, all the tasks are clearly named so you should be able to find out where it stopped. I’ve tried to add comments where manual intervention is necessary.

The dependencies tag just installs dependencies, performing no other operations. The tasks associated with the dependencies tag do not rely on the user-provided settings that live in group_vars/sovereign. Running the playbook with the dependencies tag is particularly convenient for working with Docker images.

7. Finish DNS set-up

Create an MX record for example.com which assigns mail.example.com as the domain’s mail server.

To ensure your emails pass DKIM checks you need to add a txt record. The name field will be default._domainkey.EXAMPLE.COM. The value field contains the public key used by DKIM. The exact value needed can be found in the file /var/lib/rspamd/dkim/EXAMPLE.COM.default.txt. It will look something like this:

v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKKAQfMwKVx+oJripQI+Ag4uTwYnsXKjgBGtl7Tk6UMTUwhMqnitqbR/ZQEZjcNolTkNDtyKZY2Z6LqvM4KsrITpiMbkV1eX6GKczT8Lws5KXn+6BHCKULGdireTAUr3Id7mtjLrbi/E3248Pq0Zs39hkDxsDcve12WccjafJVwIDAQAB

For DMARC you'll also need to add a txt record. The name field should be _dmarc.EXAMPLE.COM and the value should be v=DMARC1; p=none. More info on DMARC can be found here.

Set up SPF and reverse DNS as per this post. Make sure to validate that it’s all working, for example, by sending an email to [email protected] and reviewing the report that will be emailed back to you.

8. Miscellaneous Configuration

Sign in to the ZNC web interface and set things up to your liking. It isn’t exposed through the firewall, so you must first set up an SSH tunnel:

ssh [email protected] -L 6643:localhost:6643

Then proceed to http://localhost:6643 in your web browser.

Similarly, to access the server monitoring page, use another SSH tunnel:

ssh [email protected] -L 2812:localhost:2812

Again proceeding to http://localhost:2812 in your web browser.

Finally, sign into ownCloud with a new administrator account to set it up. You should select PostgreSQL as the configuration backend. Use owncloud as the database user and the database name. For the database password ansible has created a set of random passwords for each service and stores them in your local folder secret, use the one in the file owncloud_db_password.

How To Use Your New Personal Cloud

We’re collecting known-good client setups on our wiki.

Troubleshooting

If you run into an errors, please check the wiki page. If the problem you encountered, is not listed, please go ahead and create an issue. If you already have a bugfix and/or workaround, just put them in the issue and the wiki page.

Reboots

You will need to manually enter the password for any encrypted volumes on reboot. This is not Sovereign-specific, but rather a function of how EncFS works. This will necessitate SSHing into your machine after reboot, or accessing it via a console interface if one is available to you. Once you're in, run this:

encfs /encrypted /decrypted --public

It is possible that some daemons may need to be restarted after you enter your password for the encrypted volume(s). Some services may stall out while looking for resources that will only be available once the /decrypted volume is available and visible to daemon user accounts.

IRC

Ask questions and provide feedback in #sovereign on Freenode.

sovereign's People

Contributors

adborden avatar al3x avatar ariddell avatar bcachet avatar brucespang avatar bryanjswift avatar carljm avatar danmilon avatar friz-zy avatar gelnior avatar gregkare avatar hippich avatar jlund avatar jplock avatar jsravn avatar larryfox avatar lukecyca avatar lvillani avatar mariusv avatar mikeashley avatar neuhaus avatar nstanke avatar philandstuff avatar robfeldmann avatar spk avatar synchrone avatar tilsammans avatar titan-c avatar tomasbedrich avatar yannik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sovereign's Issues

If self-signing, what takes place of wildcard_ca.pem?

I'm trying to write up how one generates a key and self-signs it. What should take the place of wildcard_ca.pem? Should it be just another copy of the .crt (again, in the event that one is self-signing). Or does one have to create a CA with its own private key?

Wildcard cert requirement

It looks like wildcard certs are quite expensive (hundreds of dollars per year). Is it absolutely required for installing Sovereign? If so, can you explain a little more about how you self-signed or point to a tutorial? A quick Google search brought up this tutorial but it seems a little too easy for something that's so expensive from a provider.

Nonstandard SSH port and ferm

If one of your first steps in setting up a new server is to change the ssh port, the ferm configuration will not anticipate you and you'll eventually find yourself locked out of your server.

  • A workaround, if you can get root access to your server, is to edit /etc/ferm/ferm.conf and add your port to the proto tcp dport list. Then load your new rules: sudo ferm ferm.conf
  • Or, don't change your SSH port!
  • A more permanent fix might be to parameterize (or detect?) this and add when ferm is installed. I don't have this fix; still trying to get my first install going! :)

Occasional 'undefined variables' errors when running playbook in non-testing mode

I seem to be having an issue with the following line in site.yml:

- vars/{{ 'testing' if testing else 'user' }}.yml

I will occasionally get an 'undefined variables' error when I am NOT running in any sort of testing mode. The following is but one example but I've seen a similar one while running the enfs tasks as well:

TASK: [webmail | Configure the Apache HTTP server for roundcube] ************** 
fatal: [000.000.000.000] => {'msg': "One or more undefined variables: 'domain' is undefined", 'failed': True}
fatal: [000.000.000.000] => {'msg': "One or more undefined variables: 'domain' is undefined", 'failed': True}

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
       to retry, use: --limit @/Users/Rob/site.retry

000.000.000.000            : ok=2    changed=1    unreachable=1    failed=0

I am able to solve these errors if I comment out the aforementioned offending line (and add - vars/user.yml) such that site.yml looks like this:

- vars/defaults.yml
- vars/user.yml
# - vars/{{ 'testing' if testing else 'user' }}.yml

Does anyone have any ideas on why this is happening?

dspam config has 64-bit library hardcoded

I installed on 32-bit debian, dspam can't find

StorageDriver /usr/lib/x86_64-linux-gnu/dspam/libhash_drv.so

because it is in

/usr/lib/i386-linux-gnu/dspam/libhash_drv.so

which leads to postfix rejecting incoming mail.

Either the README should state 64-bit as a prerequisite or ansible could configure this path depending on the platform (if it can do it, I don't know it very well).

tarsnap sha check

Would you like a PR that checks the SHA256 of the tarsnap download?

Add a role to summarize what was done.

After the install, we could display a message telling what is installed, what still remains to do (setting owncloud and znc...), urls to new web services (roundcube, owncloud, blog), and even a DNS config summary.

first five.five minutes on a server...

I asked the author about pulling some of this post:

http://lattejed.com/first-five-and-a-half-minutes-on-a-server-with-ansible

into a role for this project. I expect to replicate whats in Step 3. Getting Started in the readme for Sovereign and these steps from the blog post:

  • Update & upgrade the system via apt-get
  • Install fail2ban to block ssh brute-force attempts
  • Create a new user so we don't have to use root
  • Copy over our pub key
  • Lock down sudo
  • Lock down ssh to prevent root & password login
  • Configure unattended security upgrades

It would ease new user setup and address #92

I've got time to work on it this weekend and can send a pull request if that's the kind of thing you're in to for this project. Lemme know.

dovecot.index.log permission error

I have a bunch of these errors littering /var/log/mail.err:

Sep 25 00:20:39 vps1 dovecot: imap([email protected]): 
    Error: link(/decrypted/lukecyca.com/me/dovecot.index.log,
    /decrypted/lukecyca.com/me/dovecot.index.log.2) failed: 
    Operation not permitted

Enable Roundcube's managesieve plugin

I've been trying to enable the managesieve plugin of Roundcube which provides a decent GUI for managing server-side filters or rules. So far I've been unsuccessful as I get an "Unable to connect to server" error message in Roundcube no matter what I try. This post sums up the issue pretty nicely: http://www.sunfinedata.com/tutorial/enable-the-managesieve-of-dovecot-and-use-it-in-roundcubemail/, though it did not solve the problem.

This should probably be tagged as an 'enhancement' request. If anyone can get this working or help me figure this out I'd be grateful!

"No closing quotation" error in Vagrant.

I'm at commit #7240e65644 When running inside vagrant, I get the following error:

vagrant@ansible:/vagrant$ sudo ansible-playbook -i ./hosts site.yml

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 209, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-playbook", line 84, in main
    inventory = ansible.inventory.Inventory(options.inventory)
  File "/usr/lib/python2.7/dist-packages/ansible/inventory/__init__.py", line 91, in __init__
    self.parser = InventoryParser(filename=host_list)
  File "/usr/lib/python2.7/dist-packages/ansible/inventory/ini.py", line 40, in __init__
    self._parse()
  File "/usr/lib/python2.7/dist-packages/ansible/inventory/ini.py", line 44, in _parse
    self._parse_base_groups()
  File "/usr/lib/python2.7/dist-packages/ansible/inventory/ini.py", line 80, in _parse_base_groups
    tokens = shlex.split(line)
  File "/usr/lib/python2.7/shlex.py", line 279, in split
    return list(lex)
  File "/usr/lib/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/usr/lib/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib/python2.7/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"
ValueError: No closing quotation

Tarsnap and security

The default configuration stores tarsnap's key in /root/tarsnap.key and backs up /decrypted_mail to tarsnap.

Unless I misunderstand, this seems to mean that an attacker who gains physical access to the drive gains access to the unencrypted tarsnap key and can then gain access to tarsnap backups containing unencrypted mail.

The solution then seems to be one of two options:

  1. back up encrypted-mail, not decrypted-mail

Pros:

  • Defends against any theoretical weakness in tarsnap

Cons:

  • Encrypted data doesn't deduplicate as well.
  • Attacker still gains access to all backups, possibly useful for an attack.
  1. move key to /decrypted-mail
    Pros:
  • Key is never unencrypted-at-rest on the drive
  • Attacker can't gain access to backups

Cons:

  • Trusts tarsnap
  1. move key to /decrypted-mail and back up /encrypted-mail
    Pros:
  • Most secure option

Cons:

  • Encrypted data doesn't deduplicate well

I'm personally going with 2 for now. Happy to submit a pull request for this one; thanks for all the great work on Sovereign!

fail2ban emails

I'm getting about a dozen emails per day telling me that a particular IP has been banned. I don't see much use in these, so I think we should stop sending them.

OpenVPN client and CA certificates expire after a month

The Server certificate remains valid for an extended period of time, but the rest of the certificates expire only 30 days after they were first generated. Flags need to be added to the certificate generation commands to prevent this from happening, and the number of days that a certificate will remain valid should be a user-configurable setting.

WebMail

Supply/configure RoundCube Webmail would be nice. I, and others I know, tend to use webmail more than native apps. RoundCube, IMO, functions a lot like Gmail.

http://roundcube.net

Testing.yml password for [email protected] email account?

When testing/using the development environment (VM), what is the email password for the "[email protected]" user? I see from the testing.yml file, the password line reads:

password_hash: "$6$.f8oDqN1cDE/$Iyk8.scbwZCxw5pf9Flcvu.VYk9Jk77y/UaM0DyIcw9wouNqifXr3xV1fQPPNgBIM3BEEabAxePtC5Y/iX5vH1" #foo

I'm not sure what the comment #foo refers to? It's not the password I don't think.

Am I supposed to change this myself?

Thanks!

SORBS rejected an email from my parents' gmail account

Sep 26 18:56:43 vps1 postfix/smtpd[28379]: 
    NOQUEUE: reject: RCPT from mail-ie0-f172.google.com[209.85.223.172]:
    554 5.7.1 Service unavailable; Client host [209.85.223.172] blocked
    using dnsbl.sorbs.net; Currently Sending Spam
    See: http://www.sorbs.net/lookup.shtml?209.85.223.172;
    from=<[email protected]> to=<[email protected]>
    proto=ESMTP helo=<mail-ie0-f172.google.com>

That's a legit gmail server. Out of all the spams blocked by RBLs, SORBS has rejected one for me, and it was this false positive!

# grep "blocked using" /var/log/mail.log* | wc -l
273
# grep "blocked using dnsbl.sorbs.net" /var/log/mail.log* | wc -l
1

For now I'm going to take it out of my configuration.

An article on the dspam wiki suggests using policyd-weight so that no single RBL causes a rejection:

I am not trusting one single RBL. Never ever would I do that!

From policyd-weight's homepage:

Postfix' built-in checks can be too tough for poorly configured clients: one hit, and the mail gets rejected.

That sounds good to me. What does everyone else think?

Fails on znc install?

It doesn't seem to like the --enable-python option:

TASK: [Build and install znc] ************************************************* 
failed: [37.139.30.53] => {"changed": true, "cmd": ["./configure", "--enable-python", ";", "make", ";", "make", "install"], "delta": "0:00:00.004606", "end": "2013-08-24 00:41:13.029741", "item": "", "rc": 2, "start": "2013-08-24 00:41:13.025135"}
stderr: ./configure: --enable-python: invalid option
Usage:  ./configure [GNU long option] [option] ...
    ./configure [GNU long option] [option] script-file ...

bug in monit config for tomcat

sovereign / roles / monitoring / files / etc_monit_conf.d_tomcat
contains this block:

  start program = "/etc/init.d/tomcat6 start"
  as uid6 tomcat gid tomcat6
  stop program = "/etc/init.d/tomcat6 stop"
  as uid6 tomcat gid tomcat6

which should be:

  start program = "/etc/init.d/tomcat6 start"
  as uid tomcat6 gid tomcat6
  stop program = "/etc/init.d/tomcat6 stop"
  as uid tomcat6 gid tomcat6

Comment every variable

Add a comment to each variable in vars/defaults.yml and vars/user.yml to explain what it does and how to use it.

Question: Dovecot/IMAP user creation

I am setting up a server with the following config:

mail_server_hostname: example.com
mail_mysql_username: mailuser
mail_mysql_password: password
mail_mysql_database: mailserver
mail_virtual_domains:
  - name: example.com
    pk_id: 1
    primary_user: bill
mail_virtual_users:
  - address: [email protected]
    password_hash: HASH
    domain_pk_id: 1
  - address: [email protected]
    password_hash: HASH
    domain_pk_id: 1

When I run ansible, the users are added to the mysql database(virtual_users) correctly, but only the "primary" user has a directory created under /decrypted-mail/example.com/

eg /decrypted-mail/example.com/bill

When I try and login using [email protected] the following appears in /var/log/mail.log

mail.warn:Sep  3 08:32:30 (none) dovecot: imap([email protected]): Error: user [email protected]: Initialization failed: Namespace '': mkdir(/decrypted-mail/example.com/steve) failed: Permission denied (euid=5000(vmail) egid=5000(vmail) missing +w perm: /decrypted-mail/example.com, dir owned by 0:0 mode=0755)
mail.warn:Sep  3 08:32:30 (none) dovecot: imap([email protected]): Error: Invalid user settings. Refer to server log for more information.

Should that directory be created by ansible during setup? Or should it be created by dovecot when the user first logs in? If the latter, then do we need to modify the permissions so it can create the directory?

Cheers,

Jordan

Adding server's IP and DNS to etc_opendkim_TrustedHosts.j2

I'm having trouble making sense of this.

What should I be doing in roles/mailserver/templates/etc_opendkim_TrustedHosts.j2?

Contents of the file:

127.0.0.1                                                                   
# TODO add your server's IP and DNS hosts                                   
{% for domain in mail_virtual_domains %}                                    
{{ domain.name }}                                                           
{% endfor %}                                                                
{% for domain in mail_virtual_domains %}                                    
mail.{{ domain.name }}                                                      
{% endfor %} 

Could you provide an example of what this might look like with the info added?

Use Docker to contain each application/service

Rather than installing each service directly on the machine, we should dockerize some or all of them. This would allow the services to better coexist with other customizations people make on their server.

This may require switching to Ubuntu as the supported distro.

Extract PKCS11* env variables as variables

I'm not familiar with setting up openvpn, but I've stumbled upon this while working on #39: https://github.com/al3x/sovereign/blob/1e9a560ff6351fadbb4196d3a8ca06a130e04b95/roles/vpn/templates/etc_openvpn_easy-rsa_2.0_vars.j2#L71-L72

export PKCS11_MODULE_PATH=changeme
export PKCS11_PIN=1234

I think those should be extracted as variables, especially now that we can have "mandatory" attributes, it's too easy to miss and it probably has an impact on security.

More modular firewall either with ferm or with ufw

It would be nice to have a more modular firewall, i.e., if you're not using XMPP you shouldn't have to have that port open in the ferm.conf (in roles/common)

This can be done with ferm and its include directive but ufw seems (to me at least) very easy to use and well-maintained.

Would there be any openness to a pull request?

XMPP Support

eJabberd server with postgres auth would fit in nicely

Export Tarsnap install in a dedicated role

I don't use tarsnap, so I must comment "- tarsnap.yml" out in roles/common/tasks/main.yml putting it in a dedicated role would give a more consistent behaviour, I'd just comment it in site.yml

Apache -> Nginx?

Several people have inquired about using Nginx, as it's lighter-weight than Apache. I'm open to the idea.

This Nginx config has some nice features, particularly when it comes to SSL, and could be used as a base template.

Ansible 1.4 is required?

Commit f64ad69 introducted the "failed_when" module variable which in turn has been added in ansible 1.4.

This causes an issue when running the playbooks with installations prior to 1.4 (for example, at the time I'm writing this, Homebrew is still sitting on ansible 1.3.3).

encfs security

Hello,

I'm not sure I understand the point of encfs, or perhaps how it is implemented:

If the machine is considered trusted, then what's the point of encryption (not considering possible loss here like a laptop because it is always remote anyway)?

If the machine is not trusted, it cannot be allowed access to the decryption key, and thus cannot decrypt email, etc.

Is everything here done in-browser/mail client on the fly? I guess not, since I don't know whether such technology exists today, and even so, it probably wouldn't be compatible with search...

Can you please explain either how encfs is used (if I misunderstood something) or its utility (if understood correctly)?

Thanks in advance!

Private key needed at the top of file referenced by SSLCertFile in znc configuration

In the SSL task under common roles, the following lines generate a combined certificate that is referenced in the template znc configuration file:

- name: Create a combined version of the public cert with intermediate and root CAs
  shell: cat /etc/ssl/certs/wildcard_public_cert.crt /etc/ssl/certs/wildcard_ca.pem >
    /etc/ssl/certs/wildcard_combined.pem creates=/etc/ssl/certs/wildcard_combined.pem

The znc documentation for setting up SSL suggests that SSLCertFile needs to reference a file that leads with a private key, followed by your certificate and the certificate bundle.

I had to execute the following to get znc to play nice with my Comodo wildcard certificate:

$ sudo cat /etc/ssl/private/wildcard_private.key /etc/ssl/certs/wildcard_combined.pem > /tmp/znc.pem
$ sudo mv /tmp/znc.pem /var/lib/znc
$ sudo chown znc:znc /var/lib/znc/znc.pem

From here I altered SSLCertFile to point to /var/lib/znc/znc.pem instead of /etc/ssl/certs/wildcard_combined.pem.

Anyone else hit anything similar? Is this worth a pull request against the znc tasks?

ufw fails to enable cleanly

Following @ariddell's contribution, I switched my server to use ufw instead of ferm, and ran into this problem:

TASK: [Check status of ufw] ***************************************************
ok: [vps1.lukecyca.com]

TASK: [Enable ufw] ************************************************************
failed: [vps1.lukecyca.com] => {"changed": true, "cmd": ["ufw", "--force", "enable"],
"delta": "0:00:00.720280", "end": "2013-10-27 21:17:00.421354", "item": "", "rc": 1,
"start": "2013-10-27 21:16:59.701074"}
stderr: ERROR: problem running ufw-init

I logged in and ran it manually, and got a different error:

root@vps1:~# ufw --force enable
ERROR: Could not load logging rules

The firewall is running and operating properly, but the enable command fails to mark itself as enabled in /etc/ufw/ufw.conf, so it fails to start at boot (which I think is a problem).

Upon further investigation, it seems there is a bug whereby ufw logging is incompatible with our version of iptables. A fix has been committed, but it's not fixed in the version we're using (0.31.1-2).

If we turn logging off, this bug goes away and the enable command works fully, but I'm not sure that's a good solution.

My email is webscale

Can you please add a webmail client that uses NODE.js and email server backed by MongoDB? This way when my email needs scaling I can just add servers.

TIA

SMTP + TLS

Hello,

I have performed a fresh install of the distribution on a debian 7 system.

I do not manage to connect to SMTP with the command

$ openssl s_client -connect mail.domain.com:465

Log message is the following

Sep 18 16:57:03 ks33 postfix/smtps/smtpd[9030]: warning: cannot get RSA private key from file /etc/ssl/private/wildcard_private.key: disabling TLS support
Sep 18 16:57:03 ks33 postfix/smtps/smtpd[9030]: warning: TLS library problem: 9030:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:x509_cmp.c:330:
Sep 18 16:57:03 ks33 postfix/smtps/smtpd[9030]: warning: hostname 80-83-52-2.csm-inst.ch does not resolve to address 80.83.52.2: Name or service not known
Sep 18 16:57:03 ks33 postfix/smtps/smtpd[9030]: connect from unknown[80.83.52.2]
Sep 18 16:57:03 ks33 postfix/smtps/smtpd[9030]: warning: Wrapper-mode request dropped from unknown[80.83.52.2] for service smtps. TLS context initialization failed. For details see earlier warnings in your logs.
Sep 18 16:57:03 ks33 postfix/smtps/smtpd[9030]: disconnect from unknown[80.83.52.2]

The wildcard_private.key certificate seem validate

$ openssl rsa -in /etc/ssl/private/wildcard_private.key -check -noout
RSA key ok

I wonder if problem is with permission for vmail/postfix users:

$ ls -l /etc/ssl/private/
total 8
-rw-r----- 1 root ssl-cert 1704 Sep 18 13:47 ssl-cert-snakeoil.key
-rw-r--r-- 1 root root     1679 Sep 18 13:51 wildcard_private.key

I have already install sovereign distrib on this server 2 weeks ago. Worked fine. I just want to update everything with last modifications. I fully reinstall debian (disk format) but now, I do not manage to get it work

Any hint

Sincerely

Bertrand

Privacy patch for postfix

Thoughts on including the header replacement for postfix to strip out the client's sending IP?
https://we.riseup.net/debian/mail#getting-your-postfix-anonymized

apt-get install postfix-pcre

grep smtp_header_checks /etc/postfix/main.cf

smtp_header_checks = pcre:/etc/postfix/maps/smtp_header_checks.pcre

cat /etc/postfix/maps/smtp_header_checks.pcre

/^\s_(Received: from)[^\n](.)/ REPLACE $1 [127.0.0.1](localhost [127.0.0.1])$2
/^\s_User-Agent/ IGNORE
/^\s_X-Enigmail/ IGNORE
/^\s_X-Mailer/ IGNORE
/^\s*X-Originating-IP/ IGNORE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.