LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-30-2021, 07:30 AM   #1
beroal
Member
 
Registered: Feb 2016
Location: Ukraine
Distribution: ArchLinux
Posts: 49

Rep: Reputation: Disabled
Question granting file permissions to a process dynamically


I want to restrict file access for various application programs. Application programs are of the office/home usage variety like viewers, editors, messengers, web browsers, CAD, integrated development environments, etc. Files mostly sit in users' home directories. Files can contain secret data like passwords and cryptographic keys. There are solutions specifically for passwords and cryptographic keys, but restricting access to less sensitive files wouldn't hurt too, so I would like to use a more general solution.

I see a lot of projects for restricting file access statically. This means that a system administrator writes a list of file permission for a program, and any process that executes this program has these permissions. A very important feature is missing in these projects. A user often grants access to a file temporarily, for example, when opening a media file in a media player or a text document in a text editor. In such cases, I say that they grant file access dynamically.

I take as an example the AppArmor project, although there are many others like it. AppArmor's documentation states that changing process permissions is not implemented and would be hard to implement. Also a user needs to select a file in the UI of a file permission manager (which is AppArmor) and select the same file in the UI of an application program that will use the file. This is not convenient. For several years, I try to use Unix users to this end, so I work under more than one user account. Moving information between user accounts is a drudgery. I often need to change file ownership and permissions, and I need to do this under the root account. I would like to use a project that not only allows to grant file access dynamically, but the procedure for this is convenient.

The only project that implements what I need is Plash. It looks like a powerful and convenient system in its documentation. However, I doubt that it will work with recent Linux kernels or application programs. The source code SVN repository is not accessible, the latest source code is from 2006, and many links on its web site are broken. Plash redefine the `glibc` library. I suppose it is possible to create a similar system with FUSE (Filesystem in Userspace).
 
Old 03-30-2021, 07:55 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,022

Rep: Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343
I think this approach is just wrong. Common tasks should be executed using a common user id.
From the other hand linux itself is file based, so you can set access permissions on files, but you cannot configure which apps can access that file (so if one app can read it most probably others will be able to read it too).

From the other hand nowadays you can use dockerized environments, namespaces, or different services (using different accounts).
 
1 members found this post helpful.
Old 03-30-2021, 01:13 PM   #3
beroal
Member
 
Registered: Feb 2016
Location: Ukraine
Distribution: ArchLinux
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
I think this approach is just wrong. Common tasks should be executed using a common user id.
What approach are you referring to? I didn't say that for a user working under several user accounts is the right approach. I just had no choice. Many Linux tools simply did not exist 10 years ago.

Quote:
Originally Posted by pan64 View Post
so if one app can read it most probably others will be able to read it too
It's not just probable, it's definitely true. ☺

Quote:
Originally Posted by pan64 View Post
From the other hand nowadays you can use dockerized environments, namespaces, or different services (using different accounts).
I considered them; they grant permissions statically. I hope that somebody here knows a tool I missed.
 
Old 03-30-2021, 01:47 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,022

Rep: Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343
what do you think how should this tool be "authenticated"?
 
Old 03-30-2021, 06:05 PM   #5
scottieH
Member
 
Registered: Mar 2021
Posts: 58

Rep: Reputation: Disabled
Short answer: Unix/Linux does not work this way. It was never intended to work this way.
Want you want to do is handled via the application allowing/disallowing access to the file(s)/Director{y,ies}.

Consider an accounting application. The entire application has access to all of the files, directories, databases, etc.
Internally, the accounting application has a user database with roles assigned. Everyone in the receivables department is a member of the group A/R. These users cannot access the General Ledger, but the APPLICATION MUST have access to the G/L.

Now, that being said, all of the accounting directories can have a group ownership of accounting, which prevents engineering from accessing that information.

The application itself would then grant/revoke access to the user based upon whatever criteria you want, whenever you want.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] setfacl and granting permissions to a group and its members on a directory devUnix Linux - General 7 08-08-2013 12:12 AM
Granting File Access From One Linux Machine to Another Linux JWWOOD Linux - Newbie 5 03-06-2011 06:48 PM
Granting full read/write permissions to all files for a specific user laserjim Linux - Security 10 01-31-2009 11:17 AM
Granting root permissions to a bash script than can be run by a user? SirTristan Linux - Newbie 4 06-14-2008 10:29 PM
granting permissions to a few users in a group grondar69 Linux - General 7 06-22-2006 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration