terraform-provider-local
terraform-provider-local copied to clipboard
Default file permission misleading
Terraform CLI and Provider Versions
Terraform v1.3.2 on darwin_arm64
- provider registry.terraform.io/hashicorp/local v2.2.3
Terraform Configuration
resource "local_file" "dummy_file" {
content = "foobar"
filename = "./dummy.txt"
}
Expected Behavior
File is created according to the default value for attribute file_permission (0777
) which would mean:
tf@hashicorp example % ls -al dummy.txt
-rwxrwxrwx 1 tf staff 6 8 Oct 16:02 dummy.txt
Actual Behavior
File is created with the default umask permissions.
tf@hashicorp example % ls -al dummy.txt
-rwxr-xr-x 1 tf staff 6 8 Oct 16:02 dummy.txt
Steps to Reproduce
-
terraform apply
- ls -al dummy.txt
How much impact is this issue causing?
Low
Logs
No response
Additional Information
As per the documentation, if no file_permission attribute is set, the default value would be used (0777
). Happily this does not seem to be the case currently because it might be a security issue. The same issue is present for directory_permission. Might also be that the documentation is misleading here or I am mistaken :)
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@tibeer what is the value of your umask
?
022
Hi @tibeer,
Thank you for raising this issue. I've updated our documentation in #155 regarding the file_permission
and directory_permission
attributes to clarify that those are the values before the umask
is applied.
Thanks again for bringing this to our attention and feel free to reach out with any questions/concerns!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.