Back to Checks
Prowlerprowler-provider-chatgpt
Pending ChatGPT workspace invites for owner or admin roles are not stale
workspace_no_stale_privileged_invites
Service: workspaceSeverity: low
OfficialVerifiedPrivate
Categories:gen-aiidentity-access
Resource Type:OpenAIWorkspaceInvite
Each pending invite for the owner or admin role is checked against max_privileged_invite_age_days (default 7).
Risk
A forgotten privileged invite grants owner or admin rights to whoever accepts it, possibly long after the need passed or after the mailbox changed hands.
Run this check with Prowler
Run in Prowler CloudRun
prowler chatgpt --checks workspace_no_stale_privileged_invitesRecommendation
Revoke pending owner and admin invites that were not accepted in time, and invite again when needed.
Check Code
import time
from prowler.lib.check.models import Check
from prowler_provider_chatgpt.check_report import finding
from prowler_provider_chatgpt.services.workspace.workspace_client import workspace_client
class workspace_no_stale_privileged_invites(Check):
def execute(self):
maximum = workspace_client.max_invite_age_days
findings = []
for invite in workspace_client.privileged_invites or []:
age = int((time.time() - invite["created_at"]) // 86400)
role = invite["role"]
if age <= maximum:
text = f"Pending {role} invite for {invite['name']} is {age} days old, within the maximum of {maximum}."
else:
text = f"Pending {role} invite for {invite['name']} is {age} days old, older than the maximum of {maximum}."
findings.append(finding(self.metadata(), invite, age <= maximum, text))
return findings