Skip to content

Conversation

tigerxy
Copy link

@tigerxy tigerxy commented Oct 11, 2021

openssl.pkey and curl are not available in a gcr.io/distroless/static:nonroot docker container.

local public_key = get_public_key_from_file(shm)
kong.log.debug(public_key)
if not pcall(openssl_pkey.new, public_key) or public_key == nil then
if public_key == nil then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do believe this step is needed, do you think we should we the base distroless image instead?
https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md

local google_url = "https://www.googleapis.com/robot/v1/metadata/x509/[email protected]"
local magic = " | cut -d \"\\\"\" -f4- | sed 's/\\\\n/\\n/g\' | sed 's/\"//g' | openssl x509 -pubkey -noout"
local cmd = "curl -s " .. google_url .. " | grep -i " .. t_kid .. magic
local cmd = "wget -qO - " .. google_url .. " | grep -i " .. t_kid .. magic
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this? :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants