fix: set sticky bit on the default directory
Metadata
Current evaluation
Merged fix for #1170 updating /var/lib/pebble/default permissions from 0777 to 01777. The added sticky bit prevents unauthorized file removal while preserving non-root write access. Affected base images require rebuilding.
Suggested action: —
No scores available.
Issue body
Describe your changes.
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/rockcraft/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [x] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [ ] I've updated the relevant release notes.
Fixes #1170.
`/var/lib/pebble/default` is intentionally world-writable so that Pebble can create its socket and state files when a rock uses a non-root `run-user`. However, mode `0777` allows users to remove or rename entries owned by other users and is reported by insecure world-writable-directory checks.
Set the directory mode to `01777`, preserving non-root write access while protecting directory entries with the sticky bit.
The mode is updated in both paths that create the directory:
- the implicit Pebble part, including rocks without services or checks;
- the layer generated when services or checks are present.
Tests now verify the complete mode with `stat.S_IMODE` instead of inspecting only the final three octal digits. Spread coverage checks the resulting image both with and without a generated Pebble layer, while retaining the existing non-root file-creation check.
After this is released, affected base images must be rebuilt and republished; the change cannot alter permissions in already-published OCI layers.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for #1170 updating /var/lib/pebble/default permissions from 0777 to 01777. The added sticky bit prevents unauthorized file removal while preserving non-root write access. Affected base images require rebuilding. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for #1170 setting /var/lib/pebble/default to mode 01777. The sticky bit prevents unauthorized file removal while preserving world-writable access for non-root Pebble. Tests and creation paths updated. Base images require rebuilding. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for #1170. Updates /var/lib/pebble/default permissions from 0777 to 01777, adding a sticky bit to prevent unauthorized file removal while preserving non-root access. Applies to all Pebble layer creation paths. Base images require rebuilding. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
10
Complexity:
15
Confidence:
95
|
needs review | Updates /var/lib/pebble/default permissions from 0777 to 01777 to add the sticky bit, preventing unauthorized entry removal while preserving non-root write access. Approved by two reviewers, CI passing, ready to merge. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
90
|
needs review | Updates /var/lib/pebble/default directory permissions from 0777 to 01777 (sticky bit) to prevent unauthorized entry removal while preserving non-root write access. Includes test updates and is approved with passing CI. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
10
Complexity:
15
Confidence:
85
|
needs review | Changes /var/lib/pebble/default permissions from 0777 to 01777 (sticky bit) to prevent unauthorized entry removal while preserving non-root access. Updates tests and covers both implicit and explicit Pebble paths. Awaiting maintainer review and CI. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
90
|
needs review | Updates /var/lib/pebble/default permissions from 0777 to 01777 (sticky bit) to prevent unauthorized entry removal while preserving non-root write access. Includes test updates and covers both implicit and generated layer paths. Currently awaiting maintainer review. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
90
|
needs review | Sets sticky bit on /var/lib/pebble/default directory mode from 0777 to 01777 to prevent unauthorized entry deletion while preserving non-root write access. Updates creation paths and tests. Currently pending maintainer review with passing CI. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related issues
No related issues found above the similarity threshold.