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

OCP4: Optimize ingress trusted ca remediation #12268

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

Vincent056
Copy link
Contributor

@Vincent056 Vincent056 commented Aug 6, 2024

Let's optimize how we test remediation for ingress cert, we will fetch the default self-sign CA used by the ingress operator and then make it as trusted CA, and then in ingress cert remediation we will make a copy of self-generated ingress wildcard cert, and then use it as the default cert. It looks like the router-certs-default is removed when a custom cert is configured.

https://docs.openshift.com/container-platform/4.16/security/certificate_types_descriptions/ingress-certificates.html#location

Copy link

github-actions bot commented Aug 6, 2024

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@Vincent056
Copy link
Contributor Author

/test e2e-aws-ocp4-pci-dss
/test e2e-aws-ocp4-pci-dss-node

Copy link

github-actions bot commented Aug 6, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12268
This image was built from commit: 04482c9

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12268

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12268 make deploy-local

@rhmdnd rhmdnd added this to the 0.1.75 milestone Aug 6, 2024
@yuumasato
Copy link
Member

/test 4.15-e2e-aws-ocp4-moderate
/test 4.16-e2e-aws-ocp4-moderate

Let's optimize how we run test remediation for ingress cert, we will fetech default self sign CA used by ingress operator, and then makes it as trusted CA, and then in ingress cert remediation we will make a copy of self generated ingress wildcard cert, and then use it as the default cert. It seems like the router-certs-default is being removed when custom cert is configured.
@Vincent056
Copy link
Contributor Author

/test 4.15-e2e-aws-ocp4-moderate
/test 4.16-e2e-aws-ocp4-moderate

Copy link

openshift-ci bot commented Aug 6, 2024

@Vincent056: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.16-e2e-aws-ocp4-moderate 04482c9 link true /test 4.16-e2e-aws-ocp4-moderate
ci/prow/4.15-e2e-aws-ocp4-moderate 04482c9 link true /test 4.15-e2e-aws-ocp4-moderate

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link

codeclimate bot commented Aug 6, 2024

Code Climate has analyzed commit 04482c9 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 59.4% (0.0% change).

View more on Code Climate.

@rhmdnd
Copy link
Collaborator

rhmdnd commented Aug 6, 2024

Looks like both CI rehearsals failed resolving images. Likely unrelated to this change.

oc create secret tls router-certs-default-duplicate --cert=/tmp/ingress-tls.crt --key=/tmp/ingress-tls.key -n openshift-ingress

# Update the defaultCertificate to point to the new secret. This is effectively the remediation we're checking for.
# Note: we are using an existing default secret name for testing, so it won't cause any subsequent failures on testing routes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I don't think this note is accurate anymore since we're not using router-certs-default, is it?

I'm ok updating this in a separate PR if we don't have a reason to respin this patch.

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

Thanks for finding a better solution here.

To summarize, we're using a different config map, but it contains the same certificate as the trusted-ca-bundle, then updating the trustedCA to use the new config map, which should be enough for the check to pass on subsequent scans.

@rhmdnd
Copy link
Collaborator

rhmdnd commented Aug 6, 2024

Kicking this through since we go at least one clean CI run that has been failing in the past with this issue.

@rhmdnd rhmdnd merged commit 42c8206 into ComplianceAsCode:master Aug 6, 2024
97 of 99 checks passed
@Mab879 Mab879 added the Update Rule Issues or pull requests related to Rules updates. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants