Skip to content

Generate an Access Monitoring event reference#61632

Merged
ptgott merged 2 commits intomasterfrom
paul.gottschling/60074-athena
Nov 24, 2025
Merged

Generate an Access Monitoring event reference#61632
ptgott merged 2 commits intomasterfrom
paul.gottschling/60074-athena

Conversation

@ptgott
Copy link
Copy Markdown
Contributor

@ptgott ptgott commented Nov 20, 2025

Closes #60074

Use the getters we declared to access protobuf-generated event structs in order to create Athena views for Access Monitoring events, populating a template with the event structs and including examples of tctl audit query exec queries.

Add Make targets to generate the page and check that it was generated. Add a step to the Lint (Proto) job to check that this was generated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 20, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/60074-athena 9db5af7 11 ✅SUCCEED paul-gottschling-60074-athena 2025-11-24 16:57:49

@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from 25c4e91 to 017ae55 Compare November 20, 2025 20:02
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from 017ae55 to 22dd4d0 Compare November 20, 2025 20:05
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from 22dd4d0 to 8a4ebc7 Compare November 20, 2025 20:10
@ptgott
Copy link
Copy Markdown
Contributor Author

ptgott commented Nov 20, 2025

Reviewer note: We need to find a better place for the generator. gen-athena-docs/main.go is provisional, but putting this in build.assets/tooling/cmd led to some issues for me when attempting to import github.com/gravitational/teleport/gen/go/eventschema.

@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from 8a4ebc7 to a7d190c Compare November 20, 2025 20:23
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from 1600cac to 8c27f45 Compare November 21, 2025 14:56
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from 8c27f45 to fff4e1f Compare November 21, 2025 15:08
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from fff4e1f to afb249e Compare November 21, 2025 15:17
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from afb249e to b625ee0 Compare November 21, 2025 15:32
@ptgott ptgott marked this pull request as ready for review November 21, 2025 15:56
@ptgott ptgott added the no-changelog Indicates that a PR does not require a changelog entry label Nov 21, 2025
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

Nice work

Closes #60074

Use the getters we declared to access protobuf-generated event structs
in order to create Athena views for Access Monitoring events, populating
a template with the event structs and including examples of `tctl audit
query exec` queries.

Add Make targets to generate the page and check that it was generated.
Add a step to the `Lint (Proto)` job to check that this was generated.
- Remove unnecessary line breaks.
- Move `teleport` requirement into the main `require` block.
- Embed the template.
- Accommodate characters that exceed one byte in `prepareDescription`.
- Use a no-allocation alternative to strings.Join in `colNameList`.
@ptgott ptgott added this pull request to the merge queue Nov 24, 2025
@ptgott ptgott removed this pull request from the merge queue due to a manual request Nov 24, 2025
@ptgott ptgott force-pushed the paul.gottschling/60074-athena branch from b625ee0 to 9db5af7 Compare November 24, 2025 16:53
@ptgott ptgott enabled auto-merge November 24, 2025 16:53
@ptgott ptgott added this pull request to the merge queue Nov 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 24, 2025
@ptgott ptgott added this pull request to the merge queue Nov 24, 2025
Merged via the queue into master with commit 626fdf0 Nov 24, 2025
45 checks passed
@ptgott ptgott deleted the paul.gottschling/60074-athena branch November 24, 2025 17:45
ptgott added a commit that referenced this pull request Nov 24, 2025
Backports #61632

* Generate an Access Monitoring event reference

Closes #60074

Use the getters we declared to access protobuf-generated event structs
in order to create Athena views for Access Monitoring events, populating
a template with the event structs and including examples of `tctl audit
query exec` queries.

Add Make targets to generate the page and check that it was generated.
Add a step to the `Lint (Proto)` job to check that this was generated.

* Clean up the event schema reference generator

- Remove unnecessary line breaks.
- Move `teleport` requirement into the main `require` block.
- Embed the template.
- Accommodate characters that exceed one byte in `prepareDescription`.
- Use a no-allocation alternative to strings.Join in `colNameList`.
ptgott added a commit that referenced this pull request Nov 24, 2025
Backports #61632

