필드 및 문서 수준 보안
사용자 역할에 따라 특정 필드 또는 개별 문서에 대한 접근을 제한하여 세밀한 보안을 구현합니다.
필드 및 문서 수준 보안은(는) CoddyKit의 무료 Elasticsearch & Full Text Search Systems 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Elasticsearch & Full Text Search Systems 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Why Fine-Grained Security?
In Elasticsearch, you might not want every user to see all data. Sometimes, certain users should only access specific parts of documents or only a subset of documents.
This is where fine-grained security comes in. It allows you to control access at a much more detailed level than just index permissions.
What is Field Level Security (FLS)?
Field Level Security (FLS) lets you restrict which fields within a document a user can see. Imagine a product document with many fields.
- A sales agent might only need to see
product_nameandprice. - An inventory manager might need
quantityandsupplier_id.
FLS ensures users only retrieve the fields relevant to their role, hiding sensitive or irrelevant data.
Configuring FLS in Roles
FLS is configured within a user's role definition. You specify which fields are granted (allowed) or excepted (disallowed) for specific indices.
Using grant is generally safer as it follows a whitelist approach, only allowing explicitly listed fields.
{
"applications": [],
"cluster": [],
"indices": [
{
"names": ["products"],
"privileges": ["read"],
"field_security": {
"grant": ["product_name", "price"]
}
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {}
}FLS Example: Product Viewer Role
Let's create a role named product_viewer. Users with this role can read documents from the products index, but only see the product_name and price fields.
Other fields like internal_cost or supplier_secret would be hidden.
PUT /_security/role/product_viewer
{
"indices": [
{
"names": ["products"],
"privileges": ["read"],
"field_security": {
"grant": ["product_name", "price"]
}
}
]
}What is Document Level Security (DLS)?
Document Level Security (DLS) allows you to restrict which documents a user can see. Instead of hiding fields, DLS filters entire documents based on a query.
For example, a regional sales manager should only see sales orders from their specific region, not from other regions.
Configuring DLS in Roles
DLS is configured in a role using a query object. This query acts as a filter that is automatically applied to all search requests made by users assigned to that role.
Only documents matching this query will be returned to the user, regardless of their original search request.
{
"applications": [],
"cluster": [],
"indices": [
{
"names": ["sales_data"],
"privileges": ["read"],
"query": {
"term": { "region.keyword": "east" }
}
}
],
"run_as": [],
"metadata": {},
"transient_metadata": {}
}DLS Example: East Region Sales
Let's create a role named east_sales_manager. Users with this role can read documents from the sales_data index, but only those documents where the region field is east.
This effectively isolates sales data by region.
PUT /_security/role/east_sales_manager
{
"indices": [
{
"names": ["sales_data"],
"privileges": ["read"],
"query": {
"term": { "region.keyword": "east" }
}
}
]
}Combining FLS and DLS
You can apply both Field Level Security and Document Level Security within a single role definition.
This means a user could be restricted to seeing only specific fields, AND only specific documents that match a filter query. This offers a very powerful way to create fine-grained access control.
Best Practices for FLS/DLS
When implementing FLS and DLS:
- Design roles carefully: Plan out exactly what each user group needs to see.
- Test thoroughly: Always verify that your roles provide the intended level of access, and nothing more.
- Use `grant` for FLS: Whitelisting fields is generally more secure than blacklisting.
- Keep DLS queries simple: Complex queries can impact performance.
- Least privilege: Always grant the minimum necessary permissions.
Quick Check: Security Features
Which of the following statements about Elasticsearch Field and Document Level Security are true?
Recap: Fine-Grained Security
You've learned about Field Level Security (FLS) for restricting visible fields and Document Level Security (DLS) for filtering documents based on queries.
These powerful features, configured within user roles, enable you to create highly granular access control, ensuring users only see the data they are authorized for. This is crucial for maintaining data privacy and security in your Elasticsearch cluster.
자주 묻는 질문
“필드 및 문서 수준 보안” 강의는 무료인가요?
네 — “필드 및 문서 수준 보안” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Elasticsearch & Full Text Search Systems 강의 전체를 잠금 해제할 수 있습니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
“필드 및 문서 수준 보안”에서 뭘 배우나요?
사용자 역할에 따라 특정 필드 또는 개별 문서에 대한 접근을 제한하여 세밀한 보안을 구현합니다. 브라우저에서 직접 실행하는 실습 코드로 Elasticsearch & Full Text Search Systems을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Elasticsearch & Full Text Search Systems을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Elasticsearch & Full Text Search Systems은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“필드 및 문서 수준 보안” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Elasticsearch & Full Text Search Systems 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Elasticsearch & Full Text Search Systems 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 사용자 인증과 역할
- 필드 및 문서 수준 보안
- TLS/SSL과 네트워크 보안
- API 키 및 감사 로그 기록