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

stickydisk: ensure runner perms are maintained when mounting stickydisk #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adityamaru
Copy link

@adityamaru adityamaru commented Dec 16, 2024

Important

Ensure runner permissions are maintained when mounting stickydisk by adjusting filesystem and mount operations in stickydisk.js.

  • Behavior:
    • In stickydisk.js, maybeFormatBlockDevice() now uses sudo for blkid, resize2fs, and mkfs.ext4 to ensure root access, setting filesystem ownership to the runner user.
    • mountStickyDisk() creates mount points without sudo and mounts with options to set file ownership and permissions for the runner user.
  • CI Workflow:
    • In .github/workflows/ci.yml, adds a step to create a Bazel cache directory on non-Windows systems.

This description was created by Ellipsis for 7b5a24c. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 7b5a24c in 39 seconds

More details
  • Looked at 70 lines of code in 2 files
  • Skipped 6 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. stickydisk.js:106
  • Draft comment:
    Using $(id -u) and $(id -g) in shell commands can lead to command injection vulnerabilities. Consider using Node.js methods to get user and group IDs and pass them as variables.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_RcuEzPr2SZA797qR


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

// -m0: Disable reserved blocks (all space available to non-root users)
// root_owner=$(id -u):$(id -g): Sets filesystem root directory owner to current (runner) user
// This ensures the filesystem is owned by runner user from the start
await execAsync(`sudo mkfs.ext4 -m0 -E root_owner=$(id -u):$(id -g) -Enodiscard,lazy_itable_init=1,lazy_journal_init=1 -F ${device}`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using $(id -u) and $(id -g) in shell commands can lead to command injection vulnerabilities. Consider using Node.js methods to get user and group IDs and pass them as variables.

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

Successfully merging this pull request may close these issues.

1 participant