SAP / macOS-enterprise-privileges

For Mac users in enterprise environments, this application gives users control over the administration of their machine by elevating their level of access to administrator privileges on macOS. Users can set a timeframe in the application's settings to perform specific tasks, such as installing or removing an application.
Apache License 2.0
1.4k stars 150 forks source link

[Privileges 2] Webhooks: Suggestions #123

Closed aduffner closed 1 month ago

aduffner commented 1 month ago

Referencing: macOS 15.0.1 (24A348) with Privileges Beta 2.0.0 (1805)

Bildschirmfoto 2024-10-24 um 18 12 34

Of course Power Automate can give me a date, but it would be easier if the post message included when and how the user terminated their admin rights locally (time expired or self terminated).

{
  "admin": false,
  "expires": "<expired date>",
  "machine": "xxx-xxx-xxx-xxx-xxx",
  "reason": "<time ran out/ user gave up>",
  "user": "myusername"
}
mthielemann commented 1 month ago

@aduffner Good idea but I would not misuse the expires field for a timestamp but add an additional timestamp field. Would this work for you?

mthielemann commented 1 month ago

Starting with build 1813 the JSON looks like this:

{
  "admin":true,
  "expires":"2024-10-25T07:24:19Z",
  "machine":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "reason":"",
  "timestamp":"2024-10-25T07:19:19Z",
  "user":"xxxxxxxxx"
}

{
  "admin":false,
  "expires":"",
  "machine":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "reason":"requested by user",
  "timestamp":"2024-10-25T07:19:19Z",
  "user":"xxxxxxxxx"
}

{
  "admin":false,
  "expires":"",
  "machine":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "reason":"privileges expired",
  "timestamp":"2024-10-25T07:19:19Z",
  "user":"xxxxxxxxx"
}

In addition to this the regular logging has been changed to this:

User xxxxxxxxx now has standard user privileges (requested by user)
User xxxxxxxxx now has standard user privileges (privileges expired)
aduffner commented 1 month ago

@mthielemann Love it! You have turned my original idea into a holistic approach.

aduffner commented 1 month ago

Result/Example 🤩

Bildschirmfoto 2024-10-25 um 10 03 35

Request Body JSON Schema:

{
    "type": "object",
    "properties": {
        "admin": {
            "type": "boolean"
        },
        "expires": {
            "type": "string"
        },
        "machine": {
            "type": "string"
        },
        "reason": {
            "type": "string"
        },
        "timestamp": {
            "type": "string"
        },
        "user": {
            "type": "string"
        }
    }
}