Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent containers from running as root by removing unnecessary anyuid SCC bindings #1460

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ugiordan
Copy link
Contributor

Description

This PR addresses the security concern of containers running with root privileges by removing the following ServiceAccounts from default RoleBindings granting the anyuid SCC:

  • Notebook
  • ModelMesh
  • ModelController
  • Dashboard

These changes help ensure that containers run with non-root user privileges and comply with security policies. Additionally, this makes the default RoleBinding that assigns the default ServiceAccount to the anyuid SCC unnecessary:

> oc get rolebinding opendatahub -oyaml | yq 'del(.metadata)'
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:openshift:scc:anyuid
subjects:
  - kind: ServiceAccount
    name: default
    namespace: opendatahub

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from asanzgom and Sara4994 December 18, 2024 15:43
Copy link

openshift-ci bot commented Dec 18, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from ugiordan. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@biswassri
Copy link
Contributor

/test opendatahub-operator-e2e

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@b36c13a). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1460   +/-   ##
=======================================
  Coverage        ?   19.12%           
=======================================
  Files           ?      158           
  Lines           ?    10354           
  Branches        ?        0           
=======================================
  Hits            ?     1980           
  Misses          ?     8150           
  Partials        ?      224           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants