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

docs(audit): Dev Portal Audit Logging #7816

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

alexgervais
Copy link
Contributor

@alexgervais alexgervais commented Aug 29, 2024

Description

Resolving conflicts from #7803
Adds documentation for dev portal audit logging

DOCU-4044

Testing instructions

Preview link:

Checklist

@alexgervais alexgervais requested a review from a team as a code owner August 29, 2024 18:03
Copy link

netlify bot commented Aug 29, 2024

Deploy Preview for kongdocs ready!

Name Link
🔨 Latest commit 61b1d05
🔍 Latest deploy log https://app.netlify.com/sites/kongdocs/deploys/66fb127a6e1eca000817d185
😎 Deploy Preview https://deploy-preview-7816--kongdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
9 paths audited
Performance: 94 (🟢 up 3 from production)
Accessibility: 92 (no change from production)
Best Practices: 98 (🟢 up 8 from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@cloudjumpercat cloudjumpercat self-assigned this Sep 6, 2024
@cloudjumpercat cloudjumpercat added do not merge Issues/ PRs whose changes should not be merged at this time review:copyedit Request for writer review. labels Sep 13, 2024
@cloudjumpercat cloudjumpercat marked this pull request as draft September 13, 2024 19:31
cloudjumpercat and others added 2 commits September 13, 2024 15:50
…l overview use case table, add link to audit log on create dev portal, start revising some of the content

Signed-off-by: Diana <[email protected]>
@cloudjumpercat cloudjumpercat mentioned this pull request Sep 18, 2024
2 tasks
Copy link
Contributor

@smritikjaggi smritikjaggi left a comment

Choose a reason for hiding this comment

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

Looks good! Left some comments...

content_type: concept
---

{% include_cached /md/konnect/audit-logging/audit-log-overview.md %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this line inherits the text from Audit Logs for Enterprise. However, can we modify this line from By tracking Konnect audit logs, you gain the following benefits to By tracking Dev Portal audit logs, you gain the following benefit?

Copy link
Contributor

Choose a reason for hiding this comment

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

I edited this so it's a bit more generic, like "By tracking audit logs..." so it would apply to both. Currently, I don't know of a way to make that bit specific to the feature area and still reuse for both pages. I wanted to reuse it because 99% of the content was the exact same, so it helps us keep both up-to-date and reduce translation costs in the future.

{% include_cached /md/konnect/audit-logging/audit-log-overview.md %}

{:.note}
> **Note:** Dev Portal audit logs are set up and managed separately from org-wide {{site.konnect_short_name}} audit logs. For more information about how to configure audit logging for a {{site.konnect_short_name}}, see [Set up an audit log webhook for Dev Portal](/konnect/dev-portal/audit-logging/webhook/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the intent here to navigate users looking to configure audit logging for Konnect to https://docs.konghq.com/konnect/org-management/audit-logging/?

Copy link
Contributor

Choose a reason for hiding this comment

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

@smritikjaggi Yep! I added one to the org management audit logging page as well. This is just to help users who maybe landed here on a search accidentally know that the configurations are different and direct them to the correct doc.

You can use the {{site.konnect_short_name}} UI or the Audit Logs API to configure webhooks for [audit logging](/konnect/dev-portal/audit-logging/).

{:.note}
> **Note:** Currently, Dev Portal audit logs only support authorization logs, which are triggered when a user logs in to Dev Portal.
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, Dev Portal audit logs only support authentication logs. Authorization logs are in scope for future milestones.

{:.note}
> **Note:** Currently, Dev Portal audit logs only support authorization logs, which are triggered when a user logs in to Dev Portal.

{% include_cached /md/konnect/audit-logging/webhook-overview-prereq-siem-config.md %}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we modify the sentence Before you can push Konnect audit logs to an external service to Before you can push Dev Portal audit logs to an external service.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think users will get confused by the term "external service"? We could say - "Before you can push Dev Portal Audit Logs to a SEIM system of choice"

Copy link
Contributor

Choose a reason for hiding this comment

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

I edited it so it's a bit more generic so it applies to both Dev Portal and Konnect and changes "external service" to SIEM provider.

* **Skip SSL Verification**: Skip SSL verification of the host endpoint when delivering payloads.

{:.note}
> We strongly recommend not setting this to `true` as you are subject to man-in-the-middle and other attacks. This option should be considered only when using self-signed SSL certificates in a non-production environment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace "this" to "skip SSL verification":
We strongly recommend not setting "skip SSL Verification" to true


Now that you have an external endpoint and authorization credentials, you can set up an audit log destination in {{site.konnect_short_name}}. The `/audit_log_destinations` endpoint allows you to set your audit log destination, which includes the endpoint URL and access key for your SIEM provider, and reuse it.

The {{site.konnect_short_name}} API uses [Personal Access Token (PAT)](/konnect/api/#authentication) authentication. You can obtain your PAT from the [personal access token page](https://cloud.konghq.com/global/account/tokens). The PAT must be passed in the `Authorization` header of all requests.
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see this section in the deploy preview - am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

@smritikjaggi This will be under the API tab

Screenshot 2024-09-24 at 3 13 13 PM


## Prerequisites

* [**Org Admin** or **Portal Admin** permissions](/konnect/org-management/teams-and-roles/teams-reference/)
Copy link
Contributor

Choose a reason for hiding this comment

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

@neethi-shashidhar-kong - can you confirm if we would have Portal Admin role set up audit logs for Dev Portal based on the perm sync conversations this morning? I think only Org Admin will have permissions.

{% navtabs %}
{% navtab Konnect UI %}

1. From the navigation menu, open {% konnect_icon Dev-Portal %} **Settings**, then **Audit Logs Setup**.
Copy link
Contributor

Choose a reason for hiding this comment

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

The first time I read this, I did not realize we are looking at Settings under Dev Portal menu. Would it be helpful to clarify that?

{% navtabs %}
{% navtab Konnect UI %}

1. From the navigation menu, open {% konnect_icon Dev-Portal %} **Settings**, then **Audit Logs Setup**.
Copy link
Contributor

Choose a reason for hiding this comment

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

The first time I read this, I did not realize we are looking at Settings under Dev Portal menu. Would it be helpful to clarify that?

@@ -35,7 +90,7 @@ Timestamp | Time and date of the event in UTC.
`user_agent` | The user agent of the request: application, operating system, vendor, and version.
`sig` | An ED25519 signature.

## Authentication logs
### Authentication logs

Authentication attempts and their outcomes are logged whenever a user logs in to the Konnect application or uses the Konnect API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Authentication attempts and their outcomes are logged whenever a user logs in to the Konnect application or a Dev Portal either through the UI or the API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Fixed this in my revision.

Copy link
Contributor Author

@alexgervais alexgervais left a comment

Choose a reason for hiding this comment

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

This is great! 🙌

1. Create a webhook by sending a PATCH request to the `/audit-log-webhook` endpoint with your configured audit log destination:

```sh
curl -i -X PATCH https://{region}.api.konghq.com/v2/portals/{portalId}/audit-log-webhook \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The {portalId} placeholder is not documented bellow. For other requests it appears to be documented (example). I feel we should be consistent, even if repetitive

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! I added it now

{% navtabs codeblock %}
{% navtab CEF %}
```
Apr 14 05:39:08 konghq.com CEF:0|KongInc|Konnect|1.0|konnect|Authz.usage|1|rt=1681450748406 src=127.0.0.6 action=retrieve granted=true org_id=b065b594-6afc-4658-9101-5d9cf3f36b7b principal_id=87655c36-8d63-48fe-9a1e-53b28dfbc19b trace_id=3895213347334635099 user_agent=grpc-node/1.24.11 grpc-c/8.0.0 (linux; chttp2; ganges)
Copy link
Contributor Author

@alexgervais alexgervais Sep 24, 2024

Choose a reason for hiding this comment

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

The format differs slightly for DevPortal audit logs. This example represents what one might expect from a Konnect Org audit log, but I feel we should have example of DevPortal logs too and document the extra portal_id field.

I tried to capture the difference in a previous commit: b6d3aa9#diff-6c4dc5b26f5a4395618ddcf396cfbad8ceb081df139f65907ad604e85b52b519R104-R134

Copy link
Contributor

Choose a reason for hiding this comment

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

Good call! I added them back in the revision with a tab for the Konnect logs and a tab for the Dev Portal logs

Signed-off-by: Diana <[email protected]>
@cloudjumpercat
Copy link
Contributor

@smritikjaggi @alexgervais Thanks for the feedback! I responded to any questions/comments you had and implemented your feedback. I still haven't revised the Dev Portal audit log UI instructions since I'm waiting for internal release for those.

Feel free to look things over again or I'll reach out after I've revised the UI instructions after internal release so you can review everything. I'll be sending this out for a writer review for either the end of this week or early next week.

Comment on lines +99 to +102
You can view the status of your webhook through the **Audit Logs Setup** page under
{% konnect_icon organizations %} **Organization**. A badge will display next to the title of the webhook with the status of the webhook.

To see the last attempt timestamp and the last response code, use the audit log API.
Copy link
Contributor

@cloudjumpercat cloudjumpercat Oct 2, 2024

Choose a reason for hiding this comment

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

For Team Docs writers: UI instructions need an update here

Comment on lines +24 to +31
1. In {% konnect_icon dev-portal %} [**Dev Portal**](https://cloud.konghq.com/portal), click **Settings**, and then click **Audit Logs Setup**.
1. Switch to the **Replay** tab.
1. Choose a timeframe for which you want to replay the logs.

You can choose one of the preset relative increments for up to 24 hours, or
set a custom timeframe for up to 7 days.

1. Apply the timeframe, then click **Send Replay**.
Copy link
Contributor

Choose a reason for hiding this comment

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

For Team Docs writers: UI instructions need an update here

Comment on lines +73 to +78
1. In {% konnect_icon dev-portal %} [**Dev Portal**](https://cloud.konghq.com/portal), click **Settings**, then **Audit Logs Setup**.
1. Switch to the **Replay** tab.
1. Check the status table below the configuration field.

![Audit log replay](/assets/images/products/konnect/audit-logs/konnect-audit-log-replay.png)

Copy link
Contributor

Choose a reason for hiding this comment

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

For Team Docs writers: UI instructions need an update here

@cloudjumpercat
Copy link
Contributor

Items left for a writer to do:

  • Several Dev Portal audit log UI flows need to be revised and tested. I've marked them with comments in the PR.
  • The whole thing need a copyedit/writer review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Issues/ PRs whose changes should not be merged at this time review:copyedit Request for writer review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants