os-hardening (Ansible Role)

This Ansible collection provides battle tested hardening for Linux, SSH, nginx, MySQL
Under Apache License 2.0
By dev-sec

linux ansible protection hacktoberfest nginx collection role playbook hardening ansible-collection sysctl mysql-hardening os-hardening ssh-hardening devsec nginx-hardening

Ansible Collection - devsec.hardening


This collection provides battle tested hardening for:

The hardening is intended to be compliant with the Inspec DevSec Baselines:

Looking for the old ansible-os-hardening role?

This role is now part of the hardening-collection. You can find the old role in the branch legacy.

Minimum required Ansible-version

Included content

In progress, not working:


Install the collection via ansible-galaxy:

ansible-galaxy collection install devsec.hardening

Using this collection

Please refer to the examples in the readmes of the role.

See Ansible Using collections for more details.

Contributing to this collection

See the contributor guideline.

Release notes

See the changelog.



More information

General information:


Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.