Title: RabbitMQ restore drill: root writes into a directory under one the rabbitmq user can rename · Issue #544 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: RabbitMQ restore drill: root writes into a directory under one the rabbitmq user can rename · Issue #544 · cloudfall-dev/cloudfall
X Title: RabbitMQ restore drill: root writes into a directory under one the rabbitmq user can rename · Issue #544 · cloudfall-dev/cloudfall
Description: Found in the review of #540 (RabbitMQ restore drill, #511). cloudfall-rabbitmq-restore-check runs as root and makes its scratch directory at /var/lib/rabbitmq/cloudfall-restore-check. The parent, /var/lib/rabbitmq, is owned by and writab...
Open Graph Description: Found in the review of #540 (RabbitMQ restore drill, #511). cloudfall-rabbitmq-restore-check runs as root and makes its scratch directory at /var/lib/rabbitmq/cloudfall-restore-check. The parent, /...
X Description: Found in the review of #540 (RabbitMQ restore drill, #511). cloudfall-rabbitmq-restore-check runs as root and makes its scratch directory at /var/lib/rabbitmq/cloudfall-restore-check. The parent, /...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/issues/544
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RabbitMQ restore drill: root writes into a directory under one the rabbitmq user can rename","articleBody":"Found in the review of #540 (RabbitMQ restore drill, #511).\n\n`cloudfall-rabbitmq-restore-check` runs as root and makes its scratch directory at `/var/lib/rabbitmq/cloudfall-restore-check`. The parent, `/var/lib/rabbitmq`, is owned by and writable by the `rabbitmq` user. Between root's `mkdir -m 0700 \"${scratch}\"` and the `chown -R` that follows, root creates `home/`, `conf.d/`, `data/`, `log/` and copies the export (`definitions.json`, which holds password hashes) and the scratch node's configuration into it. A process running as `rabbitmq` can rename the fresh directory in that window and put a symlink in its place, so root's later writes follow the link into a directory it picks.\n\nReproduce (on a host with the role converged): as `rabbitmq`, loop renaming `/var/lib/rabbitmq/cloudfall-restore-check` and linking that name to `/tmp/elsewhere`, while root runs `cloudfall-rabbitmq-restore-check`; root's copy of the export lands in `/tmp/elsewhere`.\n\nImpact is narrow: it needs code running as the service account, which already reads the live node's definitions. Still, root should not write through a path another user controls.\n\nSuggested fix: keep the decided path, but have root write nothing below `/var/lib/rabbitmq` by path: create the scratch tree as the `rabbitmq` user (`runuser -u rabbitmq -- mkdir ...`) and stream the export and configuration into it through that user (`runuser -u rabbitmq -- tee ... \u003c root-owned source`), or open the directory once and use `*at`-style operations from Python. A test that plants the link before the copy and asserts no write lands outside the scratch tree proves it.\n\nTouches `engine/ansible/roles/cloudfall_rabbitmq/templates/restore-check.sh.j2`, `engine/tests/test_s023_rabbitmq_backup.py`.\n\n\u003c!-- shipmill:agent -->\n","author":{"url":"https://github.com/apps/shipmill-romamo","@type":"Person","name":"shipmill-romamo"},"datePublished":"2026-11-18T12:13:52Z","url":"https://github.com/cloudfall-dev/cloudfall/issues/544"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:94471888-9929-025b-312d-ec504e252edc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB76:4AA2A:19BAA7E:21DF6C6:6B0559C8 |
| html-safe-nonce | 7c4295634b8fe82bd67c22bd5fedf3309da5e0b27da52449be8c4f53824f34ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjc2OjRBQTJBOjE5QkFBN0U6MjFERjZDNjo2QjA1NTlDOCIsInZpc2l0b3JfaWQiOiIxNzI0MTI5MjE3MzUwMDMxODE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1ac75e00189b819a85667f4a900ef9e77fc49dd6665a37a2101abed9402c9d94 |
| hovercard-subject-tag | issue:6466875290 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cloudfall-dev/cloudfall/544/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75f276188adb582c77fb437e7480a3168ba1b0424c725ad6db447dfbb8397cbf/cloudfall-dev/cloudfall/issues/544 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75f276188adb582c77fb437e7480a3168ba1b0424c725ad6db447dfbb8397cbf/cloudfall-dev/cloudfall/issues/544 |
| og:image:alt | Found in the review of #540 (RabbitMQ restore drill, #511). cloudfall-rabbitmq-restore-check runs as root and makes its scratch directory at /var/lib/rabbitmq/cloudfall-restore-check. The parent, /... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shipmill-romamo[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | a79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080 |
| turbo-cache-control | no-preview |
| go-import | github.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git |
| octolytics-dimension-user_id | 339512759 |
| octolytics-dimension-user_login | cloudfall-dev |
| octolytics-dimension-repository_id | 1360999777 |
| octolytics-dimension-repository_nwo | cloudfall-dev/cloudfall |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1360999777 |
| octolytics-dimension-repository_network_root_nwo | cloudfall-dev/cloudfall |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10dff83edfd4f3617a7792a152d44991587b434c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width