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(atlantis): permissions for .gitconfig file #384

Merged
merged 1 commit into from
May 7, 2024

Conversation

GMartinez-Sisti
Copy link
Member

@GMartinez-Sisti GMartinez-Sisti commented May 4, 2024

what

Fixes permissions for /home/atlantis/.gitconfig using defaultMode option

→ kubectl explain statefulset.spec.template.spec.volumes.secret.defaultMode
GROUP:      apps
KIND:       StatefulSet
VERSION:    v1

FIELD: defaultMode <integer>


DESCRIPTION:
    defaultMode is Optional: mode bits used to set permissions on created files
    by default. Must be an octal value between 0000 and 0777 or a decimal value
    between 0 and 511. YAML accepts both octal and decimal values, JSON requires
    decimal values for mode bits. Defaults to 0644. Directories within the path
    are not affected by this setting. This might be in conflict with other
    options that affect the file mode, like fsGroup, and the result can be other
    mode bits set.

why

Reported on #222 and runatlantis/atlantis#1257

tests

After deploying the latest chart versions with a gitconfig value we can confirm that the atlantis user won't have permissions to write to the /home/atlantis/.gitconfig file:

atlantis-0:/$ ls -lha /home/atlantis/.gitconfig
-rw-r--r--    1 root     atlantis     180 May  4 11:52 /home/atlantis/.gitconfig
atlantis-0:/$

After deploying with the fix on this PR we can see the atlantis user will be allowed to write to the file:

atlantis-0:/$ ls -lha /home/atlantis/.gitconfig
-rw-rw----    1 root     atlantis     180 May  4 12:46 /home/atlantis/.gitconfig
atlantis-0:/$

atlantis is part of the atlantis group:

atlantis-0:/$ id
uid=100(atlantis) gid=1000(atlantis) groups=1000(atlantis)

references

@GMartinez-Sisti GMartinez-Sisti self-assigned this May 4, 2024
@GMartinez-Sisti GMartinez-Sisti requested a review from a team as a code owner May 4, 2024 12:56
@GMartinez-Sisti GMartinez-Sisti changed the title fix(atlantis): permissions for .gitconfig folder fix(atlantis): permissions for .gitconfig file May 4, 2024
@GMartinez-Sisti GMartinez-Sisti merged commit ef3ced1 into runatlantis:main May 7, 2024
2 checks passed
@GMartinez-Sisti GMartinez-Sisti deleted the fix-gitconfig branch May 7, 2024 13:07
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.

gitconfig credential.helper error: Resource busy helm chart gitconfig option ignored
2 participants