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

Determine and implement proper file permissions on Airship2 generated files #188

Closed
alexander-hughes opened this issue Apr 23, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request priority/low Items that are considered non-critical for functionality, such as quality of life improvements priority/medium Default priority for items
Milestone

Comments

@alexander-hughes
Copy link
Contributor

Problem description (if applicable)
Airship2 will be responsible for generating a number of files, some of which will contain secrets. The default permissions set when generated via Go are overly permissive.

In Airship1 Pegleg acted as the front door generating files, encrypting files, and generating the genesis bundle. A stance was taken of setting 640 permissions on all files Pegleg created, but no path has yet been identified for Airship2.

Proposed change
Identify types of files that should have restricted file permissions, some possibilities:

  1. All files generated by Airship2
  2. Files containing secrets generated by Airship2

Identify and implement correct file permissions for these files, such as 0640.

Potential impacts
Restricting file permissions may lead to failures with other components. Use of sudo may be needed, or using a common user for these components.

@alexander-hughes alexander-hughes added enhancement New feature or request triage Needs evaluation by project members labels Apr 23, 2020
@arnavaroy26
Copy link

I would like to pick up this story. Please assign to me

@drewwalters96 drewwalters96 added priority/medium Default priority for items and removed triage Needs evaluation by project members labels Apr 29, 2020
@drewwalters96 drewwalters96 added this to the betav1 milestone Apr 29, 2020
@mattmceuen
Copy link
Contributor

There are several different places in airshipctl that create files; please be sure to address all of them as part of this issue. Example:
https://github.com/airshipit/airshipctl/blob/master/pkg/config/config.go

Let's please create a new configuration item that defines the permissions value to use for files & directories; by default use 640 for files & 750 for directories, but allow operators to override that in the config file.

@drewwalters96
Copy link
Contributor

@arnavaroy26 all yours

@teoyaomiqui
Copy link
Contributor

@arnavaroy26 when you start working on this, please take a look at this filesystem that we have in document model. i think we may want to use the same FS everywhere and control permissions via it: https://github.com/airshipit/airshipctl/blob/master/pkg/document/filesystem.go

@jezogwza jezogwza added the priority/low Items that are considered non-critical for functionality, such as quality of life improvements label May 13, 2020
@jezogwza jezogwza modified the milestones: betav1, v2.0 May 13, 2020
@gorshunovr
Copy link
Member

Unless we would ever require to define different owner:group & octal unix file permissions for different files and directories, what we need is to ensure that current umask setting fits our (security) needs. Umask would allow us to control permissions for files and directories being created while airshipctl is being run. User:group would always be same as user:group of a user who runs airshipctl (otherwise we would have to run airshipctl as root, which is another problem we wouldn't want to solve).

Could we only have a desired umask setting and on every launch check that actual umask fits our needs?

@niharikabhavaraju
Copy link
Contributor

I would like to work on this issue, please assign to me.

@airshipbot airshipbot added the wip Work in progress label Jul 16, 2020
@airshipbot
Copy link

airshipbot commented Jul 16, 2020

Related Change #741552

Subject: Implements proper permissions on airship2 generated files
Link: https://review.opendev.org/741552
Status: MERGED
Owner: Niharika Bhavaraju (niha.twinkle@gmail.com)

This change will close this issue when merged.

Approvals

Code-Review
+2 Ian Howell
+1 Bijaya Sharma
+2 Dmitry Ukov
Verified
+2 Zuul
Workflow
+1 Dmitry Ukov

Last Updated: 2020-08-11 07:15:03 CDT

@airshipbot airshipbot added ready for review Change related to the issue is ready for review and removed wip Work in progress labels Jul 20, 2020
@airshipbot
Copy link

The Change that closes this issue was merged.

@airshipbot airshipbot added ready for review Change related to the issue is ready for review and removed ready for review Change related to the issue is ready for review labels Aug 11, 2020
@eak13 eak13 removed the ready for review Change related to the issue is ready for review label Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority/low Items that are considered non-critical for functionality, such as quality of life improvements priority/medium Default priority for items
Projects
None yet
Development

No branches or pull requests

10 participants