Skip to content

Commit 0445454

Browse files
committed
also get rid fo avahi-daemon
1 parent 193d1bd commit 0445454

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ Specific principles we prioritise:
2424

2525
## Role Modularity and Guards
2626

27+
- All automation should use modular Ansible roles, with each role responsible for a distinct area of system configuration (e.g., `ufw`, `networking`, `clamav`).
28+
- Roles that require elevated privileges, interact with system-level services, or are known to fail in CI (GitHub Actions) must be guarded using `when: not is_gh_actions` in playbooks.
29+
- If there is any doubt about CI compatibility, attempt a CI run before excluding the role.
30+
- The guard pattern (`when: not is_gh_actions`) is the standard and should be used unless evidence suggests a different approach is required.
31+
- Always document the rationale for excluding a role from CI in both the changelog and code comments.
2732

28-
### Example: cleanup_services role
2933

30-
- The `cleanup_services` role demonstrates modular automation for disabling/removing unnecessary services (e.g., ModemManager) and uses the standard CI guard (`when: not is_gh_actions`). Rationale and compliance impacts are documented in the changelog and code comments.
3134

35+
## Compliance Requirements
3236

3337
- UK Cyber Essentials is the primary compliance framework for this project.
3438
- Automation and configuration choices (e.g., enabling firewalls by default) must be justified with reference to UK Cyber Essentials requirements where relevant.

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [Disable and Remove ModemManager by Default](https://github.com/brabster/xubuntu-workstation/pull/45)
7+
## [Disable and remove unneeded services by default](https://github.com/brabster/xubuntu-workstation/pull/45)
88

99
### Added
1010

11-
- **ModemManager Disabled and Removed**: The cleanup role now disables the ModemManager service and removes the modemmanager package by default. This ensures the service is not running after reboot and the package is not present unless explicitly required.
11+
- **Unnecessary services disabled and removed**: The cleanup role now disables the ModemManager and avahi-daemon services and removes the associated packages by default. This ensures the services are not running after reboot and the packages are not present unless explicitly required.
1212

1313
### Security
1414

1515
- **Threat Model Assessment**: This change **reduces the attack surface and supports compliance with UK Cyber Essentials requirements**.
16-
- **Rationale**: ModemManager is not required for most workstation use cases and represents an unnecessary service and software package. Disabling and removing it aligns with the principle of least functionality, as mandated by UK Cyber Essentials, and reduces the risk of exploitation via unused system components.
16+
- **Rationale**: Services are not required for most workstation use cases and represents an unnecessary service and software package. Disabling and removing it aligns with the principle of least functionality, as mandated by UK Cyber Essentials, and reduces the risk of exploitation via unused system components.
1717
- **Benefit**: Ensures only necessary services are present and running, improving overall system security and regulatory compliance.
1818

1919
## [Enable UFW Firewall by Default](https://github.com/brabster/xubuntu-workstation/pull/44)

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ This install uses **ClamAV** as its antivirus solution. [CHANGELOG](CHANGELOG.md
8888

8989

9090
### Playbook
91+
- [sudo](roles/sudo) remove sudo timeout - you need to put your password in each time
92+
- [sudo](roles/sudo) restrict sudo commands to essential tasks
9193
- applying updates,
9294
- preparing installation media for the next update
9395
- temporarily starting and stopping rarely-needed services
96+
- [clamav](roles/clamav) install clamav and freshclam, add custom context menu to scan in Thunar file manager, notes versions and signature update version/date in update script
97+
- [updates](roles/updates)
9498
- update all known supply chains, incl. OS, firmware, snap, pip, clamav
9599
- apply system-level updates as root
96100
- su to user to apply user updates
97-
[cleanup_services](roles/cleanup_services): disables and removes unnecessary system services (e.g., ModemManager) to reduce attack surface and meet UK Cyber Essentials requirements. This role is excluded from CI by default using the standard guard pattern (`when: not is_gh_actions`).
101+
- [firefox](roles/firefox), [chrome](roles/chrome-browser) apply security settings by policy
98102

99103
## Testing
100104

roles/cleanup_services/tasks/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,24 @@
1919
autoremove: true
2020
update_cache: true
2121
when: not is_gh_actions
22+
23+
# Remove and disable avahi-daemon to reduce attack surface (UK Cyber Essentials: unnecessary services)
24+
- name: Stop avahi-daemon
25+
ansible.builtin.systemd:
26+
name: avahi-daemon
27+
state: stopped
28+
when: not is_gh_actions # Guard: requires elevated privileges, not CI-compatible
29+
30+
- name: Disable avahi-daemon
31+
ansible.builtin.systemd:
32+
name: avahi-daemon
33+
enabled: false
34+
when: not is_gh_actions
35+
36+
- name: Remove avahi-daemon package
37+
ansible.builtin.package:
38+
name: avahi-daemon
39+
state: absent
40+
autoremove: true
41+
update_cache: true
42+
when: not is_gh_actions

0 commit comments

Comments
 (0)