Microservices security & tracking

Security:

  • AAA: Authentication, Authorization, Accounting/Auditing
  • Secure interprocess communication (TLS)

Security frameworks:

  • PassportJS: NodeJS security framework on Authentication
  • Spring Security/Apache Shiro: Java frameworks for Authentication/Authorization

Authentication security context:

  • In-memory: Can be used within the same process.
  • Centralized session: Session stored externally such as in a database. Eg: API token for use with an API gateway with an Authentication service.

Authorization:

  • Opaque tokens such as UUIDs. Reduce performance, availability & increase latency.
  • Transparent token. Eg: JWT: JSON Web Token is a popular standard. Since self-contained, irrevocable, hence needs short expiration times & reissuals.
  • OAuth 2.0: Has an Authorization Server for an access token & refresh token. Eg framework: Spring OAuth internally using JWTs.

Externalized configuration:

  • Push model: Push config props to service. Eg: Spring Boot.
  • Pull model: Service reads from config server. Eg: Databases, version control systems or configuration servers.

Storing sensitive data with credentials using configuration servers:

Centralized config, transparent decryption, dynamic reconfig.

  • Hashicorp Vault
  • AWS Parameter Store
  • Spring Cloud Config Server

Observing & Tracking:

  • Health check API
  • Log aggregation: Centralized logging system such as ELK (ElasticSearch, Logstash, Kibana), Fluentd, Apache Flume, AWS CloudWatch.
  • Distributed tracing: trace id that flows between services. Common standard for trace id: Zipkin B3 propagation standard. Aspect Oriented Programming libraries that auto-log such as Spring Cloud Sleuth. Distributed tracing servers such as Twitter's Zipkin (using a database supporting http or a message broker) or AWS X-ray.
  • Exception tracking. Eg: Exception tracking services such as Honeybadger (cloud-based), Sentry.io (open-source & deploy in-house).
  • Application metrics: Eg: Micrometer Metrics for collection. AWS Cloudwatch metrics is a push model service. Prometheus (open-source) is a pull model service with data visualization tool: Grafana.
  • Audit logging

Robustness:

  • Handle failure with network timeouts, limit requests & a circuit breaker (fail all requests if many requests start failing).
  • Frameworks: Netflix Hystrix (JVM), Polly (.NET).

Chassis/Mesh:

  • Microservice chassis: Framework or set of frameworks to address common requirements. Eg: Spring Boot, Spring Cloud, Go Kit. But language specific.
  • Service mesh: Networking infrastructure mediator that simplifies Chassis. Eg: Linkerd, Istio, Conduit.

Istio Service Mesh features:

  • Traffic management: Service discovery, load balancing, routing rules, circuit breakers.
  • Security: TLS
  • Telemetry: Network traffic metrics, distributed tracing
  • Policy enforcement: quotas & rate limits

Service Mesh Control Plane:

  • Pilot: Configures Envoy proxies & data plane based off deployed services. Envoy proxy is performant & supports multiple protocols (tcp, http, https, MongoDB, Redis, DynamoDB), TLS & other interservice features like auto-retires, rate limiting & circuit breakers. Envoy is a sidecar container within the service's pod.
  • Mixer: Collects telemetry from Envoy proxies & enforces policies.

Source: Microservices Patterns by Chris Richardson

要查看或添加评论,请登录

Swaminathan Saikumar的更多文章

  • Why is Go fast?

    Why is Go fast?

    Why is Go fast? Go has become popular for microprocesses & for scaling. What are the design decisions that make Go…

  • Cloud native architecture-an overview

    Cloud native architecture-an overview

    Any infrastructure has two main components: compute & storage. Software needs compute to run & storage to read/write.

  • I Bonds during high inflation

    I Bonds during high inflation

    During times of high inflation in the USA, consider the Series I Bonds issued by the US treasury. Currently, I bonds…

  • Microservices deployment

    Microservices deployment

    History of deployment options: Physical machines: 1990s. Fast deployment, best performance.

  • Isolation & Locks

    Isolation & Locks

    The CAP theorem states that two out three of Consistency, Availability & Partition Tolerance may be achieved. RDBMS…

  • Messaging architecture

    Messaging architecture

    Message formats: Text, such as JSON/XML. Readable & easier for debugging.

  • Microservices API Gateway

    Microservices API Gateway

    Benefits: Instead of specific services, clients talk to the API gateway, which provides a client-specific API…

  • SQL, NoSQL or Hadoop for 'Big Data'?

    SQL, NoSQL or Hadoop for 'Big Data'?

    In an earlier post, we had looked at how to use the 3Vs (Volume, Velocity & Variety) of data & the CAP theorem…

  • Choose relational vs NoSQL database?

    Choose relational vs NoSQL database?

    Relational or NoSQL? You have this great software application in mind. Now, to implement it, what database should you…

  • Scaling applications-an overview

    Scaling applications-an overview

    As a business grows, its software applications will need to scale. Computing bottleneck Run multiple identical…

社区洞察

其他会员也浏览了