LESSON 30分

ストーリー

佐藤CTO
来月から大手金融機関との取引が始まる。先方からセキュリティ監査の要求が来た

佐藤CTOが監査要件書を広げました。

佐藤CTO
SOC2 Type II レポートの提出、PCI DSS準拠の証明、ISMS認証の取得 — どれもコンプライアンスフレームワークへの準拠が求められている
あなた
フレームワークが多すぎて何から手をつければ…
佐藤CTO
まずは各フレームワークの目的と範囲を理解しよう。そのうえで、共通するコントロールを効率的に実装していく。実は7割は重複しているんだ

主要なコンプライアンスフレームワーク

フレームワーク比較

フレームワーク目的対象認証/監査有効期間
SOC2サービス組織の信頼性証明SaaS/クラウドサービス企業外部監査人によるレポートType I: 時点、Type II: 期間(通常12ヶ月)
ISO 27001情報セキュリティマネジメント体系全業種認証機関による認証3年(年次サーベイランス)
PCI DSSカード情報の保護カード情報を扱う企業QSA/SAQ年次
GDPREU市民の個人データ保護EU市民のデータを扱う企業規制当局継続的
HIPAA医療情報の保護医療関連企業(米国)HHS継続的

SOC2(Service Organization Control 2)

Trust Services Criteria(5つの信頼原則)

原則内容具体例
Security(セキュリティ)不正アクセスからの保護ファイアウォール、暗号化、アクセス制御
Availability(可用性)サービスの可用性の維持SLA、DR計画、監視
Processing Integrity(処理の完全性)データ処理の正確性と適時性データ検証、エラーハンドリング
Confidentiality(機密性)機密情報の保護暗号化、アクセス制限、データ分類
Privacy(プライバシー)個人情報の収集・利用・保管・開示プライバシーポリシー、同意管理

SOC2対応の技術的コントロール

// soc2-controls.ts - SOC2対応に必要な技術的コントロールの実装

// CC6.1: Logical and Physical Access Controls
interface AccessControlPolicy {
  authentication: {
    mfaRequired: boolean;
    passwordPolicy: {
      minLength: number;
      requireUppercase: boolean;
      requireLowercase: boolean;
      requireNumbers: boolean;
      requireSpecialChars: boolean;
      expirationDays: number;
      historyCount: number;       // 過去N回のパスワード再利用禁止
    };
    sessionPolicy: {
      maxIdleMinutes: number;
      maxSessionHours: number;
      concurrentSessionLimit: number;
    };
  };
  authorization: {
    model: 'RBAC' | 'ABAC';
    leastPrivilege: boolean;
    periodicReview: {
      frequencyDays: number;
      reviewer: string;
    };
  };
}

const soc2AccessControl: AccessControlPolicy = {
  authentication: {
    mfaRequired: true,
    passwordPolicy: {
      minLength: 12,
      requireUppercase: true,
      requireLowercase: true,
      requireNumbers: true,
      requireSpecialChars: true,
      expirationDays: 90,
      historyCount: 12,
    },
    sessionPolicy: {
      maxIdleMinutes: 15,
      maxSessionHours: 8,
      concurrentSessionLimit: 3,
    },
  },
  authorization: {
    model: 'RBAC',
    leastPrivilege: true,
    periodicReview: {
      frequencyDays: 90,
      reviewer: 'Security Team',
    },
  },
};

// CC7.2: Monitoring Activities
interface MonitoringConfig {
  logging: {
    auditLogRetentionDays: number;
    logTypes: string[];
    immutableStorage: boolean;
    encryptedAtRest: boolean;
  };
  alerting: {
    securityEvents: AlertRule[];
    responseTimeSla: Record<string, string>;
  };
}

interface AlertRule {
  name: string;
  condition: string;
  severity: 'critical' | 'high' | 'medium' | 'low';
  notification: string[];
}

const soc2Monitoring: MonitoringConfig = {
  logging: {
    auditLogRetentionDays: 365,
    logTypes: [
      'authentication',         // ログイン/ログアウト
      'authorization',          // 権限チェック
      'data-access',            // データアクセス
      'data-modification',      // データ変更
      'system-configuration',   // 設定変更
      'admin-actions',          // 管理者操作
    ],
    immutableStorage: true,     // ログの改ざん防止
    encryptedAtRest: true,
  },
  alerting: {
    securityEvents: [
      {
        name: 'Multiple Failed Logins',
        condition: 'failed_login_count > 5 within 10min from same IP',
        severity: 'high',
        notification: ['#security-alerts', 'security@company.com'],
      },
      {
        name: 'Privilege Escalation Attempt',
        condition: 'unauthorized_access to admin endpoints',
        severity: 'critical',
        notification: ['#security-incidents', 'oncall-security'],
      },
      {
        name: 'Data Export Above Threshold',
        condition: 'data_export_rows > 10000 within 1hour',
        severity: 'medium',
        notification: ['#security-alerts'],
      },
    ],
    responseTimeSla: {
      critical: '15 minutes',
      high: '1 hour',
      medium: '4 hours',
      low: '24 hours',
    },
  },
};

ISO 27001(ISMS)

Annex A コントロール(ISO 27001

ISO 27001

Aには93のコントロールが4カテゴリに分類されています。

カテゴリコントロール数主な内容
Organizational(組織的)37ポリシー、役割、サプライヤー管理
People(人的)8採用審査、教育訓練、退職時の対応
Physical(物理的)14入退室管理、機器管理、環境セキュリティ
Technological(技術的)34アクセス制御、暗号化、ネットワークセキュリティ

ISMS構築のステップ

1. スコープ定義
   │  対象とする組織・システム・プロセスの範囲を決定

2. リスクアセスメント
   │  資産の洗い出し → 脅威の特定 → リスク評価 → リスク対応計画

3. 適用宣言書(SoA)作成
   │  Annex Aの93コントロールの適用可否と理由を文書化

4. コントロール実装
   │  技術的・組織的・人的・物理的コントロールの実装

5. 内部監査
   │  ISMS の有効性を自己評価

6. マネジメントレビュー
   │  経営層によるISMSの見直し

7. 認証審査(Stage 1 + Stage 2)
   │  認証機関による審査

8. 継続的改善(PDCA)
      年次サーベイランス審査 + 3年ごとの再認証

リスクアセスメントの実装例

// risk-assessment.ts

interface InformationAsset {
  id: string;
  name: string;
  category: 'data' | 'system' | 'service' | 'people' | 'physical';
  owner: string;
  classification: 'Restricted' | 'Confidential' | 'Internal' | 'Public';
  value: number;  // 1-5(資産価値)
}

interface ThreatScenario {
  id: string;
  assetId: string;
  threat: string;
  vulnerability: string;
  likelihood: number;  // 1-5
  impact: number;       // 1-5
  riskScore: number;    // likelihood * impact
  riskLevel: 'Very High' | 'High' | 'Medium' | 'Low' | 'Very Low';
  treatment: 'Mitigate' | 'Transfer' | 'Avoid' | 'Accept';
  controls: string[];
}

function calculateRiskLevel(likelihood: number, impact: number): string {
  const score = likelihood * impact;
  if (score >= 20) return 'Very High';
  if (score >= 15) return 'High';
  if (score >= 10) return 'Medium';
  if (score >= 5) return 'Low';
  return 'Very Low';
}

// リスクアセスメント例
const riskAssessment: ThreatScenario[] = [
  {
    id: 'RISK-001',
    assetId: 'ASSET-DB-001',
    threat: '外部攻撃者によるSQLインジェクション',
    vulnerability: '入力バリデーション不足',
    likelihood: 4,
    impact: 5,
    riskScore: 20,
    riskLevel: 'Very High',
    treatment: 'Mitigate',
    controls: [
      'A.8.25 Secure development lifecycle',
      'A.8.26 Application security requirements',
      'A.8.28 Secure coding',
    ],
  },
  {
    id: 'RISK-002',
    assetId: 'ASSET-CRED-001',
    threat: '従業員の認証情報の漏洩',
    vulnerability: 'フィッシング攻撃への脆弱性',
    likelihood: 3,
    impact: 4,
    riskScore: 12,
    riskLevel: 'Medium',
    treatment: 'Mitigate',
    controls: [
      'A.6.3 Information security awareness, education and training',
      'A.8.5 Secure authentication',
    ],
  },
];

PCI DSS(Payment Card Industry Data Security Standard)

PCI DSS v4.0 の12要件

要件番号カテゴリ要件
1ネットワークネットワークセキュリティコントロールの導入と維持
2ネットワーク全システムコンポーネントへのセキュアな設定の適用
3データ保護保存されたアカウントデータの保護
4データ保護オープンな公衆ネットワークでの伝送時の暗号化
5脆弱性管理悪意のあるソフトウェアからの保護
6脆弱性管理セキュアなシステムとソフトウェアの開発と維持
7アクセス制御ビジネス上の必要性に基づくアクセス制限
8アクセス制御ユーザーの識別とシステムコンポーネントへの認証
9物理セキュリティカード会員データへの物理的アクセスの制限
10監視システムコンポーネントおよびカード会員データへのアクセスのログ記録と監視
11テストセキュリティシステムおよびプロセスの定期的テスト
12ポリシー情報セキュリティポリシーの維持

PCI DSS対応の技術的実装

// pci-dss-controls.ts

// 要件3: カード情報の保護
interface CardDataProtection {
  storage: {
    panEncryption: 'AES-256-GCM';  // PAN暗号化
    panMasking: string;              // 表示時のマスク(前6桁・後4桁のみ表示可)
    cvvStorage: 'PROHIBITED';        // CVV保存禁止
    pinStorage: 'PROHIBITED';        // PIN保存禁止
    keyManagement: 'AWS KMS' | 'HSM';
    keyRotationDays: number;
  };
  tokenization: {
    enabled: boolean;
    provider: string;
    scope: string[];
  };
}

const cardProtection: CardDataProtection = {
  storage: {
    panEncryption: 'AES-256-GCM',
    panMasking: '****-****-****-1234',  // 後4桁のみ
    cvvStorage: 'PROHIBITED',
    pinStorage: 'PROHIBITED',
    keyManagement: 'AWS KMS',
    keyRotationDays: 90,
  },
  tokenization: {
    enabled: true,
    provider: 'Stripe',
    scope: ['payment-processing', 'recurring-billing'],
  },
};

// 要件10: ログ記録と監視
interface PciAuditLog {
  requiredEvents: string[];
  retentionPolicy: {
    onlineRetentionDays: number;
    archiveRetentionMonths: number;
    immutable: boolean;
  };
  syncRequirements: {
    ntpServer: string;
    maxDriftSeconds: number;
  };
}

const pciAuditConfig: PciAuditLog = {
  requiredEvents: [
    'user-authentication',         // ログイン成功/失敗
    'access-to-cardholder-data',   // カード情報へのアクセス
    'admin-actions',               // 管理者操作
    'audit-log-access',            // 監査ログ自体へのアクセス
    'system-level-events',         // システムイベント
    'security-events',             // セキュリティイベント
  ],
  retentionPolicy: {
    onlineRetentionDays: 90,       // 即時利用可能: 3ヶ月
    archiveRetentionMonths: 12,    // アーカイブ: 12ヶ月
    immutable: true,               // ログの改ざん防止
  },
  syncRequirements: {
    ntpServer: 'time.aws.com',
    maxDriftSeconds: 1,
  },
};

GDPR(General Data Protection Regulation)

7つの原則

原則説明技術的対策
Lawfulness合法的な根拠に基づく処理同意管理システム
Purpose Limitation目的の限定データカタログ、アクセス制御
Data Minimisation必要最小限のデータ収集スキーマレビュー
Accuracyデータの正確性データ品質チェック
Storage Limitation保持期間の制限自動削除ポリシー
Integrity & Confidentialityセキュリティの確保暗号化、アクセス制御
Accountability説明責任監査証跡、DPIA

データ主体の権利への技術対応

// gdpr-data-subject-rights.ts

interface DataSubjectRightsHandler {
  // アクセス権(第15条): データ主体のデータを全て提供
  handleAccessRequest(userId: string): Promise<PersonalDataExport>;

  // 削除権(忘れられる権利 第17条): データの完全削除
  handleErasureRequest(userId: string): Promise<ErasureResult>;

  // データポータビリティ権(第20条): 機械可読形式でデータ提供
  handlePortabilityRequest(userId: string): Promise<PortableData>;

  // 処理の制限権(第18条): データ処理の一時停止
  handleRestrictionRequest(userId: string): Promise<void>;
}

// 削除権(忘れられる権利)の実装
class GdprErasureHandler {
  async handleErasure(userId: string): Promise<ErasureResult> {
    const result: ErasureResult = {
      requestId: crypto.randomUUID(),
      userId,
      requestedAt: new Date().toISOString(),
      systems: [],
    };

    // Step 1: 全システムからユーザーデータを特定
    const dataSources = [
      { name: 'user-db', handler: this.eraseFromUserDb },
      { name: 'order-db', handler: this.anonymizeOrders },
      { name: 'analytics', handler: this.eraseFromAnalytics },
      { name: 'logs', handler: this.anonymizeLogs },
      { name: 'backups', handler: this.scheduleBackupPurge },
      { name: 'third-party', handler: this.notifyThirdParties },
    ];

    for (const source of dataSources) {
      try {
        await source.handler(userId);
        result.systems.push({ name: source.name, status: 'completed' });
      } catch (error) {
        result.systems.push({
          name: source.name,
          status: 'failed',
          error: (error as Error).message,
        });
      }
    }

    // Step 2: 監査ログ記録(削除自体の記録は保持義務あり)
    await this.auditLog.record({
      action: 'GDPR_ERASURE',
      userId,
      result,
      timestamp: new Date().toISOString(),
    });

    return result;
  }

  // 注文データは法的保持義務があるため匿名化
  private async anonymizeOrders(userId: string): Promise<void> {
    await prisma.order.updateMany({
      where: { userId },
      data: {
        customerName: 'ANONYMIZED',
        customerEmail: 'anonymized@deleted.local',
        shippingAddress: 'ANONYMIZED',
        phoneNumber: null,
      },
    });
  }
}

interface ErasureResult {
  requestId: string;
  userId: string;
  requestedAt: string;
  systems: { name: string; status: string; error?: string }[];
}

interface PersonalDataExport {
  format: 'JSON';
  data: Record<string, unknown>;
  generatedAt: string;
}

interface PortableData {
  format: 'JSON' | 'CSV';
  data: Record<string, unknown>;
}

監査準備のベストプラクティス

コントロールマッピング(フレームワーク横断)

コントロールSOC2ISO 27001PCI DSSGDPR
アクセス制御CC6.1A.8.3要件7,8Art.32
暗号化CC6.7A.8.24要件3,4Art.32
ログ監視CC7.2A.8.15要件10Art.30
インシデント対応CC7.3A.5.24-28要件12Art.33,34
変更管理CC8.1A.8.32要件6
リスク管理CC3.16.1要件12Art.35

ポイント: 共通するコントロールを1つの実装で複数のフレームワークに対応させる「統合コンプライアンスアプローチ」が効率的です。


まとめ

ポイント内容
SOC25つのTrust Services Criteriaに基づくサービス組織の信頼性証明
ISO 27001PDCAサイクルによるISMS構築と93のAnnex Aコントロール
PCI DSSカード情報保護の12要件、トークン化と暗号化が中核
GDPRデータ主体の権利保護、忘れられる権利への技術対応
統合アプローチフレームワーク横断のコントロールマッピングで効率的に対応

チェックリスト

  • SOC2のTrust Services Criteriaを説明できる
  • ISO 27001のリスクアセスメントプロセスを設計できる
  • PCI DSSのカード情報保護要件を実装できる
  • GDPRのデータ主体の権利に技術的に対応できる
  • 複数フレームワークの共通コントロールを効率的に実装できる

次のステップへ

次は「インシデント対応計画」です。セキュリティインシデントが発生した場合の対応プロセスとコミュニケーション計画を学びましょう。


推定読了時間: 30分