sync: auto-sync from GURU-BEAST-ROG at 2026-06-05 15:42:37

Author: Mike Swanson
Machine: GURU-BEAST-ROG
Timestamp: 2026-06-05 15:42:37
This commit is contained in:
2026-06-05 15:42:43 -07:00
parent fd0b0125e0
commit fc36218960
3 changed files with 104 additions and 4 deletions

View File

@@ -75,14 +75,39 @@ async def on_ready():
@bot.event @bot.event
async def on_message(message: discord.Message): async def on_message(message: discord.Message):
logger.info("[DEBUG] on_message fired: author=%s bot=%s channel=%s content_len=%d mentions=%d", logger.info("[DEBUG] on_message fired: author=%s bot=%s channel=%s content_len=%d mentions=%d role_mentions=%d",
message.author.name, message.author.bot, getattr(message.channel, 'name', 'DM'), message.author.name, message.author.bot, getattr(message.channel, 'name', 'DM'),
len(message.content), len(message.mentions)) len(message.content), len(message.mentions), len(message.role_mentions))
if message.author.bot: if message.author.bot:
return return
is_mention = bot.user in message.mentions # discord.py's message.mentions can fail to resolve in some channel permission
# configurations — fall back to checking the raw message content for the bot's
# snowflake ID so @mentions always trigger regardless of cache state.
bot_mention_in_content = (
bot.user is not None
and (
f"<@{bot.user.id}>" in message.content
or f"<@!{bot.user.id}>" in message.content
)
)
# Discord creates an integration role for the bot with the same display name.
# Some users (e.g. from autocomplete) ping that role instead of the bot user —
# both look identical in chat. Detect it by checking if any of the bot's guild
# roles appear in the message's role_mentions list.
bot_role_mentioned = (
bot.user is not None
and message.guild is not None
and bool(message.role_mentions)
and (
bot_member := message.guild.get_member(bot.user.id)
) is not None
and any(role in message.role_mentions for role in bot_member.roles)
)
is_mention = bot.user in message.mentions or bot_mention_in_content or bot_role_mentioned
is_in_bot_thread = ( is_in_bot_thread = (
isinstance(message.channel, discord.Thread) isinstance(message.channel, discord.Thread)
and message.channel.owner_id == bot.user.id and message.channel.owner_id == bot.user.id

View File

@@ -213,3 +213,78 @@ Winter directed the work to be logged on existing Syncro ticket #32389 ("Tim Mil
### Pending / Incomplete Tasks ### Pending / Incomplete Tasks
- **vonscarstar.com tenant needs `onboard-tenant.sh`** — Security Investigator SP has no Exchange role; investigator-exo is unusable on this tenant until roles are assigned. Run: `bash .claude/skills/remediation-tool/scripts/onboard-tenant.sh vonscarstar.com` - **vonscarstar.com tenant needs `onboard-tenant.sh`** — Security Investigator SP has no Exchange role; investigator-exo is unusable on this tenant until roles are assigned. Run: `bash .claude/skills/remediation-tool/scripts/onboard-tenant.sh vonscarstar.com`
---
## Update: 15:42 PT — Von's Carstar Exchange License Audit (Discord / Winter)
## User
- **User:** Mike Swanson (mike)
- **Machine:** GURU-BEAST-ROG
- **Role:** admin
- **Requester:** Winter (@winterguru, ID: 624666486362996755) via Discord bot
## Session Summary
Winter requested an Exchange license audit for Von's Carstar (vonscarstar.com) via the Discord bot. The client was not present in the ClaudeTools client directory or SOPS vault, so the lookup was done via Syncro and the Microsoft Graph API.
Syncro customer search confirmed Von's Carstar (customer ID 33841402). Their recurring invoice schedule (ID 465639, "Email - Maria Chamberlin Recurring Template") showed 9 Exchange Online Plan 1 licenses billed at $5.00/month each through Pax8 — $45/month total.
The vonscarstar.com M365 tenant ID was resolved via the OpenID configuration endpoint. An access token was obtained using the ComputerGuru Security Investigator MSP app against the tenant. A Graph API query of all licensed users returned 8 active mailboxes, confirming 1 unused license out of 9 billed.
No Syncro ticket was created per Winter's decision.
## Key Decisions
- Used ComputerGuru Security Investigator app (read-only, multi-tenant) to query the tenant — no client-specific credentials were needed or stored.
- Tenant ID was resolved via public OpenID configuration endpoint rather than stored credentials.
- Reported the unused license discrepancy (9 billed, 8 assigned) proactively without being asked.
## Infrastructure & Servers
- **Tenant domain:** vonscarstar.com
- **Tenant ID:** 53de51b9-a063-4f46-88ff-7c3468828ed9
- **MSP app used:** ComputerGuru Security Investigator (client_id: bfbc12a4-f0dd-4e12-b06d-997e7271e10c)
- **Vault path:** msp-tools/computerguru-security-investigator.sops.yaml
## Commands & Outputs
```
# Tenant discovery
GET https://login.microsoftonline.com/vonscarstar.com/.well-known/openid-configuration
→ tenant_id: 53de51b9-a063-4f46-88ff-7c3468828ed9
# Syncro customer search
GET /customers?query=carstar → id: 33841402, "Von's Carstar"
# Syncro schedule
GET /schedules?customer_id=33841402
→ Schedule 465639: "Email - Maria Chamberlin Recurring Template"
→ 9x Exchange Online Plan 1 @ $5.00/mo = $45.00/mo (Pax8)
# Graph API — licensed users
GET /v1.0/users?$select=displayName,userPrincipalName,assignedLicenses,accountEnabled
→ 8 users with SKU 4b9405b0-7788-4568-add1-99614e613b69 (Exchange Online Plan 1)
```
Active mailboxes:
- garrett@vonscarstar.com
- joe@vonscarstar.com
- kevin@vonscarstar.com
- lindsey@vonscarstar.com
- Maria@vonscarstar.com
- miguel@vonscarstar.com
- steven@vonscarstar.com
- tim@vonscarstar.com
**1 unused license** — 9 billed, 8 assigned.
## Pending / Incomplete Tasks
- No action taken on unused license. Winter did not request a change. If client wants to reduce to 8, update Pax8 subscription and Syncro recurring schedule (line item qty on schedule 465639).
## Reference Information
- Syncro customer: https://computerguru.syncromsp.com/customers/33841402
- Syncro schedule 465639 — monthly, next run 2026-06-16
- Pax8 SKU: Exchange Online Plan 1 (4b9405b0-7788-4568-add1-99614e613b69)