<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# Implementing Cloud DLP Policies — API Reference

## AWS Macie CLI

```bash
# Enable Macie
aws macie2 enable-macie

# Create classification job
aws macie2 create-classification-job --job-type ONE_TIME --name NAME \
  --s3-job-definition '{"bucketDefinitions":[{"accountId":"ACCOUNT","buckets":["BUCKET"]}]}'

# List findings
aws macie2 list-findings --finding-criteria '{"criterion":{"severity.description":{"eq":["High"]}}}'

# Get finding statistics
aws macie2 get-finding-statistics --group-by type

# Create custom data identifier
aws macie2 create-custom-data-identifier --name NAME --regex "PATTERN"
```

## GCP DLP CLI

```bash
# Inspect content inline
gcloud dlp inspect-content --project=PROJECT --content="TEXT" --info-types=INFO_TYPES

# Create inspection job
gcloud dlp jobs create --project=PROJECT --display-name=NAME \
  --inspect-config='{"infoTypes":[{"name":"TYPE"}]}' \
  --storage-config='{"cloudStorageOptions":{"fileSet":{"url":"gs://BUCKET/**"}}}'

# List jobs
gcloud dlp jobs list --project=PROJECT

# List info types
gcloud dlp info-types list
```

## Azure Purview CLI

```bash
# Create Purview account
az purview account create --name NAME --resource-group RG --location LOCATION

# Register data source
az purview data-source create --account-name ACCOUNT --name NAME --kind AzureStorage

# Trigger scan
az purview scan create --account-name ACCOUNT --data-source-name SOURCE --name NAME
```

## Common Info Types

| Category | AWS Macie | GCP DLP | Azure Purview |
|----------|-----------|---------|---------------|
| SSN | US Social Security Number | US_SOCIAL_SECURITY_NUMBER | U.S. SSN |
| Credit Card | Credit Card Number | CREDIT_CARD_NUMBER | Credit Card Number |
| Email | Email Address | EMAIL_ADDRESS | Email Address |
| Phone | Phone Number | PHONE_NUMBER | Phone Number |
| AWS Key | AWS Access Key | AWS_CREDENTIALS | N/A |
