ความปลอดภัยของ Redshift

Introduction to Redshift

Jason Myers

Principal Engineer

ความปลอดภัยของ Redshift

  • การควบคุมการเข้าถึงระดับคอลัมน์
  • ความปลอดภัยระดับแถวผ่านนโยบาย
  • การปิดบังข้อมูลผ่านนโยบาย

Redshift Security Portfolio

Introduction to Redshift

สิทธิ์ระดับคอลัมน์

  • ซ่อนคอลัมน์ทั้งหมด
  • ตรวจสอบได้ผ่าน SVV_COLUMN_PRIVILEGES
SELECT *
  FROM SVV_COLUMN_PRIVILEGES
 WHERE relation_name = 'products';
relation_name | column_name  | privilege_type | identity_name | identity_type
==============|==============|================|===============|==============
products      | product_name | SELECT         | amelia        | user
products      | product_name | SELECT         | analytics     | role
Introduction to Redshift

ความปลอดภัยระดับแถว

  • นโยบายที่กรองข้อมูลล่วงหน้า
CREATE RLS POLICY policy_books
WITH (category VARCHAR(255))
USING (category = 'Dark Academia');
SELECT product_line, category, product_name
FROM products;
product_line | category      | product_name
=============|===============|===================
Books        | Dark Academia | A Deadly Education
Introduction to Redshift

ความปลอดภัยระดับแถว

  • ใช้ SVV_RLS_POLICY เพื่อดูนโยบาย
SELECT polname AS policy_name, 
       polatts AS column_details,
       polqual AS condition
  FROM SVV_RLS_POLICY;
policy_name  | column_details                                 | condition
 ============|================================================|===========================
policy_books | [{"colname":"category","type":"VARCHAR(255)"}] | category = 'Dark Academia'
Introduction to Redshift

มุมมองผู้ดูแลความปลอดภัยระดับแถว

  • Superuser ใช้ SVV_RLS_APPLIED_POLICY เพื่อดูคิวรีที่ได้รับผลกระทบ
SELECT username, 
       command, 
       relschema, 
       relname, 
       polname,
FROM SVV_RLS_APPLIED_POLICY;
username | command | relschema | relname  | polname  
=========|=========|===========|==========|=============
aashvi   |    s    | public    | products | policy_books 
Introduction to Redshift

ภาพรวม Dynamic Masking

  • นโยบายที่ปิดบังค่าที่คิวรีส่งคืน
  • เฉพาะ superuser หรือผู้ที่ได้รับสิทธิ์เท่านั้นที่มองเห็นได้
  • ใช้กับ
    • หมายเลขประจำตัวประชาชน (เช่น Social Security Number)
    • บัตรเครดิต
SELECT name, social_security_number
  FROM customers;
name     | social_security_number
======== | =======================
John Doe | XXX-XX-1234
Jane Doe | XXX-XX-5678
Introduction to Redshift

มาฝึกกันเถอะ!

Introduction to Redshift

Preparing Video For Download...