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

Add "repeatable" field to AgentAttributes #17

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

dfeldman
Copy link
Member

@dfeldman dfeldman commented Oct 6, 2021

This field will allow us to clear out old agent entries in order to resolve #1836 in SPIRE (additional changes in SPIRE itself required), and also tackle #2203.

Signed-off-by: Daniel Feldman dfeldman.mn@gmail.com

// Optional. If repeatable is true, then this attestation may happen more
// than one time for a given agent. This allows the server to clear out
// old entries automatically (since they can be easily recreated).
bool repeatable = 3;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I wonder if we can't be a little more precise in the naming of this field. It's not too clear to me what it means to be for an Agent to be "repeatable".

What about can_auto_reattest or reattestable? To me, it makes sense to make the name of this field resemble the purpose it will be used for in SPIRE Server, which is primarily to make decisions based on whether or not an agent can present the same attestation material multiple times for node attestation.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that repeatable isn't very self documenting (but the code comment is good). In finding a name for this field, it may help to consider that it is part of an AgentAttributes message.

Here are a few other things rolling around in my mental word cloud

tofu_attestation
unsafe_attestation
attest_once

I think it is also useful to get the polarity correct. For example, is the normal condition TOFU or not TOFU ... or even the desired condition. TOFU attestation is much less secure than methods that can be safely re-attested, so IMO the polarity should be oriented in that way (i.e. TOFU is the exceptional case).

Copy link
Member Author

@dfeldman dfeldman Nov 5, 2021

Choose a reason for hiding this comment

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

I am good with any of these names.
I feel the polarity should be that if the flag is true, it should NOT be TOFU. That way if any plugins forget to fill in this field or are using old versions of this proto, then it will revert to the existing, safe, TOFU behavior. That is why I picked the name "repeatable" :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with @dfeldman 's reasoning about the default stance being TOFU. We have to consider non-builtin NodeAttestor plugins that will not be setting this field yet. It seems preferable to me to consider them TOFU until explicitly indicated otherwise by the developer of the plugin.

Also since this field will be used to determine whether a given NodeAttestor plugin's expired data can be safely purged from the database, it is probably better to assume that a plugin is not eligible for this behavior until explicitly opted in.

@evan2645 any preference on the name? I am leaning towards can_auto_reattest, since it matches the desired polarity.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we go ahead with can_auto_reattest?

Copy link
Member

Choose a reason for hiding this comment

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

I feel the polarity should be that if the flag is true, it should NOT be TOFU. That way if any plugins forget to fill in this field or are using old versions of this proto, then it will revert to the existing, safe, TOFU behavior.
...

It seems preferable to me to consider them TOFU until explicitly indicated otherwise by the developer of the plugin.
...
Also since this field will be used to determine whether a given NodeAttestor plugin's expired data can be safely purged from the database, it is probably better to assume that a plugin is not eligible for this behavior until explicitly opted in.

All of that makes good sense!

Can we go ahead with can_auto_reattest?

Sure. Another option could be simply can_reattest since evicting and agent is considered more like a fresh attestation than a re-attestation, but either is OK with me

Thank you @dfeldman!

Comment on lines 56 to 58
// Optional. If repeatable is true, then this attestation may happen more
// than one time for a given agent. This allows the server to clear out
// old entries automatically (since they can be easily recreated).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Optional. If repeatable is true, then this attestation may happen more
// than one time for a given agent. This allows the server to clear out
// old entries automatically (since they can be easily recreated).
// Optional. If can_auto_reattest is true, then this attestation method
// allows an agent to attest multiple times with the same
// attestation payload without operator intervention.
// This also allows the server to clear out old entries automatically
// since they can be easily recreated.

Signed-off-by: Daniel Feldman <dfeldman.mn@gmail.com>
@dfeldman dfeldman force-pushed the add_attestation_type branch from 3f134ea to d703499 Compare November 15, 2021 18:56
Copy link
Collaborator

@rturner3 rturner3 left a comment

Choose a reason for hiding this comment

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

Thanks, @dfeldman !

@rturner3 rturner3 merged commit 1cc72b2 into spiffe:main Nov 15, 2021
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.

Expired Agent data left in SPIRE database indefinitely
3 participants