Giter Club home page Giter Club logo

screennudge's Introduction

ScreenNudge

A tool for prompting users to approve Screen Recording on macOS

screennudge_example

Requirements

  • This script runs on macOS 10.15 or higher. macOS 11 or higher is required for standard user approval (that MDM command was made available in Big Sur.)
  • The script requires that the app being targeted is being deployed with a Privacy Profile library item that lets standard users approve Screen Capture (AllowStandardUserToSetSystemService). (Available in macOS Big Sur 11+). Use your MDM's built-in Privacy profile controls or if that's not an option, use a tool like iMazing Profile Editor.
  • The MDM agent running this script needs Full Disk Access in order to read the tcc.db and confirm screen recording has been approved. Most MDM agents have this access by default (check the MDM Profile installed on the machine in System Preferences > Profiles), but if your specific MDM does not you'll want to grant it access with a PPPC Profile.

Notes

While this script was designed with Kandji in mind, it is designed to be plug-and-play for just about any MDM.

I’ve included three options for messaging the end-user leveraging the Kandji CLI, SwiftDialog, or standard osascript, but feel free to add your messaging binary of choice.

Pro Tip: osascript dialogs look pretty boring and dated these days in macOS, but adding a path to an app icon goes a long ways towards making it look less terrible.

dialog_boxes

All you as the admin need to do is to complete the User Input section of the script. Here is where you'll define the path to the application, choose the messaging you want to present in the dialog, and add an optional icon.

Here's a few examples:

For Zoom:

appPath="/Applications/zoom.us.app"
appName="Zoom" #Name of app to present in dialog to user
appIcon="/Applications/zoom.us.app/Contents/Resources/ZPLogo.icns" #Path to app icon for messaging
dialogTitle="Screen Recording Approval"
dialogMessage="Please approve screen recording for $appName."

For AnyDesk:

appPath="/Applications/AnyDesk.app"
appName="AnyDesk" #Name of app to present in dialog to user
appIcon="/Applications/AnyDesk.app/Contents/Resources/AppIcon-1.icns" #Path to app icon for messaging
dialogTitle="Screen Recording Approval"
dialogMessage="Please approve screen recording for $appName."

Troubleshooting

  • I get an error Error: unable to open database "/Library/Application Support/com.apple.TCC/TCC.db": authorization denied
    • This means the agent running the script doesn't have Full Disk Access permissions to read the TCC.db. Keep in mind that with some MDMs, if you trigger a script via Terminal (rather than waiting for agent check-in), it will run as Terminal rather than as the agent. (Please don't deploy a PPPC Profile granting Terminal Full Disk access to solve this, as that is a huge security risk). Wait for the device to check in, and it should run fine.
  • Reading the Logs
    • You probably have logs from the script in your MDM, but if you need to grab them locally on a machine you can grep them out of the unified log. log show --style compact --process "logger" | grep "ScreenNudge"
  • Run the script as zsh
    • The most common issue that people run into is running the script as a bash script rather than as zsh. Zsh has been the default shell on macOS since macOS 10.15 Catalina. If your MDM does not support running scripts as zsh, I encourage you to reach out to them and request that they support zsh, which has been the default shell on macOS since October 2019.

screennudge's People

Contributors

bvanpeski avatar

Stargazers

 avatar Timothy Ransom avatar  avatar Max avatar Michael Stango avatar  avatar  avatar Brad Clare avatar Michael Jon avatar  avatar  avatar Zehadi Alam avatar Michael Permann avatar  avatar Al Berman avatar adam kaminski avatar Sven Vetsch avatar Kay avatar  avatar Matin Sasaluxanon avatar  avatar Praveen Kumar avatar Paul S avatar Josh Liebster avatar Gareth avatar Jarad Alderson avatar Cas Bitton avatar Brandon Sexton avatar Brian Goldstein avatar Trevor avatar  avatar Jake avatar Kel's Portfolio avatar  avatar  avatar  avatar Jonathan Hoium avatar Scripts and Things avatar AJL avatar Mel Matsuoka avatar Meir Elimelech avatar Stephen Johnson avatar Ali Al-Itejawi avatar Marcus Rowell avatar  avatar James avatar  avatar David L. avatar Niko avatar Anders Tao avatar  avatar  avatar Tadayuki Onishi avatar

Watchers

 avatar Matin Sasaluxanon avatar  avatar Thomas Martin avatar

Forkers

guillaumegete

screennudge's Issues

Apps no longer populating in Screen Recording section

This is a new issue that has cropped up in the last few weeks (beginning of Feb) where the script is properly presenting the Screen Recording pane to end-users, but the apps are not populating so there's nothing to click.

Investigating...

When do you run the script

This is great, but when do you run the script? at Login? Is there any way to run this as a daemon so when the app is launched it will run?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.