Project

General

Profile

Actions

action #177066

closed

coordination #161414: [epic] Improved salt based infrastructure management

Prevent _openqa-worker to install random packages size:S

Added by okurz about 1 month ago. Updated 18 days ago.

Status:
Resolved
Priority:
Normal
Category:
Feature requests
Start date:
2025-02-12
Due date:
% Done:

0%

Estimated time:

Description

Motivation

https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/21108/files#diff-c61b6b7d08adaeb720aec789fbe11aff6a52dc44c3abc09b428fb8cb8cc46fa5R799 - "anything that speaks against removing sudo-permissions to [_openqa-worker] user?"

we already explicitly only give sudo to each individual but also _openqa-worker in https://gitlab.suse.de/openqa/salt-states-openqa/-/blob/master/openqa/worker.sls#L323 which apparently is needed for the openQA multi-machine setup, possibly /etc/wicked/scripts/gre_tunnel_preup.sh
But we never gave sudo to _openqa-worker on o3 workers and there is apparmor. It can't be that severe. How about just removing that rule and then we can selectively remove the residing file one by one and monitor?

Acceptance criteria

  • AC1: _openqa-worker is not able to execute any commands with root level permissions

Suggestions

  • Learn https://neo-layout.org/ to type faster
  • Remove the rule from salt
  • Then remove the sudoers file for _openqa-worker on workers one by one and monitor for impact, e.g. auth denied in logs or system journal or openQA tests failing, etc.
  • Inform in the original PR

Related issues 1 (0 open1 closed)

Related to openQA Infrastructure (public) - action #177393: salt pipelines fail due to missing shadow on w16+17Resolvednicksinger2025-02-17

Actions
Actions #1

Updated by okurz about 1 month ago

  • Tracker changed from coordination to action
Actions #2

Updated by jbaier_cz 27 days ago

  • Related to action #177393: salt pipelines fail due to missing shadow on w16+17 added
Actions #3

Updated by jbaier_cz 27 days ago

  • Description updated (diff)
Actions #4

Updated by robert.richardson 27 days ago

  • Subject changed from Prevent _openqa-worker to install random packages to Prevent _openqa-worker to install random packages size: S
  • Description updated (diff)
  • Status changed from New to Workable
Actions #5

Updated by robert.richardson 21 days ago

  • Status changed from Workable to In Progress
Actions #6

Updated by jbaier_cz 21 days ago

  • Assignee set to robert.richardson

I guess you are working on it?

Actions #7

Updated by robert.richardson 20 days ago

jbaier_cz wrote in #note-6:

I guess you are working on it?

Just started with the suggested PR.
So not much done yet, do you want to take the ticket instead ?

Actions #8

Updated by openqa_review 20 days ago

  • Due date set to 2025-03-11

Setting due date based on mean cycle time of SUSE QE Tools

Actions #9

Updated by okurz 19 days ago

  • Subject changed from Prevent _openqa-worker to install random packages size: S to Prevent _openqa-worker to install random packages size:S
Actions #10

Updated by livdywan 19 days ago

As discussed:

Actions #11

Updated by livdywan 19 days ago ยท Edited

  • Please provide examples of jobs that run (not necessarily passing)
# TAPSCRIPT requires _openqa-worker to be able to sudo

This comment in salt implies this affects multi-machine tests. Somehow it wasn't clear to me that it doesn't affect other cases.

Actions #12

Updated by robert.richardson 19 days ago

  • Status changed from In Progress to Resolved

I have manually removed the file /etc/sudoers.d/_openqa-worker from several workers (diesel, grenache, mania, worker29 - worker 40) yesterday and so far couldn't find any permission related errors.
-> example run with parallel dependencies
so i have now removed the file from all workers

> sudo salt -C 'G@roles:worker' cmd.run 'rm /etc/sudoers.d/_openqa-worker'
Actions #13

Updated by okurz 18 days ago

  • Due date deleted (2025-03-11)

today's osd deployment failed due to an agama_devel repository which was also pulled in by tests. I fixed that with sudo salt \* cmd.run 'zypper rr systemsmanagement_Agama_Devel' . I assume the work in this ticket is enough to prevent that in the future

Actions

Also available in: Atom PDF