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

Audit in programmability sample #6258

Merged
merged 11 commits into from
Jun 17, 2024

Conversation

achamayou
Copy link
Member

@achamayou achamayou commented Jun 12, 2024

For the following endpoints:

  • PUT /app/custom_endpoints
  • PATCH /app/custom_endpoints/runtime_option

Input payloads (i.e. request bodies) are logged to public:custom_endpoints.audit.input, and metadata is logged at public:custom_endpoints.audit.info, with the following fields:

  • format one of COSE, JSON.
  • content one of BUNDLE, OPTIONS.
  • user_id the user id of the caller.

Note that only COSE payloads are offline verifiable, i.e. can be checked by an outside auditor without having to trust the service, since they are signed directly by the user key. For payloads that come in via client certificate authentication, the content and user id are recorded by the service, which is trusted to do this accurately.

@achamayou achamayou requested a review from a team June 12, 2024 15:27
@eddyashton eddyashton merged commit f60afbe into microsoft:main Jun 17, 2024
21 checks passed
@@ -223,10 +228,19 @@ namespace programmabilityapp
}
// End of Authorization Check

const auto bundle = get_body(ctx);
const auto [format, bundle] = get_body(ctx);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is format and bundle here?

Copy link
Member Author

Choose a reason for hiding this comment

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

See definition of get_body() on line 52, format is an enum (AuditInputFormat) and bundle is a std::span (i.e. the actual body, which could be either JSON or COSE, as indicated by format).

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.

3 participants