Skip to content

Conversation

kfox1111
Copy link

No description provided.


message GetTrustBundleResponse {
spire.plugin.types.Bundle bundle = 1;
bool insecure_bootstrap = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

How is the insecure_bootstrap intended to be used? Doesn't the agent not verify the server in the case of insecure bootstrapping? Would it even reach out to these plugins in that case?

Copy link
Author

Choose a reason for hiding this comment

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

spiffe/spire#5881

To implement:

plugins {
    TrustBundleSource "insecure" {}
}

The plugin would just have a GetTrustBundle function that does:
return nil, true

The plugin would be able to determine if it wanted to insecurely bootstrap and pass that on to be done. Doing it at the plugin level would allow a policy plugin to be written that does some logic before falling back to an insecure bootstrap.

Copy link
Author

Choose a reason for hiding this comment

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

Basically, the plugin would get called right before attestation to determine what to do (https://github.com/kfox1111/spire/blob/rebootstrap/pkg/agent/agent.go#L129-L132)

		BootstrapTrustBundle, InsecureBootstrap, err = a.c.TrustBundleSources.GetBundle()
	}
	if err == nil {
		as, err = a.attest(ctx, sto, cat, metrics, nodeAttestor, BootstrapTrustBundle, InsecureBootstrap)

Comment on lines 17 to 27
// Hint for which type of action this trust bundle will be used for
Use use_hint = 2;

// Optional server url that is being used with the retrieved bundle
string server_url = 3;

// How many connection attempts to the server have been made so far
int32 connection_attempts = 4;

// When was (re)bootstrapping started
google.protobuf.Timestamp starttime = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

How is the plugin using this information? Some of these seem like plugin specific configuration, which can be done through the plugin data config, for example the server url which wouldn't be used for a file based bundle source.

Copy link
Author

@kfox1111 kfox1111 Feb 27, 2025

Choose a reason for hiding this comment

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

Its metadata that plugin might want to use in its calculation for returning trust bundles / insecure mode, but it doesn't have to.

For example, a plugin that just reads from a file can ignore all of this.

A policy plugin may want to look at these things to determine, pull from source A if its attempted less then 10 connections, then use source B. Or, if now() > starttime + 10m, use source C. Or another plugin may call out to an external url to do the logic, and pass along trustdomain/server_url info so one external service could handle lots of different instances. (some kind of trust bundle as a service thing)

@kfox1111 kfox1111 changed the title Add plugin type for TrustBundleSource Add plugin type for ServerAttestor Mar 13, 2025
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