Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Shield

Elastic Co
March 19, 2015
6.6k

 Shield

While it has always been possible to secure Elasticsearch clusters by deploying them within well-secured environments, we continuously received requests from customers and users to have a more integrated solution. In response, we created Shield, our first security plugin for Elasticsearch, which went GA in late January.

In this talk, we’ll deep dive into this first release Shield. We went to great lengths preparing Elasticsearch itself for security, not just on its extensibility side, but also carefully rethinking how the data flows in it. We’ve built a foundation that not only delivers immediate tangible value when it comes to securing Elasticsearch clusters, but also enables us to extend its functionality incrementally and rapidly over time.

Among other topics, we’ll cover:
*Authentication
*Authorization
*Encrypted Communication & Node Authentication
*IP Filtering
*Audit Trails

Attendees will leave this talk with a solid understanding of Shield’s functionality, architecture and why it’s the best possible tool to secure Elasticsearch and your ELK cluster.

Elastic Co

March 19, 2015
Tweet

More Decks by Elastic Co

Transcript

  1. { } Securing Elasticsearch • Nginx as a reverse proxy

    • IP tables • Use aliases + filters 4
  2. { } 12 (a.k.a) who are you? & are you

    really who you claim to be?
  3. { } The User • Represents the actor behind an

    API call – identified by a principal (username) – has credentials (e.g. password) • Users have roles • relates to authorization… so we’ll discuss it later • fyi, users without roles can’t do much… 13
  4. { } Realms 15 /_api Realm Shield User auth_token please

    execute this api… oh.. and here’re my credentials
  5. { } Realms • esusers – native file based user

    store • LDAP – integrating in the enterprise • Active Directory – more enterprises 22
  6. { } esusers • Simple & Native – file based,

    htpasswd-like config (bcrypt hashing) – no dependency on 3rd party systems • esusers tool will assist you manage users • Files are auto-loaded when changed • Great for small to medium deployments 23
  7. { } LDAP (you know.. for the enterprise) • Authenticate

    (bind) to LDAP server • Translate LDAP groups of user to Shield roles – using a dedicated role_mapping.yml file • Shield 1.1 – is able to search for the user before the bind – can load-balance between multiple LDAP servers 24
  8. { } Anonymous User (Shield 1.1) “default” user to take

    the anonymous user place 26 Realm Shield auth_token failure
  9. { } Role Based Access Control (RBAC) • role -

    a named set of permissions • permission – a set of cluster wide privileges – a set of privileges on one or more indices/aliases • privilege - a set of one or more action names 32
  10. { } Users & Roles • Users have roles •

    The permission of the user are the combined permission of all its roles • Roles are defined in roles.yml 34
  11. { } Data Travels • Network Channels – transport: inter-node

    communication – http: REST interface • MITM (man-in-the-middle) – sniffing, tampering data, imposture 38
  12. { } SSL/TLS • This wheel was already invented •

    Based on native Java support • Integrated in all supported network channel – http/s & transport 39
  13. { } Node2 Self-Signed Certs 40 Node1 we generate a

    self-signed cert for every node
  14. { } Node2 Self-Signed Certs 41 Node1 c1 c2 we

    generate a self-signed cert for every node
  15. { } Node2 Self-Signed Certs 42 Node1 c1 c2 for

    every node, we import its generated cert on all other nodes
  16. { } Node2 Self-Signed Certs 43 Node1 c1 c2 for

    every node, we import its generated cert on all other nodes TLS handshake
  17. { } Node2 Self-Signed Certs 44 Node1 c1 c2 the

    challenge is the elastic nature of… well… elasticsearch TLS handshake
  18. { } Node2 Self-Signed Certs 45 Node1 c1 c2 the

    challenge is the elastic nature of… well… elasticsearch Node 3
  19. { } Node2 Self-Signed Certs 46 Node1 c1 c2 the

    challenge is the elastic nature of… well… elasticsearch Node 3 c2 c1
  20. { } Node2 Self-Signed Certs 47 Node1 c1 c2 the

    challenge is the elastic nature of… well… elasticsearch Node 3 c2 c1
  21. { } Node2 Self-Signed Certs 48 Node1 c1 c2 the

    challenge is the elastic nature of… well… elasticsearch Node 3 c3 c2 c1 c3
  22. { } Node2 Self-Signed Certs 49 Node1 c1 c2 the

    challenge is the elastic nature of… well… elasticsearch c3 c3 Node 3 c2 c1
  23. { } Self-Signed Certs 50 the challenge is the elastic

    nature of… well… elasticsearch handshake Node2 Node1 c1 c2 c3 c3 Node 3 c2 c1
  24. { } Self-Signed Certs 51 the challenge is the elastic

    nature of… well… elasticsearch Node2 Node1 c1 c2 c3 c3 Node 3 c2 c1 requires cluster restart handshake
  25. { } Node2 CA-Signed Certs 54 Node1 c1 c2 we

    generate a cert for every node CA
  26. { } ca ca Node2 CA-Signed Certs 58 Node1 we

    also get the CA cert c1 c2 CA
  27. { } Node2 CA-Signed Certs 60 Node1 we can now

    open a secure channel between the nodes ca ca c1 c2 TLS handshake CA
  28. { } CA-Signed Certs 64 it’s elastic! Node1 ca c1

    Node2 ca c2 Node 3 c3 ca handshake CA
  29. { } CA-Signed Certs 65 it’s elastic! Node1 ca c1

    Node2 ca c2 Node 3 c3 ca no cluster restart required! handshake CA
  30. { } Node to Node Authentication • Allow/Deny nodes trying

    to connect to the cluster – unknown nodes may be malicious • Relying on SSL/TLS – if a node has a valid certs, access granted 68
  31. { } Client to Node Authentication • Allow/deny connections from

    clients • usually SSL/TLS is a one way protection – the client trusts the server • with client certs, it is a two way protection – the client trusts the server – the server trusts the client 69
  32. { } Transport Profiles • Added to elasticsearch 1.4 •

    Enables binding to multiple host:port pairs • Enables clear separation between transport client and inter node communication • client certs within the cluster • transport client doesn’t need client certs 70
  33. { } IP Filtering • A simple alternative to IP

    tables • Control who can connect to the cluster based on hosts, IPs and CIDRs allow/deny rules. • Built into the internal networking layers in elasticsearch – transport & http • Shield 1.1 lets you update the filters dynamically 71
  34. { } • Records the activity on each node in

    the cluster – anonymous_access_denied – authentication_failed – access_denied /access_granted – connection_denied / connection_granted 74 Audit Trail
  35. { } Access Logs • An audit trail that logs

    activity to log files • Utilizes the existing logging infrastructure • separate access.log files 75
  36. { } Shield 1.1 • Anonymous access • Enhanced LDAP

    support • Dynamically update IP filters 77
  37. { } Shield X.X • Additional Realms – new native

    realm managed via API – kerberos, other SSO mechanisms • Additional authentication methods • API token/key authentication • Enhanced support for kibana 78