Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the actual default Debian Stretch configuration for jail.conf #77

Merged
merged 4 commits into from Jul 29, 2018

Conversation

smortex
Copy link
Member

@smortex smortex commented Jul 25, 2018

Pull Request (PR) description

While trying to fix a problem with the Debian Stretch template (imap3 port is not defined in Debian Stretch), I realized that the default template of jail.conf on Debian Stretch is a slightly modified version of the default template for Debian Jessie, and not the actual default files provided in Debian Stretch.

As stated in this configuration file, jail.conf has been heavily refactored in 0.9.0 release.

This pull-request integrates the actual default template, adjusted to allow customization through the module.

In order to ease-up reviewing, here is a diff between the original file as provided in the Debian package and the template included in this PR.

The enabled lines have been checked to match the sections names, and only the sshd and sshd-ddos do not match the enabled lines in to match the other templates.

This incidentally fixes the root problem addressed in #75, but if this PR is accepted, I can follow-up in that other PR to include the acceptance tests.

This Pull Request (PR) fixes the following issues

n/a

The provided template was an adaptation of the previous Debian release
(Jessie) with minor adjustments.  The actual file happen to be very
different.
@smortex smortex changed the title Debian stretch imap3 Use the actual default Debian Stretch configuration for jail.conf Jul 25, 2018
Debian stretch does not have an imap3 entry in /etc/service, but this
port is referenced in the default jail.conf configuration file.

THe problem was addressed upstream, but the fix was not rolled-out to
the Debian package:
fail2ban/fail2ban#1942

Fix this locally so that these jails do not fail to start.
@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet labels Jul 25, 2018
@bastelfreak
Copy link
Member

Hi @smortex , thanks for the patch! can you please also add debian 9 to the metadata.json? Are you interested in turning this into a epp template? that would make the required testing way easier.

@smortex
Copy link
Member Author

smortex commented Jul 25, 2018

Hi @bastelfreak !

I added a commit to include Debian 9 in metadata.json.

I believe that switching to epp is a good idea, but it seems that this need quite some work. As far as I understand, templates are rendered by extlib with default_content(). This function can currently only call template(), that is process erb templates.

So the first step might be to check if template_name ends with .erb or .epp and call template() or epp() accordingly, but this slightly changes the API of the library since there where previously no restriction on the template name for rendering it to erb 😕.

Do you think this is an issue?

@smortex
Copy link
Member Author

smortex commented Jul 26, 2018

Rubocop test timed-out before starting on Travis-CI. I want my green ✔️!

@smortex smortex closed this Jul 26, 2018
@smortex smortex reopened this Jul 26, 2018
@bastelfreak bastelfreak removed the needs-work not ready to merge just yet label Jul 29, 2018
@bastelfreak
Copy link
Member

Thanks for the work @smortex. We are doing a new extlib release in voxpupuli/puppet-extlib#104. If you're interested you can convert the template after it got released from erb to epp.

@bastelfreak bastelfreak merged commit cee5226 into voxpupuli:master Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants