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

Force rotation X.509 SVIDs in Agent side #5446

Merged
merged 8 commits into from
Sep 28, 2024

Conversation

MarcosDY
Copy link
Collaborator

@MarcosDY MarcosDY commented Aug 31, 2024

  • Force rotation of X.509 workload SVIDs in lru cache
  • Force rotation of X.509 workload SVIDs in store SVID cache
  • Force rotation of Agent SVID

Which issue this PR fixes
fixes #3907
fixes #3903

@MarcosDY MarcosDY marked this pull request as ready for review September 14, 2024 17:02
@amartinezfayo amartinezfayo self-assigned this Sep 17, 2024
pkg/agent/manager/cache/lru_cache.go Outdated Show resolved Hide resolved
pkg/agent/manager/cache/lru_cache.go Outdated Show resolved Hide resolved
pkg/agent/manager/cache/lru_cache.go Outdated Show resolved Hide resolved
pkg/agent/manager/cache/lru_cache.go Outdated Show resolved Hide resolved
pkg/agent/manager/cache/lru_cache.go Outdated Show resolved Hide resolved
pkg/agent/svid/rotator.go Show resolved Hide resolved
pkg/agent/svid/rotator.go Outdated Show resolved Hide resolved
pkg/agent/svid/rotator.go Outdated Show resolved Hide resolved
pkg/agent/svid/rotator.go Outdated Show resolved Hide resolved
pkg/common/x509util/cert.go Outdated Show resolved Hide resolved
}

agentmetrics.AddCacheManagerTaintedSVIDsSample(c.metrics, "", float32(taintedSVIDs))
c.log.WithField(telemetry.TaintedSVIDs, taintedSVIDs).Debug("Tainted X.509 SVIDs")
Copy link
Member

Choose a reason for hiding this comment

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

This should be logged at Info level, as it is in the SVID store cache.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sorry forgot to update this.. yeah, agree that this is an user action, and we must info it

c.notifyTaintedBatchProcessed()
return
}
c.log.WithField(telemetry.Count, entriesLeftCount).Debug("Tainted entries left to be processed")
Copy link
Member

Choose a reason for hiding this comment

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

I would change slightly the message to be consistent with the message about the SVIDs already tainted. I would also make this an Info level message.

Suggested change
c.log.WithField(telemetry.Count, entriesLeftCount).Debug("Tainted entries left to be processed")
c.log.WithField(telemetry.Count, entriesLeftCount).Info("There are tainted X.509 SVIDs left to be processed")


entriesLeftCount := len(entryIDs)
if entriesLeftCount == 0 {
c.log.Debug("Finished processing all tainted entries")
Copy link
Member

Choose a reason for hiding this comment

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

This should be logged at Info level.

}

if tainted {
r.c.Log.Debug("Agent SVID is tainted by a root authority, forcing rotation")
Copy link
Member

Choose a reason for hiding this comment

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

This should be logged at Info level.

* Force rotation of X.509 workload SVIDs in store SVID cache
* Force rotation of Agent SVID

Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Signed-off-by: Marcos Yacob <marcosyacob@gmail.com>
Copy link
Member

@amartinezfayo amartinezfayo left a comment

Choose a reason for hiding this comment

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

🎉

@amartinezfayo amartinezfayo merged commit 8f82eba into spiffe:main Sep 28, 2024
34 checks passed
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.

Force rotation of Agent SVID Rotate X.509 Workload SVIDs using tainted keys
2 participants