Zero trust

From williamzujkowski/standards · View interactive version

Zero trust is an AI agent skill from the GitHub repository williamzujkowski/standards. Zero-trust architecture operates on the principle: "Never trust, always verify." Unlike traditional perimeter-based security, zero-trust assumes breach and verifies every request regardless of origin.

How to use this skill

Skill file

Zero-Trust Security

Level 1: Quick Reference

Core Principles

Zero-trust architecture operates on the principle: "Never trust, always verify." Unlike traditional perimeter-based security, zero-trust assumes breach and verifies every request regardless of origin.

Fundamental Tenets:

Common Zero-Trust Patterns

1. Mutual TLS (mTLS)
# Istio PeerAuthentication for strict mTLS
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: production
spec:
  mtls:
    mode: STRICT

When to use: Service-to-service authentication, encrypted communication between microservices.

2. Service Mesh

Key benefits: Automatic encryption, fine-grained policies, observability.

3. BeyondCorp Model
# Identity-aware proxy configuration
apiVersion: v1
kind: Service
metadata:
  name: webapp
  annotations:
    cloud.google.com/neg: '{"ingress": true}'
    cloud.google.com/backend-config: '{"default": "beyondcorp-config"}'
spec:
  type: ClusterIP
  ports:
    - port: 8080
      targetPort: 8080

Use case: Remote access without VPN, identity-based access to applications.

Essential Checklist

Identity & Authentication:

Authorization:

Network Security:

Monitoring & Verification:

Architecture:

Quick Wins

  1. Enable mTLS in service mesh (2-4 hours)
  1. Implement Kubernetes NetworkPolicies (1-2 hours)
  1. Deploy workload identities (3-4 hours)

Level 2:

📚 Full Examples: See REFERENCE.md for complete code samples, detailed configurations, and production-ready implementations.

Implementation Guide

Zero-Trust Architecture Principles

Zero-trust architecture (ZTA) fundamentally reimagines security by eliminating implicit trust. Traditional castle-and-moat security assumes everything inside the perimeter is trustworthy, but ZTA treats every request as potentially hostile.

NIST 800-207 Zero Trust Tenets
  1. All data sources and computing services are considered resources
  1. All communication is secured regardless of network location
  1. Access to resources is granted on a per-session basis
  1. Access is determined by dynamic policy
  1. Monitor and measure integrity and security posture
  1. All resource authentication and authorization are dynamic and strictly enforced
  1. Collect as much information as possible about current state

NIST Controls:

Mutual TLS (mTLS) Implementation

Mutual TLS provides bidirectional authentication where both client and server verify each other's identity using certificates.

Certificate Management

See REFERENCE.md for complete implementation.

Istio mTLS Configuration

See REFERENCE.md for complete implementation.

Verification and Troubleshooting

See REFERENCE.md for complete implementation.

Service Mesh for Zero-Trust

Service meshes provide a dedicated infrastructure layer for service-to-service communication with built-in security, observability, and traffic management.

Istio Architecture

See REFERENCE.md for complete implementation.

Authorization Policies

See REFERENCE.md for complete implementation.

Linkerd Alternative

See REFERENCE.md for complete implementation.

Identity-Based Access (Workload Identities)

SPIFFE/SPIRE Implementation

SPIFFE (Secure Production Identity Framework For Everyone) provides a universal identity framework for workloads in heterogeneous environments.

See REFERENCE.md for complete implementation.

SPIRE Server Configuration:

See REFERENCE.md for complete implementation.

SPIRE Agent Configuration:

See REFERENCE.md for complete implementation.

Integrating SPIRE with Istio

See REFERENCE.md for complete implementation.

Workload Identity Example:

See REFERENCE.md for complete implementation.

Network Segmentation (Microsegmentation)

Microsegmentation divides networks into small, isolated segments to limit lateral movement and reduce blast radius.

Kubernetes NetworkPolicies

See REFERENCE.md for complete implementation.

Cilium Network Policies (Advanced)

See REFERENCE.md for complete implementation.

Continuous Verification and Monitoring

Zero-trust requires continuous validation of security posture and real-time threat detection.

Security Monitoring Stack

See REFERENCE.md for complete implementation.

Prometheus Metrics for Zero-Trust

See REFERENCE.md for complete implementation.

BeyondCorp Model

BeyondCorp removes the concept of a privileged corporate network, treating all access as potentially hostile.

Identity-Aware Proxy (IAP)

See REFERENCE.md for complete implementation.

Open Policy Agent (OPA) for Context-Aware Access

See REFERENCE.md for complete implementation.

OPA Integration with API Gateway:

See REFERENCE.md for complete implementation.

NIST 800-207 Zero Trust Architecture

NIST SP 800-207 provides a comprehensive framework for implementing zero-trust architecture in federal and enterprise systems.

Zero Trust Architecture Components

1. Policy Engine (PE):

2. Policy Administrator (PA):

3. Policy Enforcement Point (PEP):

Implementation Example:

See REFERENCE.md for complete implementation.

Trust Algorithm (TA)

The Trust Algorithm computes trust scores based on multiple inputs:

See REFERENCE.md for complete implementation.


Level 3: Deep Dive Resources

Official Documentation

NIST Standards:

SPIFFE/SPIRE:

Service Mesh:

BeyondCorp:

Books & Guides

Tools & Projects

Zero-Trust Platforms:

Open Source:

Training & Certifications

Related Skills

Deepen your zero-trust expertise with these complementary skills:

Community Resources

Examples

Basic Usage

// TODO: Add basic example for zero-trust
// This example demonstrates core functionality

Advanced Usage

// TODO: Add advanced example for zero-trust
// This example shows production-ready patterns

Integration Example

// TODO: Add integration example showing how zero-trust
// works with other systems and services

See examples/zero-trust/ for complete working examples.

Integration Points

This skill integrates with:

Upstream Dependencies

Downstream Consumers

Related Skills

Common Integration Patterns

  1. Development Workflow: How this skill fits into daily development
  2. Production Deployment: Integration with production systems
  3. Monitoring & Alerting: Observability integration points

Common Pitfalls

Pitfall 1: Insufficient Testing

Problem: Not testing edge cases and error conditions leads to production bugs

Solution: Implement comprehensive test coverage including:

Prevention: Enforce minimum code coverage (80%+) in CI/CD pipeline

Pitfall 2: Hardcoded Configuration

Problem: Hardcoding values makes applications inflexible and environment-dependent

Solution: Use environment variables and configuration management:

Prevention: Use tools like dotenv, config validators, and secret scanners

Pitfall 3: Ignoring Security Best Practices

Problem: Security vulnerabilities from not following established security patterns

Solution: Follow security guidelines:

Prevention: Use security linters, SAST tools, and regular dependency updates

Best Practices:


Bundled Resources

See templates/, resources/, and scripts/ directories for:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.