Skip to content

Introduce a new aws_iid configuration option 'disable_instance_profile_selectors'#2119

Merged
azdagron merged 6 commits intospiffe:masterfrom
kgtw:instance-profile-option
Mar 16, 2021
Merged

Introduce a new aws_iid configuration option 'disable_instance_profile_selectors'#2119
azdagron merged 6 commits intospiffe:masterfrom
kgtw:instance-profile-option

Conversation

@kgtw
Copy link
Contributor

@kgtw kgtw commented Feb 18, 2021

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality

Setting disable_instance_profile_selectors = true means that iam instance profile information isn't available in selectors.

Description of change

This is needed when spire-server is running in a secure area with no public internet access.

If an attesting node has an iam instance profile policy attached and there is no public internet access, spire-server fails to attest the nodes because it cannot reach the aws iam endpoint - iam.amazonaws.com - which is used to retrieve the instance iam profile information.

Which issue this PR fixes

…file_selectors'.

This is needed when spire-server is running in a secure area with no public internet access.

If an attesting node has an iam instance profile policy attached and there is no public internet access, spire-server fails to attest the nodes because it cannot reach the aws iam endpoint - iam.amazonaws.com.

Setting use_instance_profile_selectors = false, disables the api call to the iam endpoint allowing nodes to attest.

Signed-off-by: Kris Gambirazzi <kris.gambirazzi@transferwise.com>
…kwards functionality.

Signed-off-by: Kris Gambirazzi <kris.gambirazzi@transferwise.com>
@kgtw kgtw force-pushed the instance-profile-option branch from 82bfb9f to 15fc9cb Compare February 18, 2021 19:40
@kgtw kgtw changed the title Introduce a new aws_iid configuration option 'use_instance_profile_selectors' Introduce a new aws_iid configuration option 'disable_instance_profile_selectors' Feb 18, 2021
…onfig option

Signed-off-by: Kris Gambirazzi <kris.gambirazzi@transferwise.com>
@azdagron
Copy link
Member

azdagron commented Mar 5, 2021

Thanks for opening this @kgtw.

This is needed when spire-server is running in a secure area with no public internet access.

If the goal here is for the AWS IID attestor to function without Internet, I don't think this PR is going to achieve that successfully. Consulting AWS for the instance profile for selectors but one place where we consult the AWS APIs.

I would suggest the following:

  • Rename the configurable to something like disable_aws_api_use
  • Review the other uses of the AWS API in the plugin. Some of these we call unconditionally; others are only called under specific configurations. All of these will have to be disabled by the new flag.

@JonathanO
Copy link
Contributor

@azdagron I believe this is only a problem for the iam API endpoint specifically, as it's a global endpoint. The EC2 API endpoint is regional, so doesn't require public Internet access to reach it.

@azdagron
Copy link
Member

azdagron commented Mar 5, 2021

🤦‍♂️ Thanks for that insight, @JonathanO. Re-reviews...

@azdagron
Copy link
Member

azdagron commented Mar 8, 2021

@kgtw , @JonathanO, what would your thoughts be on rename of the configurable to something like no_public_internet. Then it is at least clear from the configurable name under what circumstance it would be appropriate to set the configurable. Barring that, if we keep the original name, we probably want a small subsection in the documentation discussing why the configurable is necessary and the outcome of setting it. I'm ok with either course.

@evan2645
Copy link
Member

evan2645 commented Mar 8, 2021

a small subsection in the documentation discussing why the configurable is necessary and the outcome of setting it

E.g. "Using this plugin without internet access" section, which then captures the necessary configuration.

@kgtw
Copy link
Contributor Author

kgtw commented Mar 12, 2021

Thanks for the comments @azdagron @evan2645

I think keeping the current naming is more descriptive of what it's used for. I will add some additional documentation describing the use-cases of using it and what it means when it is disabled.

…tance_profile_selectors configuration option

Signed-off-by: Kris Gambirazzi <kris.gambirazzi@transferwise.com>
```

## Disabling Instance Profile Selectors
In cases where spire-server is running in a location with no public internet access available, setting `disable_instance_profile_selectors = true` will prevent the server from making requests to `iam.amazonaws.com`. This is needed as spire-server will fail to start.
Copy link
Member

Choose a reason for hiding this comment

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

This is needed as spire-server will fail to start.

I could see it failing agent attestation, but how does it cause the server to not start?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, you're right. Let me fix the wording of that.

Signed-off-by: Kris Gambirazzi <kris.gambirazzi@transferwise.com>
Copy link
Member

@azdagron azdagron left a comment

Choose a reason for hiding this comment

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

Thanks, @kgtw !

@azdagron azdagron merged commit d8b338d into spiffe:master Mar 16, 2021
@azdagron azdagron added this to the 0.12.2 milestone Mar 23, 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.

4 participants