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

File Resource should have a property for Setting Permissions Using Letter Notation #13538

Open
NAshwini opened this issue Jan 27, 2023 · 0 comments
Labels
Status: Help Wanted An issue that needs help from a contributor.

Comments

@NAshwini
Copy link
Member

NAshwini commented Jan 27, 2023

Describe the Enhancement:

File resource required to set a permission in letter notation format.

Setting Permissions Using Letter Notation

The syntax for using letter notation is:
chmod [access class][operator][letter permission] file

Access classes are indicated using initials, as follows:

  1. u for user
  2. g for group
  3. o for other
  4. a for all three: user and group and other
    You can combine initials together. For example, uo would stand for user and other.

The operators are the following:

  1. '+' to add a permission
  2. '-' to remove a permission
  3. '=' to set a permission
    The permission types being manipulated are indicated using letter notation as described above.

chmod Numeric Notation Example:
To add execute permission to user for the file example.html, you would use the following command:
chmod u+x example.html

Describe the Need:

We have few CIS controls which has not a complete details for one of the access class so we could not use mode property
eg:
https://github.com/chef/improvised_cookbooks/pull/1/files#diff-4eb1f94dfc9cba81c26467ba2dc078f1bd8b44c0a31e032db70866e6bef9c280R333

  execute "Ensures  users' dot files are not group or world writable" do
     command "chmod go-w #{file}"
   end

Current Alternative

Currently we are using execute resource.

Can We Help You Implement This?:

@NAshwini NAshwini added the Status: Untriaged An issue that has yet to be triaged. label Jan 27, 2023
@marcparadise marcparadise added Status: Help Wanted An issue that needs help from a contributor. and removed Status: Untriaged An issue that has yet to be triaged. labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Help Wanted An issue that needs help from a contributor.
Projects
None yet
Development

No branches or pull requests

2 participants