GoogleCloudPlatform / pubsec-declarative-toolkit

The GCP PubSec Declarative Toolkit is a collection of declarative solutions to help you on your Journey to Google Cloud. Solutions are designed using Config Connector and deployed using Config Controller.
Apache License 2.0
31 stars 28 forks source link

Cloud Identity procedures for 3rd party email integration for the 3 options (Workspace, IdP identity federation or custom MX records) - fix: add email alias forwarding on the domain #252

Open fmichaelobrien opened 1 year ago

fmichaelobrien commented 1 year ago

See also #270 Requirements

Workarounds

Options

Discussion for workspace we get 4 MX records on the domain - those match, for non-workspace the emails may match depending on whether the 3rd party AAD or AWS Workmail are on the same domain as the GCP org

Screen Shot 2023-01-09 at 12 09 09 PM

Notes

References

225

182

obriensystems commented 1 year ago

Procedure test: developer account has minimal permissions but has access to a project and gcs bucket\ developer account has no workspace account - just cloud identity set a notification in a new alerting policy in cloud monitoring on any GCS api call above the 0 baseline

use case is identity user without workspace is set as the notification on a bucket alert policy - email is forwarded to an external email system - in this case AWS workspace where the forwarding mail comes from a GCP domain tied to the policy org

Fix 1 - email forwarding directly on the organization domain hosting workspace or another IdP - user is without a real email address without the alias

Set alias - enable dual workspace/forwarding apis

Screen Shot 2023-01-17 at 23 31 04

configure notifications

Screen Shot 2023-01-17 at 23 33 16

upload

Screen Shot 2023-01-17 at 23 36 18

and

Screen Shot 2023-01-17 at 23 40 45

event in

Screen Shot 2023-01-17 at 23 40 14

3rd party email received for devel@ol.dev (cloud identity user on org) with email forwarding on the domain

Screen Shot 2023-01-17 at 23 41 59

Fix 2 - alternate email on a different unrelated domain : essentially put any email into the notifications channel https://console.cloud.google.com/monitoring/alerting/notification Add that channel to the Alerting policy on the bucket

Then enable email forwarding on the domain you will be using to send the email alias (here lz.ca - forwards to ol.cloud)

Don't change your workspace settings on your main domain if enabled (or enable both workspace and forwarding on the domain)

Screen Shot 2023-01-17 at 23 26 42 Screen Shot 2023-01-17 at 23 25 16 Screen Shot 2023-01-17 at 22 48 33 Screen Shot 2023-01-17 at 22 54 16 Screen Shot 2023-01-17 at 22 54 54

sending to 2 emails - this one is a workspace enabled account

Screen Shot 2023-01-17 at 23 02 30 Screen Shot 2023-01-17 at 23 22 18 Screen Shot 2023-01-17 at 23 20 35 Screen Shot 2023-01-17 at 23 21 39 Screen Shot 2023-01-17 at 23 22 58 Screen Shot 2023-01-17 at 23 21 13
{
  "displayName": "any-gcs-bucket-event",
  "documentation": {
    "content": "event on gcs bucket",
    "mimeType": "text/markdown"
  },
  "userLabels": {},
  "conditions": [
    {
      "displayName": "GCS Bucket - Request count",
      "conditionThreshold": {
        "filter": "resource.type = \"gcs_bucket\" AND metric.type = \"storage.googleapis.com/api/request_count\"",
        "aggregations": [
          {
            "alignmentPeriod": "120s",
            "crossSeriesReducer": "REDUCE_NONE",
            "perSeriesAligner": "ALIGN_MEAN"
          }
        ],
        "comparison": "COMPARISON_GT",
        "duration": "0s",
        "trigger": {
          "count": 1
        },
        "thresholdValue": 0
      }
    }
  ],
  "alertStrategy": {
    "autoClose": "604800s"
  },
  "combiner": "OR",
  "enabled": true,
  "notificationChannels": [
    "projects/anthos-ol/notificationChannels/278200572621676368"
  ]
}