Skip to content

Conversation

@Ilhan-Personal
Copy link
Contributor

@Ilhan-Personal Ilhan-Personal commented May 22, 2025

Fixes #37151

This PR addresses two security vulnerabilities by updating dependencies:
K8s Dependencies
Updated k8s.io/api, k8s.io/apimachinery, k8s.io/client-go, and k8s.io/utils to v0.33.0
Fixes high severity DoS vulnerability in k8s.io/apimachinery/pkg/util/runtime (CVE referenced in SNYK-GOLANG-K8SIOAPIMACHINERYPKGUTILRUNTIME-8367153)
Minimum required version for fix: v0.29.0-alpha.3
HashiCorp Consul API
Updated to v1.32.1 to address potential security concerns
Changes have been applied to both the main module and Kubernetes remote state backend module. Build verification confirms Terraform builds successfully with these updates.

@Ilhan-Personal Ilhan-Personal requested a review from a team as a code owner May 22, 2025 07:07
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented May 22, 2025

CLA assistant check
All committers have signed the CLA.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label May 22, 2025
@SarahFrench
Copy link
Member

SarahFrench commented May 22, 2025

Hi @Ilhan-Personal , thanks for your contribution! Could you please run make syncdeps from the project root, commit, and push those changes? That will make sure the dependency changes are matched in the other Go modules in this repo.

@jbardin
Copy link
Member

jbardin commented May 22, 2025

Note for merging, this also needs the full acceptance tests for k8s and consul

Signed-off-by: SYSHIL <[email protected]>
@Ilhan-Personal Ilhan-Personal requested review from a team as code owners May 22, 2025 13:19
@Ilhan-Personal
Copy link
Contributor Author

Hi @SarahFrench , Thank you!

I've ran the script and pushed the changes

@SarahFrench
Copy link
Member

@hashicorp/tf-eco-hybrid-cloud Could you test the Kubernetes backend following these changes please?

@SarahFrench
Copy link
Member

I've figured out how to run the tests for the consul backend and they're all behaving the same way on this PR as they are on main. I've seen that TestConsul_largeState is failing on main, but that's out of scope of this PR and doesn't need to be addressed.

We just need to have the kubernetes backend tested now.

@Ilhan-Personal
Copy link
Contributor Author

I've figured out how to run the tests for the consul backend

Just curious could you please maybe point me towards how you're testing these tests?

Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

I worked with the Hybrid Cloud team to get the kubernetes backend's tests run on this PR and they all passed, so I'm happy to approve & merge.

@SarahFrench
Copy link
Member

SarahFrench commented May 29, 2025

I've figured out how to run the tests for the consul backend

Just curious could you please maybe point me towards how you're testing these tests?

That backend is unmaintained, so I found a way to run the tests but it's almost definitely not the best way. What I did was:

  • Install Consul, so that the consul CLI is in your PATH
    • The acceptance tests for the consul backend run consul commands to launch an agent
  • cd into internal/backend/remote-state/consul
  • Run go test commands to run one test at a time, e.g. TF_ACC=1 go test -v -run=^TestBackend$
    • You need TF_ACC set, else the test is skipped
    • I found that if I ran more than one test at a time then they may clash, as each launches its own agent
      • If these errors came up I'd need to kill any still-running consul processes on my machine before running the next test.

There are a bunch of ENVs in the Consul SDK that might make this experience smoother, but I've got minimal Consul knowledge and haven't looked into ways to improve the test performance. Hopefully the instructions above are sufficient to get you started!

@SarahFrench SarahFrench added the 1.12-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label May 29, 2025
@SarahFrench SarahFrench merged commit 434bbc4 into hashicorp:main May 29, 2025
11 of 13 checks passed
@SarahFrench SarahFrench removed the 1.12-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label May 30, 2025
@Ilhan-Personal
Copy link
Contributor Author

Thank you so much @SarahFrench

@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Auto-pinning enhancement no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: Vulnerabilities in K8s apimachinery and Consul API dependencies

5 participants