SuperAPI AI Directory

azure-screenshot-mask

Security & auditing

View repository

Updated 10-15 16:46

About this skill

Azure Screenshot Mask

A skill for batch-mosaic-removing environment-specific information left in Azure Portal screenshots before publishing.

When To Use

  • Before putting Azure Portal screenshots in blogs, Qiita, Medium, note, external slides, or demo videos
  • When you want to sanitize all at once captures taken consecutively in the same tenant or customer environment
  • When you want to prevent "I hid it in the text, but the name remained in the image"

Core Principles

  • Even if you hide it in the text, it becomes public information if it remains in the image. Always visually review images in a separate review
  • The tenant display in the upper right is almost always a target. For an Azure Portal at viewport 1912 px, the right-edge (W-320, 0, W, 44) strip can cover it
  • The subscription name / ID / RG name in the text has different coordinates on each screen. Check in advance whether the values are present, and pass only the necessary regions additionally
  • Mosaicking destroys the original data. Prepare a way to keep .bak.png in case of re-shooting or regeneration
  • Resource names themselves can also be masking targets. Even for short-lived resource names created for a lab, unique strings can be identified. Even if stated in the text, it is safer to mask the image by leaving only the first few characters

What To Mask (Checklist)

A minimum checklist to review before publishing. If any remain, mosaic them or retake the screenshot.

  • Tenant display in the upper right (organization name, user initial avatar)
  • Subscription name (e.g., *-sub, naming that includes the customer name)
  • Subscription ID (GUID. Appears in the Portal's "Resource ID" or "Subscription ID" fields)
  • Tenant ID (GUID. Visible on Entra ID-related screens)
  • Resource group name (when it contains an internal code or customer project name)
  • Individual user's UPN / email address
  • Internal hostname / FQDN / Private IP / Public IP
  • The onmicrosoft domain in the account display
  • Resource name(Storage Account name, task name, assignment name, etc.) For unique strings, mask by leaving only the first few characters

Default Workflow

  1. Gather the target images into one folder

    • Put the images to embed in the article under images/<platform>/<article>/ and aggregate them there
    • If they are all at the same Portal resolution (viewport width), region specifications can be reused
  2. Check whether only the upper-right tenant strip is needed

    • Open one representative image in the folder and check whether only the organization display and avatar in the upper right are env-sensitive
    • If the subscription name / ID / RG name is visible in the text, make that line a target as well
  3. Mosaic

    # フォルダ内の PNG 全部に対し、右上テナント帯だけ覆う
    python <skill-path>/scripts/mosaic-azure-screenshots.py images/qiita/<article>
    
    # 単一画像 + 追加領域(例: 概要画面のサブスクリプション名 / ID 行)
    python <skill-path>/scripts/mosaic-azure-screenshots.py images/qiita/<article>/overview.png `
      --region 450,277,740,304 `
      --region 450,308,920,335
    
    # 元画像を保険として残したい
    python <skill-path>/scripts/mosaic-azure-screenshots.py images/qiita/<article> --backup
    
  4. Verify visually

    • Use an image viewer to check whether the above checklist items are no longer readable
    • If even one image still has it remaining, add --region for only that screen and run it again
  5. Also adjust the text on the article side accordingly

    • If the body contains <顧客名>-sub subscription names or customer-specific names such as the above, delete them
    • Adding a single line such as "Environment-specific information is masked in the screenshots" prevents readers from misinterpreting the mosaics in the images

Script

CLI は scripts/mosaic-azure-screenshots.py . For arguments, dependencies, OCR fallback, and red-frame annotations, read Advanced Azure Screenshot Masking when needed.

OCR Fallback

Only when the static --region is unavailable, use OCR to obtain the bbox of the verified string and mask the target box. For an implementation example, refer to Advanced Azure Screenshot Masking .

OCR-guided Highlight (red-frame annotation)

In before/after comparisons, add red frames to the verified bboxes. Do not confuse this with masking use, and limit to 2–3 locations per image. For an implementation example, refer to Advanced Azure Screenshot Masking .

Tips

  • Align the viewport, and even when reusing coordinates determined from representative images, visually check all images.
  • If a single fill-in is sufficient, use a normal image annotation tool. For details, refer to Advanced Azure Screenshot Masking .
  • The target is Azure Portal captures. Body sanitization and pcap-derived images are out of scope.