Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-google-cloud-ops-agent-repo.sh pushes key to deprecated apt-key trusted.gpg keystore #1132

Open
sbconslt opened this issue Feb 27, 2023 · 22 comments
Labels
feature New feature or request

Comments

@sbconslt
Copy link

sbconslt commented Feb 27, 2023

add-google-cloud-ops-agent-repo.sh as currently delivered invokes apt-key add - to store the gpg key for package signing, which stores the key to /etc/apt/trusted.gpg, a deprecated procedure.

Newly on Ubuntu 22.04, the presence of this signing key in this location throws a deprecation Warning during apt-get update. This is a risk to the automated orchestration of updates. (apt-get update && apt-get dist-upgrade -y that we sometimes emplace, for example, is blocked by it as the first command appears to the shell to not exit 0.)

I produced the following diff of the change that relocates the signing key to its own file /etc/apt/trusted.gpg.d/google-cloud-ops-agent.gpg:

224c224
<         | ${DRY_RUN} apt-key add -
---
>         > /etc/apt/trusted.gpg.d/google-cloud-ops-agent.gpg

I do not locate the add-google-cloud-ops-agent-repo.sh file in this repository, though, so have not formed a PR.

Please consider updating the install scripting accordingly. Thanks.

@braydonk braydonk added the feature New feature or request label Mar 16, 2023
@braydonk
Copy link
Contributor

Hi @sbconslt, we have been tracking this internally and are working on it.

@kakugirai
Copy link

Hi @braydonk , is there any update on when we might expect to see progress on this feature?

@cjac
Copy link

cjac commented Aug 5, 2024

I was thinking I would take this one. can you assign to cjac, plz?

Copy link

This issue was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 20, 2024
@sbconslt
Copy link
Author

Closing this issue would be a mistake, because the old apt-key trusted.gpg mechanism will eventually be removed.

@cjac
Copy link

cjac commented Dec 20, 2024

Can I get this issue assigned to me plz

@cjac
Copy link

cjac commented Dec 20, 2024

@jefferbrecht - can you get this assigned to me? I've been doing a lot of work on the migration off of apt-key and know how this goes.

@cjac
Copy link

cjac commented Dec 20, 2024

@cjac
Copy link

cjac commented Dec 20, 2024

oh, I'll just create a PR

@cjac
Copy link

cjac commented Dec 20, 2024

now that I grep the code for 'apt-key' I am finding none. Is this one already solved?

@sbconslt
Copy link
Author

My patch was as you see in the original comment, just to send the key to /etc/apt/trusted.gpg.d/. The current shipping add-google-cloud-ops-agent-repo.sh still calls apt-key.

@cjac
Copy link

cjac commented Dec 20, 2024

it looks like the source in the repo is using gpg --dearmor:

cjac@cjac:~/src/github/c9h/ops-agent$ grep -rsi 'dearmor' .
./integration_test/third_party_apps_test/applications/rabbitmq/debian_ubuntu/install:    sudo gpg --dearmor --output /etc/apt/trusted.gpg.d/rabbitmq.gpg
./integration_test/third_party_apps_test/applications/rabbitmq/debian_ubuntu/install:    sudo gpg --dearmor --output /etc/apt/trusted.gpg.d/rabbitmq-hostname.gpg
./integration_test/third_party_apps_test/applications/couchdb/debian_ubuntu/install:curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1
./integration_test/third_party_apps_test/applications/vault/debian_ubuntu/install:  wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg >/dev/null
./integration_test/third_party_apps_test/applications/mongodb/debian_ubuntu/install:        --dearmor
./kokoro/scripts/test/go_test.Dockerfile:RUN wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg

@sbconslt
Copy link
Author

I, like you, found that the add-google-could-ops-agent-repo.sh is not represented in repo here. The matches you have above are for other, unrelated repos.

@cjac
Copy link

cjac commented Dec 20, 2024

@sbconslt
Copy link
Author

@cjac
Copy link

cjac commented Dec 20, 2024

okay, I've opened a bug against that public document to make sure we copy the new version of that script once my PR is merged. Please ping me again if it falls by the wayside again.

@braydonk
Copy link
Contributor

braydonk commented Dec 20, 2024

That script is not the canonical version; I don't know why that is in that repo. The canonical version is internal (I believe this is for legacy technical reasons). Updating the script in that repo, as far as I know, will have no effect. I have no clue why it's there in the first place.

@cjac, could you please make a CL to the canonical version of the script? I can send you a message and show you where that is.

@braydonk braydonk removed the Stale label Dec 20, 2024
@cjac
Copy link

cjac commented Dec 21, 2024

Okay, I think the last change will be accepted without prejudice. Will update the downstream GitHub repo nao

@sbconslt
Copy link
Author

I do not yet find https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh to have been updated, fwiw.

I did see that the PR in the other repo was closed so presumably something was applied somewhere.

@cjac
Copy link

cjac commented Dec 21, 2024

Yes, I know that it is not yet peer reviewed by code owner and has not reached that url. Please stand by.

@braydonk
Copy link
Contributor

The script won't be updated at the download link til after the holidays; we're restricted from doing releases of any kind until the new year.

We'll also have to verify that we are able to switch off of apt-key; we tried to make the switch over a year ago and were unable to because it broke customer environments due to conflicts with OSConfig Agent. We'll have to verify that is fixed before we can safely update the script. I hope they'll have fixed that by now, given they are on the same apt-key deprecation removal clock that everyone else is.

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

No branches or pull requests

4 participants