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

Log partial selectors from workload attestation on context cancellation #4846

Merged

Conversation

rturner3
Copy link
Collaborator

In the case when a client hangs up a connection to SPIRE Agent during workload attestation (e.g. timeout, process dies, etc.) while the agent is still discovering selectors from workload attestation plugins, it can be helpful to log whatever selectors the agent could find for debugging purposes. Today, only the pid is captured in logs in this case, which is often not enough information to trace back the caller since:

  • The caller process may have already died (e.g. crashlooping on startup)
  • pid alone is only useful if you can query the state of running processes on the host around the time of workload attestation (often not practical)

Logging the partial set of selectors fetched by the agent before the caller hung up can help diagnose affected workloads in case a workload attestation plugin is misbehaving or a downstream dependency required by the plugin is down/not responding with accurate information.

In the case when a client hangs up a connection to SPIRE Agent during
workload attestation (e.g. timeout, process dies, etc.) while the agent
is still discovering selectors from workload attestation plugins, it can
be helpful to log whatever selectors the agent could find for debugging
purposes. Today, only the pid is captured in logs in this case,
which is often not enough information to trace back the caller since:
- The caller process may have already died (e.g. crashlooping on startup)
- pid alone is only useful if you can query the state of running processes on the host around the time of workload attestation (often not practical)

Logging the partial set of selectors fetched by the agent before the
caller hung up can help diagnose affected workloads in case a workload attestation
plugin is misbehaving or a downstream dependency required by the plugin
is down/not responding with accurate information.

Signed-off-by: Ryan Turner <turner@uber.com>
Signed-off-by: Ryan Turner <turner@uber.com>
@amartinezfayo amartinezfayo added this to the 1.9.0 milestone Feb 8, 2024
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.

Thank you @rturner3 for this, LGTM!

@rturner3 rturner3 merged commit c36b8ef into spiffe:main Feb 9, 2024
32 checks passed
sriyer pushed a commit to spire-vault/spire that referenced this pull request Feb 23, 2024
…on (spiffe#4846)

* Log partial selectors from workload attestation on context cancellation

In the case when a client hangs up a connection to SPIRE Agent during
workload attestation (e.g. timeout, process dies, etc.) while the agent
is still discovering selectors from workload attestation plugins, it can
be helpful to log whatever selectors the agent could find for debugging
purposes. Today, only the pid is captured in logs in this case,
which is often not enough information to trace back the caller since:
- The caller process may have already died (e.g. crashlooping on startup)
- pid alone is only useful if you can query the state of running processes on the host around the time of workload attestation (often not practical)

Logging the partial set of selectors fetched by the agent before the
caller hung up can help diagnose affected workloads in case a workload attestation
plugin is misbehaving or a downstream dependency required by the plugin
is down/not responding with accurate information.

Signed-off-by: Ryan Turner <turner@uber.com>
rushi47 pushed a commit to rushi47/spire that referenced this pull request Apr 11, 2024
…on (spiffe#4846)

* Log partial selectors from workload attestation on context cancellation

In the case when a client hangs up a connection to SPIRE Agent during
workload attestation (e.g. timeout, process dies, etc.) while the agent
is still discovering selectors from workload attestation plugins, it can
be helpful to log whatever selectors the agent could find for debugging
purposes. Today, only the pid is captured in logs in this case,
which is often not enough information to trace back the caller since:
- The caller process may have already died (e.g. crashlooping on startup)
- pid alone is only useful if you can query the state of running processes on the host around the time of workload attestation (often not practical)

Logging the partial set of selectors fetched by the agent before the
caller hung up can help diagnose affected workloads in case a workload attestation
plugin is misbehaving or a downstream dependency required by the plugin
is down/not responding with accurate information.

Signed-off-by: Ryan Turner <turner@uber.com>
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.

2 participants