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 an integration test to validate API key creation and invalidation #1272

Closed
cmacknz opened this issue Sep 22, 2022 · 4 comments
Closed

Add an integration test to validate API key creation and invalidation #1272

cmacknz opened this issue Sep 22, 2022 · 4 comments
Labels
8.6-candidate estimation:Week Task that represents a week of work. Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@cmacknz
Copy link
Member

cmacknz commented Sep 22, 2022

Given the API key life cycle: creation -> permissions update -> invalidation:

  • Creation:
    • when a new agent is enrolled
    • Updating to 8.5 (corner case, it recreates API keys for all ES outputs)
  • Update (permissions):
    • when a policy change requires a broader or stricter set of permissions
      • the current update implementation guarantees the permission set will never be stricter than needed, however it might be a wee boarder.
  • Invalidation:
    • Agent is un-enrolled
    • TTL - the Agent is offline for too long
  • No change:
    • policy change that does not require more or less permissions

The needed integrations tests would be:

  • Updating to fleet-server from any version below 8.5.0 to 8.5+
    • Ensure old api keys (before the upgrade) on the .fleet-agents doc are invalidated
  • Agent enrolled
    • new API key is created
    • the API key can write to the necessary indices
@cmacknz cmacknz added 8.6-candidate estimation:Week Task that represents a week of work. labels Sep 22, 2022
@cmacknz
Copy link
Member Author

cmacknz commented Sep 27, 2022

We could the work done in #56 as a starting point.

@cmacknz
Copy link
Member Author

cmacknz commented Sep 27, 2022

Some of the necessary test framework pieces may overlap with #1275 as well.

@cmacknz
Copy link
Member Author

cmacknz commented Sep 28, 2022

Moving to iteration #2 for 8.6. I will create a separate issue to add a basic smoke test between the agent and fleet server to catch problems like #1341

@cmacknz
Copy link
Member Author

cmacknz commented Sep 28, 2022

There is an existing E2E test that could also be the basis for these tests, if we can get the E2E tests back into a usable state: https://github.com/elastic/e2e-testing/blob/main/e2e/_suites/fleet/features/permission_output_change.feature

@jlind23 jlind23 added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Oct 11, 2022
@cmacknz cmacknz closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.6-candidate estimation:Week Task that represents a week of work. Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

3 participants