Repository navigation
Conversation
…emplate Add three optional parameters, ElasticKibanaUrl, ElasticApiKey and ElasticCallbackId, that Kibana sets when it launches the stack. When all three are set, a Lambda-backed custom resource posts the role ARN and the stack ARN to Kibana, so the user does not have to paste them. When any of them is empty, the stack behaves as before. The function always answers SUCCESS to CloudFormation, so a failed report never fails or rolls back the stack. It does not retry a 4xx answer and retries other failures with backoff while enough time remains. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
This pull request does not have a backport label. Could you fix it @bhapas? 🙏
|
groman92
approved these changes
Oct 15, 2026
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Kibana now passes the callback as ElasticCallbackUrl, the complete URL of the record the stack reports to, next to ElasticApiKey. The template took ElasticKibanaUrl and ElasticCallbackId and built the route itself, so a launch from Kibana left CallbackEnabled false and the stack never reported. The handler is the one the IaC Provisioner blueprint ships, byte for byte, so it also carries that handler's later fixes: it logs why Kibana could not be reached, and logs only the exception type when the exception could quote a header. ElasticApiKey gets an AllowedPattern so a malformed key is rejected at launch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
seanrathier
reviewed
Oct 16, 2026
seanrathier
left a comment
Contributor
There was a problem hiding this comment.
Added comment for discussion
Contributor
There was a problem hiding this comment.
I am commenting here mainly for a discussion.
This is a publicly available, unsigned S3 CFT. Do we want to have this detail of how we do our frictionless onboarding out in the public?
To be clear, I mean this ONLY for the static template; the IACP-generated one is signed so the risk is not there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of your changes
The Workload Identity template (
deploy/cloudformation/federated-identity-wii-aws.yml) can now send the role it creates back to Kibana. The user no longer has to copy the Role ARN and the Stack ARN from the stack outputs into Kibana.Two new optional parameters. Kibana sets them when it launches the stack. Both default to empty, and CloudFormation validates both.
ElasticCallbackUrl: the complete URL of the Kibana callback this stack reports to. Must be empty or anhttpsURL with a path. Kibana builds it from the route it owns, so a route change stays on the Kibana side.ElasticApiKey: a single-use API key with no privileges, used only for this report. Must be empty or base64. Hidden in the console (NoEcho).When both are set, the stack creates a Lambda function and a custom resource. The function sends a POST with
{"role_arn": ..., "stack_arn": ...}toElasticCallbackUrl, authenticated with the API key. The custom resource runs after the role and all of its policies are created.When either is empty, the stack does not create these resources and behaves as before.
How the function behaves:
callback result <status>, for exampleconnectedorfailed: http 404. When Kibana could not be reached it logs the reason, for example a certificate the function does not trust. It never logs the event, the request headers or the API key, and an exception that could quote a header is logged by its type alone.The Lambda code is byte for byte the
callback.pythat elastic/cloud-iac-provisioner#434 adds to the generated template, so both templates behave the same way. Keep the two identical.Related Issues
Related: elastic/kibana#297690, elastic/cloud-iac-provisioner#434, https://github.com/elastic/security-team/issues/12714
Checklist
cfn-lint1.57.2 passes on the template.rain fmt --verifyreports one blank line to add betweenWiiOidcProviderFunctionRoleandWiiOidcProviderFunction, which is outside this change and already inmain.callback.pyfrom elastic/cloud-iac-provisioner#434 and compiles with Python 3.13 (py_compile).test/blueprints/test_callback.py) pass against the code extracted from this template, on Python 3.13 and 3.14.DependsOnlists everyAWS::IAM::Policyin the template (17).ZipFile.