charts icon indicating copy to clipboard operation
charts copied to clipboard

[stable/anchore-engine] enable configuration of external_hostname/external_port

Open 0xDEC0DE opened this issue 7 years ago • 6 comments

Is your feature request related to a problem? Please describe.

When standing up Anchore through the chart e.g., behind a firewall, the API constructs URLs for what we consider the "internal" API server address. These are not terribly useful to our users.

Describe the solution you'd like

Anchore has configuration options for this, external_hostname / external_port, that allowed the API server to create URLs that map to what we consider the "external" address. The chart should configure them if requested.

0xDEC0DE avatar Sep 17 '19 16:09 0xDEC0DE

/assign

zhill avatar Sep 17 '19 16:09 zhill

I'm not quite sure what the use-case for this request is exactly. The external_hostname/port stuff is for internal service routing where the endpoints need to be different than what is registered in the anchore deployment's db, but that should impact users. For a k8s install users you can configure the external api to be exposed outside the cluster with an ingress or a loadbalancer-type service definition. Additionally, an Ingress can be defined at any point to route any hostname to the anchore api svc.

Can you elaborate on what you're trying to achieve for users? I don't quite understand the ask.

zhill avatar Sep 17 '19 16:09 zhill

Sure.

Before:

anchore-cli image vuln sha256:23d760aa4a5f2d46b12f439d113a8ffe5bf520c555b9c3aedb4765f9c8943024 all | grep VULN
VULNDB-137890           Python-2.7.16                                           High              3.5.1                              http://anchore-meta-release-anchore-engine-api:8228/v1/query/vulnerabilities?id=VULNDB-137890
VULNDB-208865           Python-2.7.16                                           High              3.7.3, 3.6.9, 3.5.7, 3.4.10        http://anchore-meta-release-anchore-engine-api:8228/v1/query/vulnerabilities?id=VULNDB-208865
VULNDB-115884           Python-2.7.16                                           Medium            3.7.4rc1, 3.6.9rc1                 http://anchore-meta-release-anchore-engine-api:8228/v1/query/vulnerabilities?id=VULNDB-115884
VULNDB-200148           Python-2.7.16                                           Medium            None                               http://anchore-meta-release-anchore-engine-api:8228/v1/query/vulnerabilities?id=VULNDB-200148
VULNDB-203403           mercurial-4.8.2                                         Medium            4.9                                http://anchore-meta-release-anchore-engine-api:8228/v1/query/vulnerabilities?id=VULNDB-203403

After:

anchore-cli image vuln sha256:23d760aa4a5f2d46b12f439d113a8ffe5bf520c555b9c3aedb4765f9c8943024 all | grep VULN
VULNDB-137890           Python-2.7.16                                           High              3.5.1                              http://anchore.ci.ciscolabs.com/v1/query/vulnerabilities?id=VULNDB-137890
VULNDB-208865           Python-2.7.16                                           High              3.7.3, 3.6.9, 3.5.7, 3.4.10        http://anchore.ci.ciscolabs.com/v1/query/vulnerabilities?id=VULNDB-208865
VULNDB-115884           Python-2.7.16                                           Medium            3.7.4rc1, 3.6.9rc1                 http://anchore.ci.ciscolabs.com/v1/query/vulnerabilities?id=VULNDB-115884
VULNDB-200148           Python-2.7.16                                           Medium            None                               http://anchore.ci.ciscolabs.com/v1/query/vulnerabilities?id=VULNDB-200148
VULNDB-203403           mercurial-4.8.2                                         Medium            4.9                                http://anchore.ci.ciscolabs.com/v1/query/vulnerabilities?id=VULNDB-203403

0xDEC0DE avatar Sep 17 '19 16:09 0xDEC0DE

Ah, you're talking about the urls returned for internal-only accessible vuln matches. Understood. I'll need to think about the proposed solution as it can have impacts on how other things access the system, but if done only for the external API(s) then it probably will work ok.

zhill avatar Sep 17 '19 16:09 zhill

@zhill Any update on getting this one landed? This is something we are starting to need and we'd ideally like to get it from upstream vs. patching.

signed8bit avatar Sep 23 '19 20:09 signed8bit

@zhill Any update on getting this one landed? This is something we are starting to need and we'd ideally like to get it from upstream vs. patching.

Yes, it's being reviewed. Updates will be in the PR comments. Barring any major issues it should be quick turnaround.

zhill avatar Sep 23 '19 22:09 zhill