Repository navigation
Conversation
The framework called Manifest.DefaultVersion("appdynamics"), but the
dependency was removed from manifest.yml in 5.0 because AppDynamics
requires authentication to download the agent.
Install the agent from an agent-uri service credential, an application-
provided archive or directory, or a forked buildpack manifest, following
the existing Checkmarx, New Relic and IBM JRE patterns.
Contributor
Author
|
this was quickly made as a example. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved security flaws can expose URL credentials and signed-URL tokens through errors and allow chained archive symlinks to overwrite files outside the agent directory.
3 open issues
What changed in this PR
This PR replaces AppDynamics’ unavailable upstream manifest dependency with bring-your-own-agent support, allowing applications to supply the agent while retaining a manifest fallback for forked buildpacks.
Changes:
- Adds service-URL downloads, application-provided archives or directories, and forked-manifest installation.
- Makes service matching deterministic and adds archive validation and URL redaction.
- Expands framework tests and documents agent setup and fallback behavior.
| File | Description |
|---|---|
src/java/frameworks/app_dynamics.go |
Implements agent sources, service selection, downloads, and extraction. |
src/java/frameworks/app_dynamics_test.go |
Adds detection, installation, fallback, authentication, and traversal tests. |
src/integration/frameworks_test.go |
Updates skip messages to explain missing agent fixtures. |
docs/framework-app_dynamics_agent.md |
Documents agent sources, credentials, and forked-manifest configuration. |
Review effort: Balanced
Comment on lines
+435
to
+455
| parsed, err := url.Parse(agentURI) | ||
| if err != nil { | ||
| return fmt.Errorf("invalid agent URL: %w", err) | ||
| } | ||
|
|
||
| request, err := http.NewRequest(http.MethodGet, parsed.String(), nil) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to create agent download request: %w", err) | ||
| } | ||
|
|
||
| if parsed.User != nil { | ||
| password, _ := parsed.User.Password() | ||
| request.SetBasicAuth(parsed.User.Username(), password) | ||
| request.URL.User = nil | ||
| } | ||
|
|
||
| client := &http.Client{Timeout: appDynamicsAgentDownloadTimeout} | ||
| response, err := client.Do(request) | ||
| if err != nil { | ||
| return fmt.Errorf("agent download failed: %w", err) | ||
| } |
| } | ||
| return libbuildpack.ExtractZip(archive, dest) | ||
| case "tar.gz": | ||
| return libbuildpack.ExtractTarGz(archive, dest) |
| return "", fmt.Errorf("failed to extract AppDynamics agent archive: %w", err) | ||
| } | ||
|
|
||
| return fmt.Sprintf("service binding credential %q", credential), nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
AppDynamics staging fails with:
src/java/frameworks/app_dynamics.gocalledManifest.DefaultVersion("appdynamics"), but theappdynamicsdefault version and dependency were removed during the 5.x manifest refactor (first released in v5.0.0). AppDynamics' own download portal requires authentication, so the agent cannot be published in the upstream manifest.This change makes the framework bring-your-own-agent, following existing patterns in the buildpack (Checkmarx/Seeker agent URLs, New Relic's app-provided directory, and the IBM JRE fork-and-manifest BYOL path).
Agent sources (in order)
agent-uri(aliases:agent_uri,agent_url,agent-url,agent-download-url,agent_download_url,customoneagenturl) on any bound AppDynamics service. Supports HTTP basic auth in the URL..zip,.tar.gzand.tgzare accepted; the format is sniffed from file magic, so a zip named.tar.gzalso works.appdynamics-agent.{zip,tar.gz,tgz}in the app root,.appdynamics/or.app-dynamics/, or an already-unpacked.appdynamics//.app-dynamics/directory containingjavaagent.jar. App-provided agents are also detected without a service binding, matching New Relic's.new-relic-credentialsbehavior.appdynamicsdependency in a forked buildpack'smanifest.yml(IBM JRE-style BYOL path; upstream has no entry, so only forks reach this).If the
agent-uridownload fails, the buildpack logs a warning and falls back to the next source.Other fixes
agent-uriacross all bound AppDynamics services, so a marketplace binding without a URI does not hide a user-provided binding that has one.appdynamicsandapp-dynamicsas case-insensitive substrings in labels, names and tags (including the documentedapp-dynamics-agent=<version>tag).ExtractZipdoes not sanitize..).Closeerrors instead of ignoring them.Tests
AppDynamics framework specs: 48 passing (was 38), covering the credential URL and aliases, basic auth, multi-binding lookup, download fallback, app archive and directory sources, app-only detection, forked manifest, versioned tags, and traversal rejection.
Behavior change
An app with a standard AppDynamics marketplace binding but no
agent-uriand no vendored agent now fails staging with an actionable BYO error. Previously it failed withno default version for appdynamics, so the failure mode is not new; only the message and remediation paths are.