* Generate an Access Monitoring event reference

Closes #60074

Use the getters we declared to access protobuf-generated event structs
in order to create Athena views for Access Monitoring events, populating
a template with the event structs and including examples of `tctl audit
query exec` queries.

Add Make targets to generate the page and check that it was generated.
Add a step to the `Lint (Proto)` job to check that this was generated.

* Clean up the event schema reference generator

- Remove unnecessary line breaks.
- Move `teleport` requirement into the main `require` block.
- Embed the template.
- Accommodate characters that exceed one byte in `prepareDescription`.
- Use a no-allocation alternative to strings.Join in `colNameList`.
---

The Access Monitoring event reference includes a list of Access Monitoring
events that you can query and view in reports, along with examples of @tctl@
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I missed this first time around - are these @ symbols meant to be backticks? i don't think this file went through the substitution so perhaps this is deliberate.

Copy link
Copy Markdown
Contributor Author

@ptgott ptgott Nov 25, 2025

Choose a reason for hiding this comment

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

Ah, good catch, thanks. This file was originally part of the template before I opened the PR, but I forgot to remove the @s when I extracted it. Fixed in #61770

zmb3 pushed a commit that referenced this pull request Nov 24, 2025
Backports #61632

* Generate an Access Monitoring event reference

Closes #60074

Use the getters we declared to access protobuf-generated event structs
in order to create Athena views for Access Monitoring events, populating
a template with the event structs and including examples of `tctl audit
query exec` queries.

Add Make targets to generate the page and check that it was generated.
Add a step to the `Lint (Proto)` job to check that this was generated.

* Clean up the event schema reference generator

- Remove unnecessary line breaks.
- Move `teleport` requirement into the main `require` block.
- Embed the template.
- Accommodate characters that exceed one byte in `prepareDescription`.
- Use a no-allocation alternative to strings.Join in `colNameList`.
ptgott added a commit that referenced this pull request Nov 25, 2025
In #61632, the Access Monitoring event reference generator originally
replaced `@` characters in a template with backticks before executing
it, and the frontmatter and introduction of the guide were part of the
template.

While this change took a different approach, extracting the frontmatter
and introduction into a separate file, and no longer replacing `@`
characters, the `@` characters weren't removed from the file. This
change fixes the stray `@` characters.
github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2025
In #61632, the Access Monitoring event reference generator originally
replaced `@` characters in a template with backticks before executing
it, and the frontmatter and introduction of the guide were part of the
template.

While this change took a different approach, extracting the frontmatter
and introduction into a separate file, and no longer replacing `@`
characters, the `@` characters weren't removed from the file. This
change fixes the stray `@` characters.
backport-bot-workflows bot pushed a commit that referenced this pull request Nov 26, 2025
In #61632, the Access Monitoring event reference generator originally
replaced `@` characters in a template with backticks before executing
it, and the frontmatter and introduction of the guide were part of the
template.

While this change took a different approach, extracting the frontmatter
and introduction into a separate file, and no longer replacing `@`
characters, the `@` characters weren't removed from the file. This
change fixes the stray `@` characters.
github-merge-queue bot pushed a commit that referenced this pull request Dec 1, 2025
In #61632, the Access Monitoring event reference generator originally
replaced `@` characters in a template with backticks before executing
it, and the frontmatter and introduction of the guide were part of the
template.

While this change took a different approach, extracting the frontmatter
and introduction into a separate file, and no longer replacing `@`
characters, the `@` characters weren't removed from the file. This
change fixes the stray `@` characters.
cthach pushed a commit that referenced this pull request Dec 1, 2025
In #61632, the Access Monitoring event reference generator originally
replaced `@` characters in a template with backticks before executing
it, and the frontmatter and introduction of the guide were part of the
template.

While this change took a different approach, extracting the frontmatter
and introduction into a separate file, and no longer replacing `@`
characters, the `@` characters weren't removed from the file. This
change fixes the stray `@` characters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation no-changelog Indicates that a PR does not require a changelog entry size/xl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Athena query interfaces: Document schemas and query examples for audit event tables

4 participants