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

ROX-17260: Add annotation to trigger yearly certificate rotation #1188

Merged

Conversation

mtodor
Copy link
Contributor

@mtodor mtodor commented Aug 2, 2023

Description

This PR adds a trigger to roll out aggregator pods once a year in order to use a rotated certificate.

Checklist (Definition of Done)

  • [ ] Unit and integration tests added
  • Added test description under Test manual
  • [ ] Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • [ ] Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
  • [ ] Add secret to app-interface Vault or Secrets Manager if necessary
  • [ ] RDS changes were e2e tested manually
  • [ ] Check AWS limits are reasonable for changes provisioning new resources

Test manual

Manual testing is possible on a local cluster (i.e. colima), but it requires some modifications to go around OpenShift generated secrets.

Steps:

  1. Go to audit-logs chart directory:
cd dp-terraform/helm/rhacs-terraform/charts/audit-logs
  1. Change in 06-statefulset.yaml - to set tls-secret as optional
               - secret:
                  name: {{ include "aggregator.fullname" . }}-tls-secret
                  optional: true
  1. Create test-values.yaml file with the following content:
replicas: 1
customConfig:
  sources:
    http_server:
      tls:
        enabled: false
  sinks:
    aws_cloudwatch_logs:
      healthcheck:
        enabled: false

We are disabling TLS, because it's not relevant to test if pods will be rolled out, and also access to AWS healthcheck is not relevant.

  1. Prepare namespace and deploy helm:
# Create namespace:
kubectl create namespace rhacs

# Deploy HELM
helm install rhacs-audit-vector . --namespace rhacs --values ./test-values.yaml
  1. Check pod "AGE"
kubectl get pods -n rhacs-audit-logs
  1. Apply helm update:
helm upgrade rhacs-audit-vector . --namespace rhacs --values ./test-values.yaml
  1. Check pod "AGE":
kubectl get pods -n rhacs-audit-logs

Pods should not be restarted.

  1. Change template 06-statefulset.yaml to simulate next year:
trigger-tls-rotation: {{ toDate "2006-01-02" "2024-01-01" | date "2006" | quote }}
  1. Apply helm update:
helm upgrade rhacs-audit-vector . --namespace rhacs --values ./test-values.yaml
  1. Check pod "AGE":
kubectl get pods -n rhacs-audit-logs

This time pods should be restarted.

@mtodor mtodor temporarily deployed to development August 2, 2023 09:55 — with GitHub Actions Inactive
@mtodor mtodor temporarily deployed to development August 2, 2023 09:55 — with GitHub Actions Inactive
@openshift-ci openshift-ci bot added the approved label Aug 2, 2023
@mtodor mtodor requested review from parametalol and stehessel August 2, 2023 09:55
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtodor, stehessel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mtodor mtodor merged commit 5638177 into main Aug 4, 2023
@mtodor mtodor deleted the mtodor/ROX-17260-trigger-audit-logs-aggregator-tls-rotation branch August 4, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants