Step-up authentication on macOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Step-up authentication on macOS

L2 Linker

I have successfully setup Step-Up Authentication for Windows and is working as expected. What I'm trying to figure out is how to set up the policies to trigger for macOS.

 

I'd like to setup and test the following scenario but am unable to figure it out:

  • I'd like to click and run Terminal.app as a standard user, but as soon as the "sudo" or "su" commands (for example) are ran, I want step-up authentication to trigger.

Is this scenario possible? If not exactly, what can be done with Step-Up Authentication on a macOS device?

14 REPLIES 14

L5 Sessionator

Hi @Ricky Fuentes​ ,

 

The setup for step-up for macOS and Windows is similar.

You should define a dialog with step-up configured and associate the dialog to the relevant policy.

 

You can see here https://docs.cyberark.com/epm/latest/en/content/epm/server%20user%20guide/stepupauthentication.htm more details

 

 

Thanks,

Arik.

 

 

Hi @Arik Rabi​ ,

 

Yes, I have the End User UI created already, I've created a application group with a sudo command in it, assigned that app group to a policy with elevate permissions, and set the End user Ui, still not working.

 

I guess I'm confused on what the proper policy setup, definitions, because from what I know, currently what I have should work.

 

With the instructions you sent, I've already followed them but the one thing I have a question around is:Field_Content_versions_oct20__068Vy00000RIHpKIAX.png 

I have both Chrome and Safari on my device but why is this requirement relevant?

 

When I right click on the Terminal.app and check the assigned policy, I see the correct policy assigned. I open Terminal.app it opens just fine, but as soon as I put in a Sudo command is just says "Execution blocked: (UserName) does not have Admin rights". Which is correct, Im a standard user and so will all my end users. But I want it to provide the step-up authentication when I type in and execute the 'sudo' command.

 

L5 Sessionator

I am not sure if the below is completely correct would need the CA bods to confirm, also be interested to know this as we're about to migrate macos users and we do block sudo of course by jamf policy so I can imagine there being some legitimate reasons for our macos devs to use sudo such as MK DIR and amend environment variables equivalent for macos - If not i will delete this post.

The Root Issue

Based on your description, it sounds like your sudo commands are being blocked rather than triggering step-up authentication. The error message "Execution blocked: (UserName) does not have Admin rights" indicates that your current policy is blocking sudo commands instead of elevating them with authentication.

Correct Configuration for sudo Step-Up Authentication

For sudo commands on macOS, you need to create a specific Linux policy (not a standard macOS application policy). Here's the correct approach:

  1. In the EPM console, go to 
  2. Policies > Application policies
  3. Click 
  4. Create advanced policy
  5. Select 
  6. Linux
  7.  as the platform (even though you're on macOS)
  8. Set the action to 
  9. Elevate
  10. Under 
  11. Scope
  12.  
  13. , click 
  14. Add definition
  15. The definition type should be 
  16. Sudo command
  17. Configure the command properties:
    • Command: sudo
    • You can leave other properties blank to apply to all sudo commands
  1. Under 
  2. Options
  3. , select the appropriate dialog that has step-up authentication configured

According to Linux policies, "EPM Linux policies are the fundamental management components that elevate or block sudo commands and audit commands managed by EPM policies on Linux servers and workstations."

Supported sudo Arguments on macOS

As of version 23.10.2, EPM for macOS supports all sudo arguments, including 

-u

 

 for specifying users. This was added in a recent update as mentioned in the Version 23.10 release notes.

Browser Requirement Explanation

Regarding your question about Chrome/Safari requirement in the screenshot: This appears to be related to the authentication method being used. Some authentication methods in EPM require a browser for the authentication flow, particularly if using identity providers or SSO. This is likely why the documentation mentions browser requirements.

Troubleshooting Steps

If you're still experiencing issues:

  1. Verify that you have an active Linux policy for sudo commands (not just a macOS application policy)
  2. Check that the policy is properly targeted to your test machine
  3. Ensure the policy has a higher priority (lower number) than any blocking policies
  4. Confirm that the dialog configured for step-up authentication is properly set up

 

L4 Transporter

I am not sure if the below is completely correct would need the CA bods to confirm, also be interested to know this as we're about to migrate macos users and we do block sudo of course by jamf policy so I can imagine there being some legitimate reasons for our macos devs to use sudo such as MK DIR and amend environment variables equivalent for macos - If not i will delete this post.

The Root Issue

Based on your description, it sounds like your sudo commands are being blocked rather than triggering step-up authentication. The error message "Execution blocked: (UserName) does not have Admin rights" indicates that your current policy is blocking sudo commands instead of elevating them with authentication.

Correct Configuration for sudo Step-Up Authentication

For sudo commands on macOS, you need to create a specific Linux policy (not a standard macOS application policy). Here's the correct approach:

  1. In the EPM console, go to 
  2. Policies > Application policies
  3. Click 
  4. Create advanced policy
  5. Select 
  6. Linux
  7.  as the platform (even though you're on macOS)
  8. Set the action to 
  9. Elevate
  10. Under 
  11. Scope
  12.  
  13. , click 
  14. Add definition
  15. The definition type should be 
  16. Sudo command
  17. Configure the command properties:
    • Command: sudo
    • You can leave other properties blank to apply to all sudo commands
  1. Under 
  2. Options
  3. , select the appropriate dialog that has step-up authentication configured

According to Linux policies, "EPM Linux policies are the fundamental management components that elevate or block sudo commands and audit commands managed by EPM policies on Linux servers and workstations."

Supported sudo Arguments on macOS

As of version 23.10.2, EPM for macOS supports all sudo arguments, including 

-u

 

 for specifying users. This was added in a recent update as mentioned in the Version 23.10 release notes.

Browser Requirement Explanation

Regarding your question about Chrome/Safari requirement in the screenshot: This appears to be related to the authentication method being used. Some authentication methods in EPM require a browser for the authentication flow, particularly if using identity providers or SSO. This is likely why the documentation mentions browser requirements.

Troubleshooting Steps

If you're still experiencing issues:

  1. Verify that you have an active Linux policy for sudo commands (not just a macOS application policy)
  2. Check that the policy is properly targeted to your test machine
  3. Ensure the policy has a higher priority (lower number) than any blocking policies
  4. Confirm that the dialog configured for step-up authentication is properly set up

 

Hi @Ricky Fuentes​ ,

 

The browser is required to show the authentication steps from your IdP.

The default browser should be Chrome or Safari.

Could you please share the sudo policy you define ?

 

 

Thanks,

Hi @Arik Rabi​ 

Is the browser based off of the chomeium framework? Meaning, can Edge be the default browser and this still work?

 

I have Chrome and Safari installed, but neither are the default browser.

L4 Transporter

Hello @Ricky Fuentes​ 

 

Have you received an answer to your question? If so, we kindly encourage you to share it with us.

Your insights could be valuable to other community members in the future.

 

Thank you, Isar.

Thank you for the detailed suggestion. But I'm confused as to how am I supposed to assign the newly created "Linux" policy to a "macOS" device since the platforms won't line up? When I try to assign the device to my macOS device, no devices show available since we don't manage any LInux devices.

Sorry - I had to shelf this for a while. Just geting back to it as the fires are starting to subside. 😉

 

I see Trehman's post, I walked through it but when it came time to assign a Linux policy to my macOS devices, realized it wasn't probably going to work.

 

As of right now, still no solution to allowing Terminal to operate as a standard user but when a "sudo" command is ran to then required Step-Up Auth. I'be been able to put Terminal.app behind a Step-Up Auth, however, that is not what I'm looking for. Thanks for the follow up though.

L5 Sessionator

Yeah sorry slight correction I was a bit wrong and if you get this working I'll be glad as I can use it here as we're rolling to now to macos devs so far we've not had to create any sudo commands policies, but likely this will change in the coming weeks and I will likely look to bind Terminal or ITERM rather to MFA via an AAD group. This is what we do with our windows high risk processes such as PS/CMD/notepad++ when elevation is required!

 

Step-up authentication

docs.cyberark.com/epm

EPM - MacOS How to make sudo commands prompt for password with Elevate unhandled applications defaul...

Run sudo commands on endpoints

docs.cyberark.com/epm

How to Configure sudo Step-Up Authentication for macOS in CyberArk EPM

1. Understand Policy Types for macOS

  • For macOS endpoints, you must use a 
  • macOS policy
  •  
  •  (not a Linux policy) to manage sudo commands. The EPM agent for macOS supports advanced policies for sudo, including all arguments (such as 
  • -u
  • ) as of version 23.10.2.
  • Supported sudo arguments on macOS

2. Create a Custom Dialog for Authentication

3. Create an Advanced macOS Policy for sudo

  • In the EPM Console, go to 
  • Policies
  •  
  •  > 
  • Create advanced application policy
  • .
  • Set 
  • Platform
  •  
  •  to 
  • macOS
  •  
  •  and 
  • Action
  •  
  •  to 
  • Elevate
  • .
  • Under 
  • Scope
  •  
  • , add a definition:
  • Set 
  • Definition type
  •  
  •  to 
  • sudo command
    • .
  • For the command, use a wildcard (e.g., 
  • sudo *
    • ), but if the wizard complains, add a space after the asterisk.
    • Remove other properties like "parameters" and "publisher's signature".
  • In the 
  • End User UI
  •  section, assign the custom dialog you created in step 2.
  • Set 
  • Targets
  •  as needed (users, groups, computers).
  • Click 
  • Create
  •  
  •  to save the policy. 
  • macOS policies

4. Policy Priority and Targeting

  • Ensure your new elevate policy for sudo commands is higher priority (lower number) than any block policies that might affect sudo.
  • If a block policy is higher priority, it will override your elevate policy and block sudo commands.

5. Browser Requirement

  • For step-up authentication, the EPM agent on macOS requires Chrome or Safari to complete the authentication flow, especially if using an identity provider (IdP) or SSO.
  • Step-up authentication

6. Testing and Troubleshooting

  • Test the policy by running a sudo command as a standard user on a targeted macOS endpoint.
  • You should be prompted for credentials as configured in your dialog.
  • If you see "Execution blocked: (UserName) does not have Admin rights," check for block policies with higher priority or incorrect targeting.

 

L4 Transporter

Yeah sorry slight correction I was a bit wrong and if you get this working I'll be glad as I can use it here as we're rolling to now to macos devs so far we've not had to create any sudo commands policies, but likely this will change in the coming weeks and I will likely look to bind Terminal or ITERM rather to MFA via an AAD group. This is what we do with our windows high risk processes such as PS/CMD/notepad++ when elevation is required!

 

Step-up authentication

docs.cyberark.com/epm

EPM - MacOS How to make sudo commands prompt for password with Elevate unhandled applications defaul...

Run sudo commands on endpoints

docs.cyberark.com/epm

How to Configure sudo Step-Up Authentication for macOS in CyberArk EPM

1. Understand Policy Types for macOS

  • For macOS endpoints, you must use a 
  • macOS policy
  •  
  •  (not a Linux policy) to manage sudo commands. The EPM agent for macOS supports advanced policies for sudo, including all arguments (such as 
  • -u
  • ) as of version 23.10.2.
  • Supported sudo arguments on macOS

2. Create a Custom Dialog for Authentication

3. Create an Advanced macOS Policy for sudo

  • In the EPM Console, go to 
  • Policies
  •  
  •  > 
  • Create advanced application policy
  • .
  • Set 
  • Platform
  •  
  •  to 
  • macOS
  •  
  •  and 
  • Action
  •  
  •  to 
  • Elevate
  • .
  • Under 
  • Scope
  •  
  • , add a definition:
  • Set 
  • Definition type
  •  
  •  to 
  • sudo command
    • .
  • For the command, use a wildcard (e.g., 
  • sudo *
    • ), but if the wizard complains, add a space after the asterisk.
    • Remove other properties like "parameters" and "publisher's signature".
  • In the 
  • End User UI
  •  section, assign the custom dialog you created in step 2.
  • Set 
  • Targets
  •  as needed (users, groups, computers).
  • Click 
  • Create
  •  
  •  to save the policy. 
  • macOS policies

4. Policy Priority and Targeting

  • Ensure your new elevate policy for sudo commands is higher priority (lower number) than any block policies that might affect sudo.
  • If a block policy is higher priority, it will override your elevate policy and block sudo commands.

5. Browser Requirement

  • For step-up authentication, the EPM agent on macOS requires Chrome or Safari to complete the authentication flow, especially if using an identity provider (IdP) or SSO.
  • Step-up authentication

6. Testing and Troubleshooting

  • Test the policy by running a sudo command as a standard user on a targeted macOS endpoint.
  • You should be prompted for credentials as configured in your dialog.
  • If you see "Execution blocked: (UserName) does not have Admin rights," check for block policies with higher priority or incorrect targeting.

 

L2 Linker

Looks like this is partially working.

https://community.cyberark.com/s/article/EPM-MacOS-How-to-make-sudo-commands-prompt-for-password-with-Elevate-unhandled-applications-default-policy

 

It does prompt and does work as far as the Step-Up Auth with our "custom idp" (Okta). However it is somewhat intermittent to when it prompts and doesn't. Does anyone know of the time out for a Step-Up Auth? Meaning, after I use Step-Up Auth, I can see that it will allow my to commit additional 'sudo' commands and then eventually it will prompt me again.

 

I used sudo commands like "sudo rm -r TestFolder", "sudo mkdir TestFolder", etc...and I was getting prompted on the first run but some subsequent commands was not being prompted. I'm not against this but I'd like to now what the time out is on the Step-Up Auth. But, when I would run "sudo -v" I would get the command is blocked. I'm not entirely sure what's happening. I made sure there were no other policies handling "sudo" or even "Terminal".

 

Either way, it's further along than where I was at the beginning of today. Thanks!

L5 Sessionator

Hi @Ricky Fuentes​ ,

 

Currently the timeout for step-up is 5 minutes.

It is soon planned to be changed so users can configured it via the agent configuration.

 

Note that sudo has it own grace timeout ("Sudo grace validation period") in the agent configuration that can be set.

see here more details - https://docs.cyberark.com/epm/latest/en/content/epm/server%20user%20guide/agentconfiguration.htm#Agentbehavior

 

 

Thanks,

Arik.

 

  • 260 Views
  • 14 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!