Skip to content

santiagopereda/ansible-role-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role: security

SSH security configuration and hardening for Raspberry Pi and Ubuntu systems.

Requirements

  • Ansible >= 2.9
  • Target OS: Ubuntu 20.04+, Debian Bullseye+, Raspberry Pi OS

Role Description

This role provides SSH security configuration including:

  • SSH key setup and management
  • SSH service configuration and hardening
  • Optional firewall configuration (future)
  • Optional fail2ban installation (future)

Role Variables

Available variables with their default values (see defaults/main.yml):

# SSH security
configure_ssh_keys: true

# SSH service
enable_ssh_service: true

# Future security features (currently disabled for testing)
configure_firewall: false
install_fail2ban: false

Dependencies

None.

Example Playbook

---
- hosts: raspberry_pi
  become: true

  roles:
    - role: security
      vars:
        configure_ssh_keys: true
        enable_ssh_service: true

Tags

Available tags for selective execution:

  • security - Run all security role tasks
  • ssh - SSH configuration only

Example Tag Usage

# Configure SSH only
ansible-playbook playbook.yml --tags "ssh"

# Run all security tasks
ansible-playbook playbook.yml --tags "security"

Tasks Breakdown

SSH Configuration (tasks/ssh.yml)

  • Configures SSH key authentication
  • Sets up SSH service
  • Applies SSH hardening best practices

License

MIT

Author Information

This role was created as part of a modular Ansible infrastructure for Raspberry Pi deployment.

Contributing

Issues and pull requests are welcome at the repository URL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors