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

[BUG] Hauler cannot load copy images to registry from RHEL8 system when $HOME has noexec flag set #249

Open
NullOranje opened this issue Jun 10, 2024 · 6 comments
Labels
bug Something isn't working priority/review size/M Denotes an issue/PR requiring a relatively moderate amount of work
Milestone

Comments

@NullOranje
Copy link

Environmental Info:

Hauler Version:

  • GitVersion: 1.0.3
  • GitCommit: 7fc24f6
  • GitTreeState: clean

Describe the Bug:

  • When attempting to run hauler store copy <registry> on a RHEL8 STIG'd system, hauler throws an error ERR fork/exec /home/<user>/.hauler/cosign: operation not permitted"

Steps to Reproduce:

  • Copy Hauler to any authorized path (without noexec flag set) (e.g., /usr/local/bin)
  • Load images into local airgapped store: hauler store load <archive>
  • Run hauler store copy registry://<registry>
  • Observe the error above

Expected Behavior:

  • Command should run to completion.

Actual Behavior:

  • cosign attempts to run from inside ${HOME}/.hauler/cosign. This is unauthorized behavior according to DISA and blocked.

Additional Context:

  • Need to be able to specify another path or, preferably, an external cosign binary that is pre-positioned
@NullOranje NullOranje added the bug Something isn't working label Jun 10, 2024
@zackbradys zackbradys added the size/M Denotes an issue/PR requiring a relatively moderate amount of work label Jun 12, 2024
@zackbradys
Copy link
Member

hey @NullOranje, thank you for submitting this issue! we will begin testing and validating it and let you know our way forward. please let us know if there is any additional information.

@dweomer
Copy link
Contributor

dweomer commented Jun 28, 2024

Dunno if such is STIG compliant but a workaround might be to setup a $HOME/.config/systemd/hauler.mount unit that sets up a bind-mount for $HOME/.hauler to something like /var${HOME}/.hauler or something similar?

@NullOranje
Copy link
Author

I did something similar. I moved the bin to an allowed path and set a symlink ${HOME}/.hauler/cosign to the binary. It seems to be workable solution for now.

@zackbradys zackbradys added this to the Hauler v1.1.0 milestone Jul 31, 2024
@jaredpricedev
Copy link

jaredpricedev commented Aug 14, 2024

I have attempted the workaround for this by trying to do a symbolic link from a lvm that does not have noexec set but I am still getting this error.

I also attempted to make the serviced with the following code:

[Unit]
Description=Data mount

[Mount]
What=/var/root/.hauler
Where=/root/.hauler
Type=none
Options=bind

[Install]
WantedBy=multi-user.target

I have turned off selinux and fips to test if that was getting in the way as well and it was still not working. I don't mind looking into resolving if this is not being currently worked. I have had no issues running the binary directly when it is in the /root/.hauler/cosign.

@zackbradys
Copy link
Member

Hey @NullOranje, that is what most customers are doing when running into this issue. Thanks for your patience on this.

I did something similar. I moved the bin to an allowed path and set a symlink ${HOME}/.hauler/cosign to the binary. It seems to be workable solution for now.

@zackbradys
Copy link
Member

zackbradys commented Aug 14, 2024

Hey @jaredpricedev! If you have the time, then it would be appreciated!

We were discussing implementing a similar function to the tempdir directory override that was implemented a few versions ago so users can use the flag --tempdir/-t and change the default temporary directory so creating something similar for the configuration directory would be a good starting point. Possibly --configdir/-c?

https://github.com/hauler-dev/hauler/blob/main/cmd/hauler/cli/store/load.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/review size/M Denotes an issue/PR requiring a relatively moderate amount of work
Projects
Status: Work In Progress
Development

No branches or pull requests

4 participants