LinuxQuestions.org
Visit Jeremy's Blog.
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 05-21-2020, 01:13 AM   #16
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,839
Blog Entries: 3

Rep: Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399

Quote:
Originally Posted by klerg View Post
That brings us to an important question: how to actually test and check that these software and tools actually block an app or service from using the webcam? Or how to know the webcam is not in use besides the light being off?
My guess would be to monitor the applications via the lsof utility.

Last edited by Turbocapitalist; 05-21-2020 at 02:09 AM.
 
Old 05-21-2020, 02:01 AM   #17
klerg
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Turbocapitalist View Post
My guess would be to monitor the applications via the [font=courier]lsof[/url] utility.
Is that lsof utility? If so, what exactly would I be looking for in there to find out something is using the webcam?
 
Old 05-21-2020, 02:09 AM   #18
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,839
Blog Entries: 3

Rep: Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399
The web cam is a device. Devices are files. So the application would be reading the file related to the web cam. The problem would be if it does a quick poll, if that is even possible, rather than leaving it open for longer intervals. As for debugging, I would say that should be on the AppArmor side of things. Configure the application to use the camera and then keep adjusting AppArmor until it can't read the camera any more.
 
Old 05-21-2020, 02:46 AM   #19
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,593
Blog Entries: 9

Rep: Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092Reputation: 4092
Quote:
Originally Posted by klerg View Post
Blacklist, disable, or modprobe -r uvcvideo is not an option as they will shut off the webcam to every application. Also, disabling the webcam in BIOS will cut it off from everything.
So you want the webcam on for some apps, and off otherwise.
How kind of you to specify your requirement after 10 replies from 6 members trying to help you with what is effectively a different topic.
 
Old 05-21-2020, 07:29 PM   #20
klerg
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Original Poster
Rep: Reputation: 0
I see but how to find the file(s) or driver(s) that is used or associated with the webcam? What do you mean by quick poll? And how to know it is left open for longer intervals? I have not had the time to get AppArmor up and running yet but what is it I need to be debugging?

Quote:
Originally Posted by ondoho View Post
So you want the webcam on for some apps, and off otherwise.
How kind of you to specify your requirement after 10 replies from 6 members trying to help you with what is effectively a different topic.
Yes, more or less, and be informed when something access the webcam without approval.
No, you are totally wrong, it is clear from my first post I will quote it "Is any way to stop or block an application from using my USB or built-in webcam?"
 
Old 05-21-2020, 09:49 PM   #21
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,839
Blog Entries: 3

Rep: Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399
Quote:
Originally Posted by klerg View Post
I have not had the time to get AppArmor up and running yet but what is it I need to be debugging?
Time is what it takes.

The AppArmor profile which you would build or modify would need debugging. I am skeptical that it would work as intended on the first try and expect that it would take several rounds of refinement to progressively restrict access to the camera. That process is covered in the two links provided earlier, especially the second link.

The files representing your camera are probably named /dev/videon where n is a low integer.

Code:
$ find /dev/ -group video -name 'video*' -exec stat --printf "%A %U %G %n\n" {} \;
crw-rw---- root video /dev/video1
crw-rw---- root video /dev/video0
AppArmor would need to restrict the application from even reading those files. If you have an existing profile, it is probably a matter of adding either one or two lines to it. However, that requires spending the time to get up to speed with working on the profile.
 
Old 05-23-2020, 02:12 AM   #22
klerg
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Turbocapitalist View Post
Time is what it takes.

The AppArmor profile which you would build or modify would need debugging. I am skeptical that it would work as intended on the first try and expect that it would take several rounds of refinement to progressively restrict access to the camera. That process is covered in the two links provided earlier, especially the second link.

The files representing your camera are probably named /dev/videon where n is a low integer.

Code:
$ find /dev/ -group video -name 'video*' -exec stat --printf "%A %U %G %n\n" {} \;
crw-rw---- root video /dev/video1
crw-rw---- root video /dev/video0
AppArmor would need to restrict the application from even reading those files. If you have an existing profile, it is probably a matter of adding either one or two lines to it. However, that requires spending the time to get up to speed with working on the profile.
Appreciate it, I will give AppArmor a try and if any issues pop up will make a new thread to address them. But unless someone has anything to add I guess this topic is done. At this point my questions will mostly be about AppArmor so it makes sense to start another thread for that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: webcam-server-dialog: A basic front-end to webcam-server LXer Syndicated Linux News 0 09-24-2010 10:30 AM
LXer: Webcam server with Linux - 2 (Zoneminder and webcam-server) LXer Syndicated Linux News 0 09-03-2010 08:20 AM
LXer: Setting Up Motion webcam security system with your Webcam with Email & FTP. LXer Syndicated Linux News 0 06-24-2009 09:42 PM
How To Install A Usb Webcam [Genius WebCam on Suse 9.1 Personal] ofvergara SUSE / openSUSE 4 11-29-2006 12:09 PM
I want to veiw my friends webcam, im using Lycoris, how do i c his webcam? CaffeinatedGamer Linux - Newbie 10 06-07-2005 07:23 PM

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

All times are GMT -5. The time now is 01:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration