Building SUDO commands...

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

Building SUDO commands...

L2 Linker

Is anyone aware of any reference documentation for how to build sudo command policies in EMP for MACs? I have been google searching but haven’t really turned up anything helpful.

I just don’t seem to be very good at this and as great as my technical contact has been, I feel a little like I’m pestering him and would like to figure this out.

Here’s my latest dilema:

 

I have this policy that lets my network engineers use one of 4 editors to update the user profile files in the cisco directory.

SUDO command

Command - matches regex - (vi|pico|nano|vim)

Parameters - is exactly - /opt/cisco/anyconnect/profile

 

Now they want to be able to start and stop the the anyconnect agent:

  • sudo launchctl unload /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist
  • sudo launchctl load /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist

 

I tried putting launchctl load | launchctl unload in as a regex with the path as the parameter, and have been tinkering from there w/o any success. Does anyone have any suggestions? Or reference materials?

 

Thanks!

-Shelly

1 accepted solution

Accepted Solutions

L5 Sessionator

Hi @Shellene Olson​ ,

 

I think that the "launchctl" is the command and 'load' or 'unload' are the parameters for the command, so try setting them in the parameters, something like this -

Field_Content_versions_oct20__068Ht00000S9qB4IAJ.pngalternatively, you can check it in the Event Management to get the clear understanding of the parameters.

Field_Content_versions_oct20__068Ht00000S9qBxIAJ.png 

Thanks,

Arik.

View solution in original post

5 REPLIES 5

L5 Sessionator

Hi @Shellene Olson​ ,

 

I think that the "launchctl" is the command and 'load' or 'unload' are the parameters for the command, so try setting them in the parameters, something like this -

Field_Content_versions_oct20__068Ht00000S9qB4IAJ.pngalternatively, you can check it in the Event Management to get the clear understanding of the parameters.

Field_Content_versions_oct20__068Ht00000S9qBxIAJ.png 

Thanks,

Arik.

L2 Linker

That makes a lot of sense actually. I'm going to update the policy and have them test. Thank you!

L2 Linker

That worked perfectly. Thank you again!

Hi @Shellene Olson​ ,

 

Happy to hear that.

BDW, stay tuned to next versions release notes as we are about to introduce File Access policy for macOS which may also be useful to the use case you described.

 

cheers,

Arik.

Yes, I have a couple of other situations where file access policies would be helpful! Looking forward to seeing that.

Thanks!

-Shelly

  • 1 accepted solution
  • 1 Views
  • 5 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!