Scenario Experience


Feishu
Choose your preferred way to join


Data security is the lifeline of enterprise applications. This article shares best practices for implementing data security in AskTable to help you build a secure and reliable data analysis system.
Layers AskTable Focuses On:
CIA Triad:
Principle of Least Privilege:
Separation of Duties:
Defense in Depth:
Four-Level Permission System:
Permission Matrix:
| Role | Datasource Management | Permission Config | Data Query | Sensitive Data |
|---|---|---|---|---|
| Super Admin | ✅ | ✅ | ✅ | ✅ |
| Project Admin | ✅ | ✅ | ✅ | ⚠️ |
| Data Admin | ⚠️ | ❌ | ✅ | ❌ |
| Regular User | ❌ | ❌ | ✅ | ❌ |
| Read-Only User | ❌ | ❌ | ⚠️ | ❌ |
Role Definition:
{
"roles": [
{
"name": "ceo",
"description": "CEO - View all data",
"policies": []
},
{
"name": "regional_manager",
"description": "Regional Manager - View regional data",
"policies": ["regional_access", "hide_pii"]
},
{
"name": "sales",
"description": "Sales - View own data",
"policies": ["own_data_only", "hide_pii", "hide_financial"]
},
{
"name": "analyst",
"description": "Data Analyst - View masked data",
"policies": ["hide_pii", "aggregated_only"]
}
]
}
PII (Personal Identifiable Information):
Financial Data:
Business Secrets:
Method 1: Field-Level Masking (Hide Fields)
{
"permission": "deny",
"name": "hide_pii",
"dataset_config": {
"datasource_ids": "*",
"regex_patterns": {
"fields_regex_pattern": ".*phone.*|.*mobile.*|.*email.*|.*id_card.*|.*ssn.*"
}
}
}
Method 2: Data Mask
Implementation at database level:
-- Create view with masked phone numbers
CREATE VIEW users_masked AS
SELECT
id,
name,
CONCAT(LEFT(phone, 3), '****', RIGHT(phone, 4)) as phone,
email
FROM users;
Method 3: Aggregation Masking
Only allow querying aggregated data:
{
"permission": "allow",
"name": "aggregated_only",
"dataset_config": {
"datasource_ids": "ds_001",
"regex_patterns": {
"tables_regex_pattern": "^(daily_summary|monthly_report)$"
}
}
}
L1 - Complete Hide:
L2 - Partial Mask:
L3 - Aggregation Display:
L4 - Complete Data:
Record Content:
Log Example:
{
"timestamp": "2026-03-08T10:30:15Z",
"user_id": "user_12345",
"role_id": "role_sales",
"action": "query",
"datasource_id": "ds_001",
"question": "Query this month's sales",
"sql": "SELECT SUM(amount) FROM orders WHERE ...",
"status": "success",
"rows_returned": 1,
"execution_time_ms": 234
}
Detection Rules:
Alert Mechanism:
# Example: Detect anomalous queries
if query_count > 100 in last_hour:
send_alert("User {user_id} queried {query_count} times in 1 hour")
if accessed_sensitive_fields:
send_alert("User {user_id} accessed sensitive fields {fields}")
Review Checklist:
GDPR (EU General Data Protection Regulation):
Equal Protection 2.0 (China):
SOC 2:
Data Classification:
Public Data → Internal Data → Confidential Data → Top Secret Data
Access Control:
Data Lifecycle:
L1 - Low Risk:
L2 - Medium Risk:
L3 - High Risk:
L4 - Critical:
Discovery Phase:
Response Phase:
Recovery Phase:
Summary Phase:
# Data Breach Emergency Response Plan
## 1. Discovery and Reporting
- Discoverer: ___________
- Discovery time: ___________
- Impact scope: ___________
## 2. Immediate Actions
- [ ] Isolate affected systems
- [ ] Notify security team
- [ ] Notify management
## 3. Investigation and Analysis
- [ ] Determine data breach scope
- [ ] Determine cause of breach
- [ ] Determine affected users
## 4. Remediation Measures
- [ ] Fix security vulnerabilities
- [ ] Update permission configuration
- [ ] Reset affected accounts
## 5. Follow-up
- [ ] Notify affected users
- [ ] Update security documentation
- [ ] Organize security training
Background: A bank uses AskTable for data analysis
Security Requirements:
Implementation Plan:
1. Data Classification:
L1 Public: Product information, interest rate information
L2 Internal: Statistical reports, trend analysis
L3 Confidential: Customer information, transaction records
L4 Top Secret: Risk control models, core algorithms
2. Permission Configuration:
{
"roles": [
{
"name": "teller",
"policies": ["own_customers_only", "hide_balance"]
},
{
"name": "manager",
"policies": ["branch_data_only", "hide_pii"]
},
{
"name": "risk_analyst",
"policies": ["aggregated_only", "no_individual_data"]
}
]
}
3. Audit Requirements:
Background: A hospital uses AskTable to analyze patient data
Security Requirements:
Implementation Plan:
1. Data Masking:
{
"permission": "deny",
"name": "hide_patient_info",
"dataset_config": {
"datasource_ids": "*",
"regex_patterns": {
"fields_regex_pattern": ".*name.*|.*id_card.*|.*phone.*|.*address.*"
}
}
}
2. Access Control:
3. Audit Logs:
Enterprise data security requires:
Technical Measures: ✅ Complete permission system ✅ Effective data masking ✅ Comprehensive audit monitoring
Management Measures: ✅ Clear security policies ✅ Regular security reviews ✅ Complete emergency response plans
Personnel Measures: ✅ Security awareness training ✅ Clear division of responsibilities ✅ Strict operational standards
Next Steps:
Related Reading:
Technical Exchange:
No coding required. Ask questions in natural language and AI generates SQL queries and visualizations automatically.
Start your free trial now and experience AI-powered data analysis with AskTable.