Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMH committed Sep 29, 2024
0 parents commit 26530b3
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/anisble-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: ansible-lint
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
linting:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4

- name: Add Ansible
run: sudo apt-get install -y ansible

- name: Linting
uses: ansible/ansible-lint@main
with:
requirements_file: "requirements.yaml"
47 changes: 47 additions & 0 deletions CUPS_remove.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
- name: Playbook to remove CUPS related folders and packages
hosts: all
gather_facts: true
become: true
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:

- name: GENERAL | remove packages
ansible.builtin.package:
name:
- cups
- cups-bsd
- cups-client
- cups-common
- cups-core-drivers
- cups-daemon
- cups-filters
- cups-filters-core-drivers
- cups-ppdc
- cups-server-common
- cups-browsed
state: absent

- name: SNAP | remove packages
community.general.snap:
name:
- cups-proxyd
- cups-browsed
- cups
state: absent
failed_when: false
when:
- "'snap' in ansible_env.PATH"

- name: GENERAL | Remove multiple directories
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- /etc/cups
- /var/spool/cups
- /var/cache/cups
- /var/log/cups
- /var/lib/cups
- /var/snap/cups
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[![ansible-lint](https://github.com/LucaMH/CUPS_removal-private/actions/workflows/anisble-lint.yaml/badge.svg)](https://github.com/LucaMH/CUPS_removal-private/actions/workflows/anisble-lint.yaml)

# Playbook to remove CUPS completly from systems due to recent CUPS vulnerabilities

## run removal playbook:
```bash
ansible-playbook -l <limit> CUPS_remove.yaml
```

## more info about the issues

from the reporter: https://www.evilsocket.net/2024/09/26/Attacking-UNIX-systems-via-CUPS-Part-I/


## found issues with this playbook?
just send a issue or pull request :)




## DISCLAIMER
If this damages your system or causes issues in your environment its your fault.
I am not responsible for you running stuff you didn't verify before running.
3 changes: 3 additions & 0 deletions requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
collections:
- name: community.general

0 comments on commit 26530b3

Please sign in to comment.