Forged Admin Tokens Bypass Every Control Downstream of Artifactory
Forged Admin Tokens Bypass Every Control Downstream of Artifactory
Your Intune policies are clean. Your Defender for Endpoint sensors are active. Your Entra ID Conditional Access rules are tight. None of it matters if an attacker holds a valid Artifactory admin token.
Why Artifactory Sits Outside Your Security Perimeter
JFrog Artifactory functions as the authoritative source of truth for software artifacts in most enterprise pipelines. It stores binaries, packages, container images, Helm charts, and deployment scripts. When Intune deploys a Win32 app or a PowerShell script, that content frequently originates from an Artifactory repository — either directly or through a CI/CD pipeline that pulls from one.
The critical architectural fact: Artifactory authenticates requests using access tokens, not Entra ID identities. These tokens are issued by Artifactory's own identity system. They carry scopes, permissions, and expiry windows that are entirely opaque to Microsoft Defender, Intune, or any Entra ID Conditional Access policy.
An attacker who obtains or forges an Artifactory admin token can:
- Replace a legitimate binary with a malicious one in a repository that Intune trusts
- Modify a PowerShell deployment script before it is pulled into an Intune package
- Inject a backdoored dependency into a package that passes hash validation at the wrong layer
- Rotate the artifact back to the legitimate version after deployment, erasing evidence
None of these actions trigger a Defender alert. None of them violate an Intune compliance policy. None of them appear in Entra ID sign-in logs.
Structural insight: Intune validates that a package matches its expected hash at deployment time — but if the hash stored in Intune was registered after the artifact was already replaced, the hash check confirms the tampered artifact, not the legitimate one.
---
How Tokens Are Forged or Stolen at Enterprise Scale
Artifactory admin tokens are compromised through several well-documented vectors, none of which require breaking encryption.
Hardcoded tokens in CI/CD pipelines are the most common exposure. Engineers embed tokens in Azure DevOps pipeline YAML, GitHub Actions workflows, or Terraform configurations. These tokens are often scoped as admin-level because developers want pipelines to "just work." When repositories are cloned, forked, or accidentally made public, the tokens travel with them.
Service account token sprawl compounds the problem. Artifactory tokens issued to service accounts frequently have no expiry set — a default configuration in older Artifactory deployments. A token issued three years ago for a decommissioned pipeline may still be valid and may still carry admin scope.
Token interception via misconfigured proxies or logging is less common but high-impact. Tokens passed as query parameters (rather than Authorization headers) appear in proxy logs, SIEM ingestion pipelines, and CDN access logs in plaintext.
Artifactory's own API allows admin tokens to generate child tokens with equivalent or narrower scope. An attacker with a single admin token can mint an unlimited number of additional tokens, distribute them across infrastructure, and maintain persistence even after the original token is rotated.
The JFrog Platform does provide token revocation and audit logging �� but these controls only function if they are configured, monitored, and integrated into your detection pipeline. Most enterprise deployments treat Artifactory as infrastructure, not as a security boundary.
---
The Zero-Trust Compliance Gap This Creates
NIST SP 800-207 defines zero trust as requiring that all resource requests be authenticated, authorized, and continuously validated — regardless of network location. The implicit assumption is that the identity making the request is a known, managed principal.
Artifactory admin tokens violate this model structurally. They are bearer tokens: whoever holds the token is authenticated. There is no continuous validation of the token holder's identity against Entra ID. There is no device compliance check. There is no MFA requirement at the point of artifact access.
For organizations operating under FedRAMP High or SOC 2 Type II controls, this creates a provenance gap. You cannot prove that the artifact deployed to an endpoint is the artifact that was approved, tested, and signed — because the chain of custody between the repository and the endpoint is not cryptographically enforced end-to-end.
Intune's Win32 app deployment model uses a detection rule and a hash to verify package integrity. But that hash is stored in Intune at the time the package is uploaded. If the artifact was compromised before upload, the hash confirms the malicious version. If the artifact was compromised after upload but the Intune package was re-uploaded by an attacker with Intune admin access (itself a downstream risk), the hash is updated to match.
The compliance frameworks assume artifact provenance is enforced. The tooling does not enforce it. That gap is your exposure.
---
Auditing Token Exposure Before the Next Deployment
The first operational step is establishing what tokens exist, what scope they carry, and whether any of them have been exposed in code repositories or pipeline logs.
Query Artifactory's token API to enumerate all active tokens. This requires an existing admin token, which is itself a governance concern — but it is the starting point for a token audit.
$ArtifactoryBaseUrl = "https://artifactory.yourdomain.com/artifactory"
$AdminToken = (Get-AzKeyVaultSecret -VaultName "YourVault" -Name "ArtifactoryAdminToken").SecretValue |
ConvertFrom-SecureString -AsPlainText
$Headers = @{
"Authorization" = "Bearer $AdminToken"
"Content-Type" = "application/json"
}
$Response = Invoke-RestMethod `
-Uri "$ArtifactoryBaseUrl/api/v2/tokens" `
-Method GET `
-Headers $Headers
$Response.tokens | Select-Object subject, expiry, scope, token_id |
Sort-Object expiry |
Format-Table -AutoSize
$NonExpiringTokens = $Response.tokens | Where-Object { $_.expiry -eq 0 }
Write-Warning "Non-expiring tokens found: $($NonExpiringTokens.Count)"
$NonExpiringTokens | Select-Object subject, scope, token_id | Format-Table -AutoSizeScan Azure DevOps repositories for hardcoded tokens using a KQL query against your Microsoft Defender for Cloud Apps or Azure DevOps audit logs. The pattern below targets token strings that match Artifactory's token format (a base64-encoded JWT-like structure prefixed with cmVm).
// KQL: Detect potential Artifactory token exposure in Azure DevOps push events
// Run in: Microsoft Sentinel | Log Analytics Workspace connected to Azure DevOps audit logs
AzureDevOpsAuditing
| where TimeGenerated > ago(30d)
| where OperationName == "Git.RefUpdateRow" or OperationName == "Git.Push"
| extend CommitMessage = tostring(Data.CommitMessage)
| extend ActorUPN = tostring(ActorUPN)
| extend RepoName = tostring(Data.RepoName)
| extend ProjectName = tostring(Data.ProjectName)
// Artifactory tokens often begin with "cmVm" (base64 for "ref") or match JWT structure
| where CommitMessage matches regex @"eyJ[A-Za-z0-9\-_]{20,}\.[A-Za-z0-9\-_]{20,}"
or CommitMessage contains "AKCp" // JFrog token prefix pattern
or CommitMessage contains "Bearer"
| project TimeGenerated, ActorUPN, ProjectName, RepoName, CommitMessage
| order by TimeGenerated descCross-reference Artifactory access logs with Intune deployment events to identify whether any artifact pull occurred outside of expected service account activity. This requires exporting Artifactory access logs to your SIEM and correlating timestamps with Intune deployment records from Microsoft Graph.
Connect-MgGraph -Scopes "DeviceManagementApps.Read.All", "DeviceManagementManagedDevices.Read.All"
$DeploymentCutoff = (Get-Date).AddDays(-7).ToString("yyyy-MM-ddTHH:mm:ssZ")
$Apps = Get-MgDeviceAppManagementMobileApp -Filter "isof('microsoft.graph.win32LobApp')" -All
foreach ($App in $Apps) {
$AppId = $App.Id
$AppName = $App.DisplayName
# Get device install status for each app
$InstallStatuses = Get-MgDeviceAppManagementMobileAppDeviceStatuse `
-MobileAppId $AppId -All |
Where-Object { $_.LastSyncDateTime -ge $DeploymentCutoff }
foreach ($Status in $InstallStatuses) {
[PSCustomObject]@{
AppName = $AppName
AppId = $AppId
DeviceName = $Status.DeviceName
InstallState = $Status.InstallState
LastSync = $Status.LastSyncDateTime
ErrorCode = $Status.ErrorCode
}
}
} | Export-Csv -Path ".\IntuneWin32DeploymentAudit_$(Get-Date -Format yyyyMMdd).csv" -NoTypeInformation
Write-Host "Export complete. Cross-reference timestamps with Artifactory access logs in your SIEM."---
Detection Strategy: Moving the Alert Upstream
Endpoint detection reacts to execution. You need detection at the artifact layer, before execution ever reaches a managed device.
Artifactory Audit Log Integration with Microsoft Sentinel is the foundational control. Artifactory emits structured audit events for every token use, artifact push, artifact pull, and permission change. These logs must flow into your Log Analytics workspace. If they are not there today, that is a gap in your detection coverage — not a gap in Artifactory's capability.
Once ingested, build analytics rules that alert on:
- Any artifact push to a production repository by a token whose subject does not match an approved service account list
- Any admin token creation event, particularly tokens with no expiry or with
admin:*scope - Any artifact pull from a production repository outside of pipeline execution windows (e.g., 2 AM on a Sunday)
- Any permission escalation on a repository that feeds an Intune deployment pipeline
Artifact signing with Sigstore or JFrog's built-in signing provides a cryptographic chain of custody that Intune cannot provide on its own. When an artifact is signed at build time and the signature is verified at pull time, a forged or substituted artifact fails verification before it enters the deployment pipeline. This is the control that closes the provenance gap.
Defender for Endpoint's behavioral detection remains relevant — but only as a last line of defense. If a malicious artifact reaches an endpoint and executes, Defender's process tree analysis, AMSI integration, and network behavior monitoring may catch the payload. Do not position this as the primary control. It is the fallback when every upstream control has failed.
---
Governance Recommendations for Intune Architects
If you own the endpoint deployment pipeline, these are the controls you need to drive — even if Artifactory is owned by a different team.
Require artifact provenance attestation before Intune package creation. Every Win32 app package uploaded to Intune should have a documented artifact hash that was verified against the Artifactory repository at a specific commit SHA. This creates an auditable record that connects the Intune package to a specific build artifact.
Enforce token expiry as a pipeline gate. No CI/CD pipeline that feeds an Intune deployment should be permitted to use a non-expiring token. This is a policy control, not a technical one — it requires coordination with your DevOps and platform engineering teams. Document it in your pipeline governance standard.
Separate read and write permissions on production repositories. Deployment pipelines that pull artifacts for Intune packaging should use read-only tokens scoped to specific repositories. Admin tokens should never appear in pipeline configuration. Write access to production repositories should require a separate, short-lived token issued through a secrets manager.
Conduct quarterly token audits. The PowerShell script above provides the starting point. Schedule it as a recurring task, export results to a SharePoint list or a governance tracker, and require sign-off from the repository owner for any non-expiring token that remains active.
Map your artifact repositories to your Intune app inventory. You need to know which Artifactory repositories feed which Intune applications. This mapping does not exist by default — you have to build it. Without it, you cannot scope your detection rules or your audit procedures to the repositories that actually matter for endpoint security.
---
Final Thoughts
The endpoint security stack you have built is not wrong. Intune, Defender for Endpoint, and Entra ID Conditional Access are the right controls for the right threat model. The problem is that the threat model assumed artifact provenance was someone else's problem.
It is not. When a malicious package deploys to 40,000 endpoints because an attacker held a valid Artifactory admin token, the incident report will not say "Artifactory was compromised." It will say "endpoint security failed." That framing is politically convenient for the attacker and operationally damaging for your team.
The controls described here — token auditing, Sentinel integration, artifact signing, pipeline governance — are not exotic. They are the upstream extension of the zero-trust model you are already operating. The gap is not in your tooling. It is in the assumption that your security boundary starts at the endpoint.
It starts at the artifact.
---