From 03f99fa7d744d483729e68cec8c6cd6517a1d2c9 Mon Sep 17 00:00:00 2001
From: ci-bot
Date: Mon, 6 Jan 2025 11:09:57 +0000
Subject: [PATCH] Deployed 0f48276 to main with MkDocs 1.6.1 and mike 2.1.3
---
main/search/search_index.json | 2 +-
main/sitemap.xml | 52 ++++++++++++------------
main/sitemap.xml.gz | Bin 449 -> 449 bytes
main/tutorials/envoy-gateway/index.html | 35 ++++++++++++++--
main/tutorials/istio/index.html | 32 +++++++++++++--
5 files changed, 86 insertions(+), 35 deletions(-)
diff --git a/main/search/search_index.json b/main/search/search_index.json
index a758230..403b4fd 100644
--- a/main/search/search_index.json
+++ b/main/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"cel-extensions/","title":"CEL extensions","text":"
The CEL engine used to evaluate variables and authorization rules has been extended with libraries to help processing the input CheckRequest and forge the corresponding OkResponse and/or DeniedResponse.
Field CEL Type / Proto Docs status google.rpc.Status Docs http_response envoy.service.auth.v3.OkHttpResponse Docs dynamic_metadata google.protobuf.Struct Docs"},{"location":"cel-extensions/envoy/#deniedresponse","title":"<DeniedResponse>","text":"
CEL Type / Proto: envoy.DeniedResponse
Field CEL Type / Proto Docs status google.rpc.Status Docs http_response envoy.service.auth.v3.DeniedHttpResponse Docs dynamic_metadata google.protobuf.Struct Docs"},{"location":"cel-extensions/envoy/#okhttpresponse","title":"<OkHttpResponse>","text":"
CEL Type / Proto: envoy.service.auth.v3.OkHttpResponse
Field CEL Type / Proto Docs Valid bool Header google.protobuf.Struct Docs Claims google.protobuf.Struct Docs"},{"location":"cel-extensions/jwt/#functions","title":"Functions","text":""},{"location":"cel-extensions/jwt/#jwtdecode","title":"jwt.Decode","text":"
The jwt.Decode function decodes and validates a JWT token. It accepts two arguments: the token and the secret to verify the signature.
"},{"location":"cel-extensions/jwt/#signature-and-overloads","title":"Signature and overloads","text":"
The Kyverno Envoy Plugin has a growing community and we would definitely love to see you join and contribute.
Everyone is welcome to make suggestions, report bugs, open feature requests, contribute code or docs, participate in discussions, write blogs or anything that can benefit the project.
The Kyverno Envoy Plugin is built and maintained under the Kyverno umbrella but decisions are Community driven Everyone's voice matters
If you are using the Kyverno Envoy Plugin and want to share it publicly we always appreciate a bit of support. Pull requests to the ADOPTERS LIST will put a smile on our faces
Kyverno Envoy Plugin, developed by Kyverno, is an advanced end-to-end testing tool for Kubernetes. Our community plays a crucial role in shaping the project by reporting bugs, suggesting features, and improving documentation.
We aim to make our issue tracker, discussion board, and documentation well-structured and easy to navigate. By following our guidelines, you can help us address your requests efficiently.
"},{"location":"community/contribute/#how-you-can-contribute","title":"How you can contribute","text":"
We appreciate your efforts in reporting bugs, requesting features, and engaging in discussions. Here's how you can contribute:
"},{"location":"community/contribute/#creating-an-issue","title":"Creating an issue","text":"
Something is not working?
Report a bug by creating an issue with a reproduction
Report a bug
Missing information in our docs?
Report missing information or potential inconsistencies in our documentation
Report a docs issue
Want to submit an idea?
Propose a change, feature request, or suggest an improvement
Request a change
Have a question or need help?
Ask a question on our discussion board and get in touch with our community
Before interacting within the project, please consider the following questions to ensure you're using the correct issue template and providing all necessary information.
Issues, discussions, and comments are forever
Please note that everything you write is permanent and will remain for everyone to read \u2013 forever. Therefore, please always be nice and constructive, follow our contribution guidelines, and comply with our Code of Conduct.
"},{"location":"community/contribute/#before-creating-an-issue","title":"Before creating an issue","text":"
Are you using the appropriate issue template, or is there another issue template that better fits the context of your request?
Have you checked if a similar bug report or change request has already been created, or have you stumbled upon something that might be related?
Did you fill out every field as requested and provide all additional information needed to comprehend your request?
"},{"location":"community/contribute/#before-asking-a-question","title":"Before asking a question","text":"
Is the topic a question for our discussion board, or is it a bug report or change request that should be raised on our issue tracker?
Is there an open discussion on the topic of your request? If the answer is yes, does your question match the direction of the discussion, or should you open a new discussion?
Did you provide our community with all the necessary information to understand your question and help you quickly, or can you make it easier to help you?
Is your comment relevant to the topic of the current page, post, issue, or discussion, or is it better to create a new issue or discussion?
Does your comment add value to the conversation? Is it constructive and respectful to our community and maintainers? Could you just use a reaction instead?
"},{"location":"community/contribute/#rights-and-responsibilities","title":"Rights and responsibilities","text":"
As maintainers, we are entrusted with the responsibility to moderate communication within our community, including the authority to close, remove, reject, or edit issues, discussions, comments, commits, and to block users who do not align with our contribution guidelines and our Code of Conduct. This role requires us to be actively involved in maintaining the integrity and positive atmosphere of our community. Upholding these standards decisively ensures a respectful and inclusive environment for all members.
"},{"location":"community/contribute/#code-of-conduct","title":"Code of Conduct","text":"
Our Code of Conduct outlines the expectation for all community members to treat one another with respect, employing inclusive and welcoming language. Our commitment is to foster a positive and supportive environment, free of inappropriate, offensive, or harmful behavior.
We take any violations seriously and will take appropriate action in response to uphold these values.1
"},{"location":"community/contribute/#incomplete-issues-and-duplicates","title":"Incomplete issues and duplicates","text":"
We have invested significant time and effort in the setup of our contribution process, ensuring that we assess the essential requirements for reviewing and responding to issues effectively. Each field in our issue templates is thoughtfully designed to help us fully understand your concerns and the nature of your matter. We encourage all members to utilize the search function before submitting new issues or starting discussions to help avoid duplicates. Your cooperation is crucial in keeping our community's discussions constructive and organized.
Mandatory completion of issue templates: We need all of the information required in our issue templates because it ensures that every user and maintainer, regardless of their experience, can understand the content and severity of your bug report or change request.
Closing incomplete issues: We reserve the right to close issues lacking essential information, such as but not limited to [minimal reproductions] or those not adhering to the quality standards and requirements specified in our issue templates. Such issues can be reopened once the missing information has been provided.
Handling duplicates: To maintain organized and efficient communication within our issue tracker and discussion board, we reserve the right to close any duplicated issues or lock duplicated discussions. Opening multiple channels to ask the same question or report the same issue across different forums hinders our ability to manage and address community concerns effectively. This approach is vital for efficient time management, as duplicated questions can consume the time of multiple team members simultaneously. Ensuring that each issue or discussion is unique and progresses with new information helps us to maintain focus and support our community.
We further reserve the right to immediately close discussions or issues that are reopened without providing new information or simply because users have not yet received a response to their issue/question, as the issue is marked as incomplete.
Limitations of automated tools: While we believe in the value and efficiency that automated tools bring to identifying potential issues (such as those identified by Lighthouse, Accessibility tools, and others), simply submitting an issue generated by these tools does not constitute a complete bug report. These tools sometimes produce verbose outputs and may include false positives, which necessitate a critical evaluation. You are of course welcome to attach generated reports to your issue. However, this does not substitute the requirement for a minimal reproduction or a thorough discussion of the findings. We reserve the right to mark these issues as incomplete and close them. This practice ensures that we are addressing genuine concerns with precision and clarity, rather than navigating through extensive automated outputs.
Warning and blocking policy: Given the increasing popularity of our project and our commitment to a healthy community, we've defined clear guidelines on how we proceed with violations:
1.1. First warning: Users displaying repeated inappropriate, offensive, or harmful behavior will receive a first warning. This warning serves as a formal notice that their behavior is not in alignment with our community standards and Code of Conduct. The first warning is permanent.
1.2. Second warning and opportunity for resolution: If the behavior persists, a second warning will be issued. Upon receiving the second warning, the user will be given a 5-day period for reflection, during which they are encouraged to publicly explain or apologize for their actions. This period is designed to offer an opportunity for openly clearing out any misunderstanding.
1.3. Blocking: Should there be no response or improvement in behavior following the second warning, we reserve the right to block the user from the community and repository. Blocking is considered a last resort, used only when absolutely necessary to protect the community's integrity and positive atmosphere.
Blocking has been an exceptionally rare necessity in our overwhelmingly positive community, highlighting our preference for constructive dialogue and mutual respect. It aims to protect our community members and team.\u00a0\u21a9
You can contribute by making a pull request that will be reviewed by maintainers and integrated into the main repository when the changes made are approved. You can contribute bug fixes, documentation changes, or new functionalities.
Considering a pull request
Before deciding to spend effort on making changes and creating a pull request, please discuss what you intend to do. If you are responding to what you think might be a bug, please issue a bug report first. If you intend to work on documentation, create a documentation issue. If you want to work on a new feature, please create a change request.
Keep in mind the guidance given and let people advise you. It might be that there are easier solutions to the problem you perceive and want to address. It might be that what you want to achieve can already be done by configuration or [customization].
"},{"location":"community/making-a-pull-request/#learning-about-pull-requests","title":"Learning about pull requests","text":"
Pull requests are a concept layered on top of Git by services that provide Git hosting. Before you consider making a pull request, you should familiarize yourself with the documentation on GitHub, the service we are using. The following articles are of particular importance:
Forking a repository
Creating a pull request from a fork
Creating a pull request
Note that they provide tailored documentation for different operating systems and different ways of interacting with GitHub. We do our best in the documentation here to describe the process as it applies but cannot cover all possible combinations of tools and ways of doing things. It is also important that you understand the concept of a pull-request in general before continuing.
In the following, we describe the general process for making pull requests. The aim here is to provide the 30k ft overview before describing details later on.
"},{"location":"community/making-a-pull-request/#preparing-changes-and-draft-pr","title":"Preparing changes and draft PR","text":"
The diagram below describes what typically happens to repositories in the process or preparing a pull request. We will be discussing the review-revise process below. It is important that you understand the overall process first before you worry about specific commands. This is why we cover this first before providing instructions below.
sequenceDiagram\n autonumber\n\n participant upstream\n participant PR\n participant fork\n participant local\n\n upstream ->> fork: fork on GitHub\n fork ->> local: clone to local\n local ->> local: branch\n loop prepare\n loop push\n loop edit\n local ->> local: commit\n end\n local ->> fork: push\n end\n upstream ->> fork: merge in any changes\n fork ->>+ PR: create draft PR\n PR ->> PR: review your changes\n end
Fork the Repository: Fork the upstream repository on GitHub to create your own copy.
Clone to Local: Clone your fork to your local machine.
Create a Branch: Create a topic branch for your changes.
Set Up Development Environment: Follow the instructions to set up a development environment.
Iterate and Commit: Make incremental changes and commit them with meaningful messages.
Push Regularly: Push your commits to your fork regularly.
Merge Changes from Upstream: Regularly merge changes from the original upstream repository to avoid conflicts.
Create a Draft Pull Request: Once satisfied with your changes, create a draft pull request for early feedback.
Review and Revise: Review your work critically, address feedback, and refine your changes.
Once you are happy with your changes, you can move to the next step, finalizing your pull request and asking for a more formal and detailed review. The diagram below shows the process:
If you think you have discovered a bug, you can help us by submitting an issue in our public issue tracker, following this guide.
"},{"location":"community/reporting-a-bug/#before-creating-an-issue","title":"Before Creating an Issue","text":"
With numerous users, issues are created regularly. The maintainers of this project strive to address bugs promptly. By following this guide, you will know exactly what information we need to help you quickly.
Please do the following before creating an issue:
"},{"location":"community/reporting-a-bug/#upgrade-to-latest-version","title":"Upgrade to Latest Version","text":"
Chances are that the bug you discovered was already fixed in a subsequent version. Before reporting an issue, ensure that you're running the latest version.
Bug fixes are not backported
Please understand that only bugs that occur in the latest version will be addressed. Also, to reduce duplicate efforts, fixes cannot always be backported to earlier versions.
If you're using customizations like additional configurations, remove them before reporting a bug. We can't offer official support for bugs that might hide in your overrides, so make sure to omit custom settings from your configuration files.
Don't be shy to ask on our discussion board for help if you run into problems.
"},{"location":"community/reporting-a-bug/#search-for-solutions","title":"Search for Solutions","text":"
At this stage, we know that the problem persists in the latest version and is not caused by any of your customizations. However, the problem might result from a small typo or a syntactical error in a configuration file.
Before creating a bug report, save time for us and yourself by doing some research:
Search our documentation for relevant sections related to your problem. Ensure everything is configured correctly.
[Search our issue tracker] as another user might have already reported the same problem.
[Search our discussion board] to see if other users are facing similar issues and find possible solutions.
Keep track of all search terms and relevant links; you'll need them in the bug report.
If you still haven't found a solution to your problem, create an issue. It's now likely that you've encountered something new. Read the following section to learn how to create a complete and helpful bug report.
We have created a new issue template to make the bug reporting process as simple as possible and more efficient for our community and us. It consists of the following parts:
A good title is short and descriptive. It should be a one-sentence executive summary of the issue, so the impact and severity of the bug can be inferred from the title.
Example Clear apply command fails with specific CRD Wordy The apply command fails when used with a certain Custom Resource Definition Unclear Command does not work Useless Help"},{"location":"community/reporting-a-bug/#context","title":"Context optional","text":"
Before describing the bug, you can provide additional context to help us understand what you were trying to achieve. Explain the circumstances under which the bug happens, and what you think might be relevant. Don't describe the bug here.
Provide a clear, focused, specific, and concise summary of the bug you encountered. Explain why you think this is a bug that should be reported, and not to one of its dependencies. Follow these principles:
Explain the what, not the how \u2013 don't explain how to reproduce the bug here, we're getting there. Focus on articulating the problem and its impact.
Keep it short and concise \u2013 if the bug can be precisely explained in one or two sentences, perfect. Don't inflate it.
One bug at a time \u2013 if you encounter several unrelated bugs, create separate issues for them.
Share links to relevant sections of our documentation and any related issues or discussions. This helps us improve our documentation and understand the problem better.
A minimal reproduction is essential for a well-written bug report, as it allows us to recreate the conditions necessary to inspect the bug. Follow the guide to create a reproduction:
After creating the reproduction, you should have a .zip file, ideally not larger than 1 MB. Drag and drop the .zip file into the issue field, which will automatically upload it to GitHub.
Don't share links to repositories
While linking to a repository is a common practice, we currently don't support this. The reproduction, created using the built-in info plugin, contains all necessary environment information.
"},{"location":"community/reporting-a-bug/#steps-to-reproduce","title":"Steps to Reproduce","text":"
List specific steps to follow when running your reproduction to observe the bug. Keep the steps concise and ensure nothing is left out. Use simple language and focus on continuity.
If the bug only occurs in specific browsers, let us know which ones are affected. This field is optional, as it is only relevant for bugs that do not involve a crash when previewing or building your site.
Incognito Mode
Verify that the bug is not caused by a browser extension by switching to incognito mode. If the bug disappears, it is likely caused by an extension.
The documentation includes extensive information on features, configurations, customizations, and more. If you have found an inconsistency or see room for improvement, please follow this guide to submit an issue on our issue tracker.
Reporting a documentation issue is usually less involved than reporting a bug, as we don't need a [reproduction]. Please thoroughly read this guide before creating a new documentation issue, and provide the following information as part of the issue:
A good title should be a short, one-sentence description of the issue, containing all relevant information and keywords to simplify the search in our issue tracker.
Example Clear Clarify resource templating setup Unclear Missing information in the docs Useless Help"},{"location":"community/reporting-a-docs-issue/#description","title":"Description","text":"
Provide a clear and concise summary of the inconsistency or issue you encountered in the documentation or the documentation section that needs improvement. Explain why you think the documentation should be adjusted and describe the severity of the issue:
Keep it short and concise \u2013 if the inconsistency or issue can be precisely explained in one or two sentences, perfect. Maintainers and future users will be grateful for having to read less.
One issue at a time \u2013 if you encounter several unrelated inconsistencies, please create separate issues for them.
Why we need this: describing the problem clearly and concisely is a prerequisite for improving our documentation \u2013 we need to understand what's wrong so we can fix it.
After you describe the documentation section that needs to be adjusted, share the link to this specific documentation section and other possibly related sections. Use anchor links (permanent links) where possible, as it simplifies discovery.
Why we need this: providing the links to the documentation helps us understand which sections of our documentation need to be adjusted, extended, or overhauled.
Now that you have provided us with the description and links to the documentation sections, you can help us, maintainers, and the community by proposing an improvement. You can sketch out rough ideas or write a concrete proposal. This field is optional but very helpful.
Why we need this: an improvement proposal can be beneficial for other users who encounter the same issue, as they offer solutions before we maintainers can update the documentation.
Thanks for following the guide and providing valuable feedback for our documentation \u2013 you are almost done. The checklist ensures that you have read this guide and have worked to your best knowledge to provide us with every piece of information we need to improve it.
We value every idea or contribution from our community. Please follow this guide before submitting your change request in our public issue tracker. This helps us better understand the proposed change and how it will benefit our community.
"},{"location":"community/requesting-a-change/#before-creating-an-issue","title":"Before Creating an Issue","text":"
Before you invest time in submitting a change request, answer these questions to determine if your idea is a good fit and matches the project's philosophy and tone.
"},{"location":"community/requesting-a-change/#its-not-a-bug-its-a-feature","title":"It's Not a Bug, It's a Feature","text":"
Change requests suggest minor adjustments, new features, or influence the project's direction. They are not intended for reporting bugs. Refer to our bug reporting guide for that.
"},{"location":"community/requesting-a-change/#look-for-sources-of-inspiration","title":"Look for Sources of Inspiration","text":"
If your idea is implemented in another tool or framework, collect information on its implementation. This helps us evaluate its fit more quickly.
"},{"location":"community/requesting-a-change/#connect-with-our-community","title":"Connect with Our Community","text":"
Our discussion board is the best place to connect with our community. Seeking input from other users helps implement features that benefit a larger number of users.
A good title is short and descriptive, summarizing the idea so the potential impact and benefit can be inferred.
Example Clear Support for resource templating Wordy Add support for templating resources for easier testing Unclear Improve templating Useless Help"},{"location":"community/requesting-a-change/#context","title":"Context optional","text":"
Provide additional context to help us understand what you are trying to achieve. Explain the circumstances and relevant settings without describing the change request itself.
Provide a detailed and clear description of your idea. Explain why your idea is relevant and should be implemented here, not in one of its dependencies.
Explain the what, not the why \u2013 focus on describing the change request precisely.
Keep it short and concise \u2013 be brief and to the point.
One idea at a time \u2013 if you have multiple ideas, open separate change requests for each.
Explain how your change request would work from an author's and user's perspective. What is the expected impact, and why does it benefit other users? Would it potentially break existing functionality?
If you have any visuals, such as sketches, screenshots, mockups, or external assets, present them in this section. If you have seen this change used in other tools, showcase and describe its implementation.
Thanks for following the guide and creating a high-quality change request. The checklist ensures that you have read this guide and provided all necessary information for us to review your idea.
Your change request got rejected? We're sorry for that. We understand it can be frustrating, but we always need to consider the needs of our entire community. If you're unsure why your change request was rejected, please ask for clarification.
We consider the following principles when evaluating change requests:
Alignment with the project's vision and tone
Compatibility with existing features and plugins
Compatibility with all screen sizes and browsers
Effort of implementation and maintenance
Usefulness to the majority of users
Simplicity and ease of use
Accessibility
If your idea was rejected, you can always implement it via [customization]. If you're unsure how or want to know if someone has already done it, get in touch with our community on the discussion board.
This page offers guidance and best practices for benchmarking the performance of the Kyverno Authz Server, helping users understand the associated overhead. It outlines an example setup for conducting benchmarks, various benchmarking scenarios, and key metrics to capture for assessing the impact of the Kyverno Authz Server.
The first component is a simple Go application that provides information of books in the library books collection and exposes APIs to get, create and delete books collection. Check this out for more information about the Go test application .
The second component is the Envoy proxy, which runs alongside the example application. The Envoy configuration defines an external authorization filter envoy.ext_authz for a gRPC authorization server.
The config uses Envoy's in-built gRPC client to make external gRPC calls.
The following scenarios should be tested to compare the performance of the Kyverno Authz Server under different conditions:
App Only: Requests are sent directly to the application, without Envoy or the Kyverno Authz Server.
App and Envoy: Envoy is included in the request path, but the Kyverno Authz Server is not (i.e., Envoy External Authorization API is disabled).
App, Envoy, and Kyverno: Envoy External Authorization API is enabled, and a sample real-world policy is loaded into the Kyverno Authz Server.
"},{"location":"performance/#load-testing-with-k6","title":"Load Testing with k6","text":"
To perform load testing, we'll use the k6 tool. Follow these steps:
Install k6: Install k6 on your machine by following the instructions on the official website.
Write the k6 script: Below is the example k6 script.
import http from 'k6/http';\nimport { check, group, sleep } from 'k6';\n\nexport const options = {\n stages: [\n { duration: '30s', target: 100 }, // Ramp-up to 100 virtual users over 30 seconds\n { duration: '1m', target: 100 }, // Stay at 100 virtual users for 1 minute\n { duration: '30s', target: 0 }, // Ramp-down to 0 virtual users over 30 seconds\n ],\n};\n\n/*\nReplace ip for every scenerio\nexport SERVICE_PORT=$(kubectl -n demo get service testapp -o jsonpath='{.spec.ports[?(@.port==8080)].nodePort}')\nexport SERVICE_HOST=$(minikube ip)\nexport SERVICE_URL=$SERVICE_HOST:$SERVICE_PORT\necho $SERVICE_URL\n\nhttp://192.168.49.2:31541\n\n*/\nconst BASE_URL = 'http://192.168.49.2:31541'; \n\nexport default function () {\n group('GET /book with guest token', () => {\n const res = http.get(`${BASE_URL}/book`, {\n headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjIyNDEwODE1MzksIm5iZiI6MTUxNDg1MTEzOSwicm9sZSI6Imd1ZXN0Iiwic3ViIjoiWVd4cFkyVT0ifQ.ja1bgvIt47393ba_WbSBm35NrUhdxM4mOVQN8iXz8lk' },\n });\n check(res, {\n 'is status 200': (r) => r.status === 200,\n });\n });\n\n sleep(1); // Sleep for 1 second between iterations\n}\n
Run the k6 test: Run the load test with the following command:
$ k6 run -f - <<EOF\nimport http from 'k6/http';\nimport { check, group, sleep } from 'k6';\n\nexport const options = {\n stages: [\n { duration: '30s', target: 100 }, // Ramp-up to 100 virtual users over 30 seconds\n { duration: '1m', target: 100 }, // Stay at 100 virtual users for 1 minute\n { duration: '30s', target: 0 }, // Ramp-down to 0 virtual users over 30 seconds\n ],\n};\n\n\nconst BASE_URL = 'http://192.168.49.2:31700'; // Replace with your application URL \n\nexport default function () {\n group('GET /book with guest token', () => {\n const res = http.get(`${BASE_URL}/book`, {\n headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjIyNDEwODE1MzksIm5iZiI6MTUxNDg1MTEzOSwicm9sZSI6Imd1ZXN0Iiwic3ViIjoiWVd4cFkyVT0ifQ.ja1bgvIt47393ba_WbSBm35NrUhdxM4mOVQN8iXz8lk' },\n });\n check(res, {\n 'is status 200': (r) => r.status === 200,\n });\n });\n\n sleep(1); // Sleep for 1 second between iterations\n}\nEOF\n
Analyze the results: Generate an json report with detailed insight by running:
k6 run --out json=report.json k6-script.js\n
5. Repeat for different scenarios:
App only
In this case , request are sent directly to the sample application ie no Envoy and Kyverno-plugin in the request path . For this run this command to apply the sample applicaition and then test with k6
In this case, the Kyverno Authz Server is not included in the path but Envoy is but Envoy External Authorization API disabled For this run this command to apply the sample application with envoy.
In this case, performance measurements are observed with Envoy External Authorization API enabled and a sample real-world policy loaded into the Kyverno Authz Server.
For this apply this command to apply sample-application, envoy and Kyverno Authz Server:
The following metrics should be measured to evaluate the performance impact of the Kyverno Authz Server:
End-to-end latency
The end-to-end latency represents the time taken for a request to complete, from the client sending the request to receiving the response. Based on the k6 results, the average end-to-end latency for the different scenarios is as follows:
App Only: avg=1.01ms (from group_duration or http_req_duration)
App and Envoy: avg=2.38ms (from http_req_duration)
App, Envoy, and Kyverno Authz Server: avg=46.37ms (from http_req_duration)
Kyverno evaluation latency
The Kyverno evaluation latency represents the time taken by the Kyverno Authz Server to evaluate the request against the configured policies. While the k6 results do not directly provide this metric, an estimate can be inferred by analyzing the differences in latency between the \"App and Envoy\" scenario and the \"App, Envoy, and Kyverno Authz Server\" scenario.
The difference in average latency between these two scenarios is: 46.37ms - 2.38ms = 43.99ms
This difference can be attributed to the Kyverno evaluation latency and the gRPC server handler latency combined. Assuming the gRPC server handler latency is relatively small compared to the Kyverno evaluation latency, the estimated range for the Kyverno evaluation latency is around 40ms to 45ms.
Resource utilization
Refers to CPU and memory usage of the Kyverno Authz Server container , kubectl top utility can be laveraged to measure the resource utilization.
Get the resource utilization of the Kyverno Authz Server container using the following command:
$ kubectl top pod -n demo --containers\n
To monitor resource utilization overtime use the following command:
$ watch -n 1 \"kubectl top pod -n demo --containers\"\n
Now run the k6 script in different terminal window and observe the resource utilization of the Kyverno Authz Server container.
Initial resource utilization of the Kyverno Authz Server container:
POD NAME CPU(cores) MEMORY(bytes)\ntestapp-5955cd6f8b-dbvgd envoy 4m 70Mi\ntestapp-5955cd6f8b-dbvgd server 1m 51Mi\ntestapp-5955cd6f8b-dbvgd test-application 1m 11Mi\n
Resource utilization of the Kyverno Authz Server container after 100 requests:
POD NAME CPU(cores) MEMORY(bytes)\ntestapp-5955cd6f8b-dbvgd envoy 110m 70Mi\ntestapp-5955cd6f8b-dbvgd server 895m 60Mi\ntestapp-5955cd6f8b-dbvgd test-application 17m 15Mi\n
Observations:
The CPU utilization of the Kyverno Authz Server container increased significantly from 1m to 895m after receiving 100 requests during the load test.
The memory utilization also increased, but to a lesser extent, from 51Mi to 60Mi.
Resource utilization of the Kyverno Authz Server container after load completion:
POD NAME CPU(cores) MEMORY(bytes)\ntestapp-5955cd6f8b-dbvgd envoy 4m 70Mi\ntestapp-5955cd6f8b-dbvgd server 1m 51Mi\ntestapp-5955cd6f8b-dbvgd test-application 1m 11Mi\n
Observations:
After the load test completed and the request volume returned to normal levels, the CPU and memory utilization of the Kyverno Authz Server container returned to their initial values. This indicates that the Kyverno Authz Server can efficiently handle the increased load during the test and release the additional resources when the load subsides.
Correlation with k6 results:
The k6 script simulated a load test scenario with 100 virtual users, ramping up over 30 seconds, staying at 100 users for 1 minute, and then ramping down over 30 seconds.
During the load test, when the request volume was at its peak (100 virtual users), the Kyverno Authz Server container experienced a significant increase in CPU utilization, reaching 895m.
This CPU utilization spike aligns with the increased processing demand on the Kyverno Authz Server to evaluate the incoming requests against the configured Kyverno policies.
The memory utilization increase during the load test was relatively modest, suggesting that the policy evaluation did not significantly impact the memory requirements of the Kyverno Authz Server.
A Kyverno AuthorizationPolicy is a custom Kubernetes resources and can be easily managed via Kubernetes APIs, GitOps workflows, and other existing tools.
A Kyverno AuthorizationPolicy is a cluster-wide resource.
"},{"location":"policies/#api-group-and-kind","title":"API Group and Kind","text":"
An AuthorizationPolicy belongs to the envoy.kyverno.io/v1alpha1 group and can only be of kind AuthorizationPolicy.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n # if something fails the request will be denied\n failurePolicy: Fail\n variables:\n # `force_authorized` references the 'x-force-authorized' header\n # from the envoy check request (or '' if not present)\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n # `allowed` will be `true` if `variables.force_authorized` has the\n # value 'enabled' or 'true'\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n deny:\n # make an authorisation decision based on the value of `variables.allowed`\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n allow:\n - response: >\n envoy.Allowed().Response()\n
An AuthorizationPolicy main concern is to define authorization rules to deny or allow requests.
Every authorization rule is made of an optional match statement and a required response statement. Both statements are written in CEL.
If the match statement is present and evaluates to true, the response statement is used to create the response payload returned to the envoy proxy. Depending on the rule type, the response is expected to be an envoy.OkResponse or envoy.DeniedResponse.
Creating an OkResponse or DeniedResponse can be a tedious task, you need to remember the different types names and format.
The CEL engine used to evaluate the authorization rules has been extended with a library to make the creation of responses easier. Browse the available libraries documentation for details.
The policy below will allow requests if they contain the header x-force-authorized with the value enabled or true. If the header is not present or has a different value, the request will be denied.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n failurePolicy: Fail\n variables:\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n # make an authorisation decision based on the value of `variables.allowed`\n # - deny the request with 403 status code if it is `false`\n # - else allow the request\n deny:\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n allow:\n - response: >\n envoy.Allowed().Response()\n
In this simple rule:
envoy.Allowed().Response()
Creates an OkResponse to allow the request
envoy.Denied(403).Response()
Creates a DeniedResponse to deny the request with status code 403
However, we can do a lot more. Envoy can add or remove headers, query parameters, register dynamic metadata passed along the filters chain, and even change the response body.
"},{"location":"policies/authorization-rules/#the-hard-way","title":"The hard way","text":"
Below is the same policy, creating the envoy.OkResponse and envoy.DeniedResponse manually.
To add dynamic metadata in the envoy filter chain (this is useful when you want to pass data to another filter in the chain or you want to print it in the application logs)
Info
The full documentation of the CEL Envoy library is available here.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n # if something fails the failure will be ignored and the request will be allowed\n failurePolicy: Ignore\n variables:\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n deny:\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n
A Kyverno AuthorizationPolicy can define variables that will be made available to all authorization rules.
Variables can be used in composition of other expressions. Each variable is defined as a named CEL expression. The will be available under variables in other expressions of the policy.
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
Info
The incoming CheckRequest from Envoy is made available to the policy under the object identifier.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n failurePolicy: Fail\n variables:\n # `force_authorized` references the 'x-force-authorized' header\n # from the envoy check request (or '' if not present)\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n # `allowed` will be `true` if `variables.force_authorized` has the\n # value 'enabled' or 'true'\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n deny:\n # make an authorisation decision based on the value of `variables.allowed`\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n
The Kyverno Envoy Plugin is a powerful tool that integrates with the Envoy proxy.
It allows you to enforce Kyverno policies on incoming and outgoing traffic in a service mesh environment, providing an additional layer of security and control over your applications.
Envoy is a Layer 7 proxy and communication bus tailored for large-scale, modern service-oriented architectures. Starting from version 1.7.0, Envoy includes an External Authorization filter that interfaces with an authorization service to determine the legitimacy of incoming requests.
This functionality allows authorization decisions to be offloaded to an external service, which can access the request context. The request context includes details such as the origin and destination of the network activity, as well as specifics of the network request (e.g., HTTP request). This information enables the external service to make a well-informed decision regarding the authorization of the incoming request processed by Envoy.
"},{"location":"quick-start/#what-is-the-kyverno-envoy-plugin","title":"What is the Kyverno Envoy Plugin?","text":"
The Kyverno Envoy Plugin is gRPC server that implements Envoy External Authorization API.
This allows you to enforce Kyverno policies on incoming and outgoing traffic in a service mesh environment, providing an additional layer of security and control over your applications. You can use this version of Kyverno to enforce fine-grained, context-aware access control policies with Envoy without modifying your microservice.
"},{"location":"quick-start/#how-does-this-work","title":"How does this work?","text":"
In addition to the Envoy sidecar, your application pods will include a Kyverno Authz Server component, either as a sidecar or as a separate pod. When Envoy receives an API request intended for your microservice, it consults the Kyverno Authz Server to determine whether the request should be permitted or not.
Performing policy evaluations locally with Envoy is advantageous, as it eliminates the need for an additional network hop for authorization checks, thus enhancing both performance and availability.
Info
The Kyverno Envoy Plugin is frequently deployed in Kubernetes environments as a sidecar container or as a separate pod. Additionally, it can be used in other environments as a standalone process running alongside Envoy.
In this quick start guide we will deploy the Kyverno Authz Server inside a cluster.
Then you will interface Istio, an open source service mesh with the Kyverno Authz Server to delegate the request authorisation based on policies installed in the cluster.
"},{"location":"quick-start/authz-server/#deploy-the-kyverno-authz-server","title":"Deploy the Kyverno Authz Server","text":"
The first step is to deploy the Kyverno Authz Server.
# create the kyverno namespace\nkubectl create ns kyverno\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace kyverno istio-injection=enabled\n\n# deploy the kyverno authz server\nhelm install kyverno-authz-server --namespace kyverno --wait \\\n --repo https://kyverno.github.io/kyverno-envoy-plugin \\\n kyverno-authz-server\n
"},{"location":"quick-start/authz-server/#deploy-a-sample-application","title":"Deploy a sample application","text":"
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace\nkubectl create ns demo\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace demo istio-injection=enabled\n\n# deploy the httpbin application\nkubectl apply -n demo -f \\\n https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml\n
"},{"location":"quick-start/authz-server/#deploy-an-istio-authorizationpolicy","title":"Deploy an Istio AuthorizationPolicy","text":"
An AuthorizationPolicy is the custom Istio resource that defines the services that will be protected by the Kyverno Authz Server.
# deploy istio authorization policy\nkubectl apply -f - <<EOF\napiVersion: security.istio.io/v1\nkind: AuthorizationPolicy\nmetadata:\n name: kyverno-authz-server\n namespace: demo\nspec:\n action: CUSTOM\n provider:\n name: kyverno-authz-server.local\n rules:\n - {} # empty rules, it will apply to all requests\nEOF\n
Notice that in this resource, we define the Kyverno Authz Server extensionProvider you set in the Istio configuration:
AuthorizationPolicy defines an authorization policy resource
Field Type Required Inline Description apiVersionstringenvoy.kyverno.io/v1alpha1kindstringAuthorizationPolicymetadatameta/v1.ObjectMeta No description provided. specAuthorizationPolicySpec No description provided."},{"location":"reference/apis/policy.v1alpha1/#envoy-kyverno-io-v1alpha1-Authorization","title":"Authorization","text":"
Appears in:
AuthorizationPolicySpec
Authorization defines an authorization policy rule
Field Type Required Inline Description matchstring
Match represents the match condition which will be evaluated by CEL. Must evaluate to bool.
responsestring
Response represents the response expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to CEL variables as well as some other useful variables: - 'object' - The object from the incoming request. (https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto#service-auth-v3-checkrequest) CEL expressions are expected to return an envoy CheckResponse (https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto#service-auth-v3-checkresponse).
AuthorizationPolicySpec defines the spec of an authorization policy
Field Type Required Inline Description failurePolicyadmissionregistration/v1.FailurePolicyType
FailurePolicy defines how to handle failures for the policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions. FailurePolicy does not define how validations that evaluate to false are handled. Allowed values are Ignore or Fail. Defaults to Fail.
MatchConditions is a list of conditions that must be met for a request to be validated. An empty list of matchConditions matches all requests. The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped
variables[]admissionregistration/v1.Variable
Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under variables in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy. The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
deny[]Authorization
Deny contain CEL expressions which is used to deny a request.
allow[]Authorization
Allow contain CEL expressions which is used to allow a request.
If you didn't read the Quick start section yet, we really recommend giving it a try to discover and familiarise with the Kyverno Envoy Plugin components first.
Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway. Gateway API resources are used to dynamically provision and configure the managed Envoy Proxies.
This tutorial shows how Envoy Gateway can be configured to delegate authorization decisions to the Kyverno Authz Server.
"},{"location":"tutorials/envoy-gateway/#deploy-a-sample-application","title":"Deploy a sample application","text":"
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace\nkubectl create ns demo\n\n# deploy the httpbin application\nkubectl apply -n demo -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml\n
"},{"location":"tutorials/envoy-gateway/#create-a-gatewayclass-and-a-gateway","title":"Create a GatewayClass and a Gateway","text":"
With Envoy Gateway installed we can now create a Gateway. To do so we will also create a dedicated GatewayClass.
Depending on your setup you will potentially need to create an EnvoyProxy resource to customize the way Envoy Gateway will create the underlying Service. The script below creates one to set the name and type of the service because the kind cluster created in the first step doesn't come with load balancer support.
# create a gateway\nkubectl apply -n demo -f - <<EOF\napiVersion: gateway.envoyproxy.io/v1alpha1\nkind: EnvoyProxy\nmetadata:\n name: demo\nspec:\n provider:\n type: Kubernetes\n kubernetes:\n envoyService:\n name: internet # use a known name for the created service\n type: ClusterIP # because a kind cluster has no support for LB\n---\napiVersion: gateway.networking.k8s.io/v1\nkind: GatewayClass\nmetadata:\n name: demo\nspec:\n controllerName: gateway.envoyproxy.io/gatewayclass-controller\n---\napiVersion: gateway.networking.k8s.io/v1\nkind: Gateway\nmetadata:\n name: demo\nspec:\n gatewayClassName: demo\n infrastructure:\n parametersRef:\n group: gateway.envoyproxy.io\n kind: EnvoyProxy\n name: demo\n listeners:\n - name: http\n protocol: HTTP\n port: 80\nEOF\n
"},{"location":"tutorials/envoy-gateway/#create-an-httproute-to-the-sample-application","title":"Create an HTTPRoute to the sample application","text":"
Next, we need to link the Gateway to our sample applicate with an HTTPRoute.
"},{"location":"tutorials/envoy-gateway/#deploy-an-envoy-gateway-securitypolicy","title":"Deploy an Envoy Gateway SecurityPolicy","text":"
A SecurityPolicy is the custom Envoy Gateway resource to configure underlying Envoy Proxy to use an external auth server (the Kyverno Authz Server we installed in a prior step).
"},{"location":"tutorials/envoy-gateway/#grant-access-to-the-kyverno-authz-server-service","title":"Grant access to the Kyverno Authz Server service","text":"
Last thing we need to configure is to grant access to the Kyverno Authz Server service for our SecurityPolicy to take effect.
Istio is an open source service mesh for managing the different microservices that make up a cloud-native application. Istio provides a mechanism to use a service as an external authorizer with the AuthorizationPolicy API.
This tutorial shows how Istio\u2019s AuthorizationPolicy can be configured to delegate authorization decisions to the Kyverno Authz Server.
"},{"location":"tutorials/istio/#deploy-the-kyverno-authz-server","title":"Deploy the Kyverno Authz Server","text":"
The first step is to deploy the Kyverno Authz Server.
# create the kyverno namespace\nkubectl create ns kyverno\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace kyverno istio-injection=enabled\n\n# deploy the kyverno authz server\nhelm install kyverno-authz-server --namespace kyverno --wait --repo https://kyverno.github.io/kyverno-envoy-plugin kyverno-authz-server\n
"},{"location":"tutorials/istio/#deploy-a-sample-application","title":"Deploy a sample application","text":"
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace\nkubectl create ns demo\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace demo istio-injection=enabled\n\n# deploy the httpbin application\nkubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml -n demo\n
"},{"location":"tutorials/istio/#deploy-an-istio-authorizationpolicy","title":"Deploy an Istio AuthorizationPolicy","text":"
An AuthorizationPolicy is the custom Istio resource that defines the services that will be protected by the Kyverno Authz Server.
# deploy istio authorization policy\nkubectl apply -f - <<EOF\napiVersion: security.istio.io/v1\nkind: AuthorizationPolicy\nmetadata:\n name: kyverno-authz-server\n namespace: demo\nspec:\n action: CUSTOM\n provider:\n name: kyverno-authz-server.local\n rules:\n - {} # empty rules, it will apply to all requests\nEOF\n
Notice that in this resource, we define the Kyverno Authz Server extensionProvider you set in the Istio configuration:
This tutorial demonstrated how to configure Istio\u2019s EnvoyFilter to utilize the Kyverno Authz Server as an external authorization service.
Additionally, the tutorial provided an example policy to decode a JWT token and make a decision based on it.
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"cel-extensions/","title":"CEL extensions","text":"
The CEL engine used to evaluate variables and authorization rules has been extended with libraries to help processing the input CheckRequest and forge the corresponding OkResponse and/or DeniedResponse.
Field CEL Type / Proto Docs status google.rpc.Status Docs http_response envoy.service.auth.v3.OkHttpResponse Docs dynamic_metadata google.protobuf.Struct Docs"},{"location":"cel-extensions/envoy/#deniedresponse","title":"<DeniedResponse>","text":"
CEL Type / Proto: envoy.DeniedResponse
Field CEL Type / Proto Docs status google.rpc.Status Docs http_response envoy.service.auth.v3.DeniedHttpResponse Docs dynamic_metadata google.protobuf.Struct Docs"},{"location":"cel-extensions/envoy/#okhttpresponse","title":"<OkHttpResponse>","text":"
CEL Type / Proto: envoy.service.auth.v3.OkHttpResponse
Field CEL Type / Proto Docs Valid bool Header google.protobuf.Struct Docs Claims google.protobuf.Struct Docs"},{"location":"cel-extensions/jwt/#functions","title":"Functions","text":""},{"location":"cel-extensions/jwt/#jwtdecode","title":"jwt.Decode","text":"
The jwt.Decode function decodes and validates a JWT token. It accepts two arguments: the token and the secret to verify the signature.
"},{"location":"cel-extensions/jwt/#signature-and-overloads","title":"Signature and overloads","text":"
The Kyverno Envoy Plugin has a growing community and we would definitely love to see you join and contribute.
Everyone is welcome to make suggestions, report bugs, open feature requests, contribute code or docs, participate in discussions, write blogs or anything that can benefit the project.
The Kyverno Envoy Plugin is built and maintained under the Kyverno umbrella but decisions are Community driven Everyone's voice matters
If you are using the Kyverno Envoy Plugin and want to share it publicly we always appreciate a bit of support. Pull requests to the ADOPTERS LIST will put a smile on our faces
Kyverno Envoy Plugin, developed by Kyverno, is an advanced end-to-end testing tool for Kubernetes. Our community plays a crucial role in shaping the project by reporting bugs, suggesting features, and improving documentation.
We aim to make our issue tracker, discussion board, and documentation well-structured and easy to navigate. By following our guidelines, you can help us address your requests efficiently.
"},{"location":"community/contribute/#how-you-can-contribute","title":"How you can contribute","text":"
We appreciate your efforts in reporting bugs, requesting features, and engaging in discussions. Here's how you can contribute:
"},{"location":"community/contribute/#creating-an-issue","title":"Creating an issue","text":"
Something is not working?
Report a bug by creating an issue with a reproduction
Report a bug
Missing information in our docs?
Report missing information or potential inconsistencies in our documentation
Report a docs issue
Want to submit an idea?
Propose a change, feature request, or suggest an improvement
Request a change
Have a question or need help?
Ask a question on our discussion board and get in touch with our community
Before interacting within the project, please consider the following questions to ensure you're using the correct issue template and providing all necessary information.
Issues, discussions, and comments are forever
Please note that everything you write is permanent and will remain for everyone to read \u2013 forever. Therefore, please always be nice and constructive, follow our contribution guidelines, and comply with our Code of Conduct.
"},{"location":"community/contribute/#before-creating-an-issue","title":"Before creating an issue","text":"
Are you using the appropriate issue template, or is there another issue template that better fits the context of your request?
Have you checked if a similar bug report or change request has already been created, or have you stumbled upon something that might be related?
Did you fill out every field as requested and provide all additional information needed to comprehend your request?
"},{"location":"community/contribute/#before-asking-a-question","title":"Before asking a question","text":"
Is the topic a question for our discussion board, or is it a bug report or change request that should be raised on our issue tracker?
Is there an open discussion on the topic of your request? If the answer is yes, does your question match the direction of the discussion, or should you open a new discussion?
Did you provide our community with all the necessary information to understand your question and help you quickly, or can you make it easier to help you?
Is your comment relevant to the topic of the current page, post, issue, or discussion, or is it better to create a new issue or discussion?
Does your comment add value to the conversation? Is it constructive and respectful to our community and maintainers? Could you just use a reaction instead?
"},{"location":"community/contribute/#rights-and-responsibilities","title":"Rights and responsibilities","text":"
As maintainers, we are entrusted with the responsibility to moderate communication within our community, including the authority to close, remove, reject, or edit issues, discussions, comments, commits, and to block users who do not align with our contribution guidelines and our Code of Conduct. This role requires us to be actively involved in maintaining the integrity and positive atmosphere of our community. Upholding these standards decisively ensures a respectful and inclusive environment for all members.
"},{"location":"community/contribute/#code-of-conduct","title":"Code of Conduct","text":"
Our Code of Conduct outlines the expectation for all community members to treat one another with respect, employing inclusive and welcoming language. Our commitment is to foster a positive and supportive environment, free of inappropriate, offensive, or harmful behavior.
We take any violations seriously and will take appropriate action in response to uphold these values.1
"},{"location":"community/contribute/#incomplete-issues-and-duplicates","title":"Incomplete issues and duplicates","text":"
We have invested significant time and effort in the setup of our contribution process, ensuring that we assess the essential requirements for reviewing and responding to issues effectively. Each field in our issue templates is thoughtfully designed to help us fully understand your concerns and the nature of your matter. We encourage all members to utilize the search function before submitting new issues or starting discussions to help avoid duplicates. Your cooperation is crucial in keeping our community's discussions constructive and organized.
Mandatory completion of issue templates: We need all of the information required in our issue templates because it ensures that every user and maintainer, regardless of their experience, can understand the content and severity of your bug report or change request.
Closing incomplete issues: We reserve the right to close issues lacking essential information, such as but not limited to [minimal reproductions] or those not adhering to the quality standards and requirements specified in our issue templates. Such issues can be reopened once the missing information has been provided.
Handling duplicates: To maintain organized and efficient communication within our issue tracker and discussion board, we reserve the right to close any duplicated issues or lock duplicated discussions. Opening multiple channels to ask the same question or report the same issue across different forums hinders our ability to manage and address community concerns effectively. This approach is vital for efficient time management, as duplicated questions can consume the time of multiple team members simultaneously. Ensuring that each issue or discussion is unique and progresses with new information helps us to maintain focus and support our community.
We further reserve the right to immediately close discussions or issues that are reopened without providing new information or simply because users have not yet received a response to their issue/question, as the issue is marked as incomplete.
Limitations of automated tools: While we believe in the value and efficiency that automated tools bring to identifying potential issues (such as those identified by Lighthouse, Accessibility tools, and others), simply submitting an issue generated by these tools does not constitute a complete bug report. These tools sometimes produce verbose outputs and may include false positives, which necessitate a critical evaluation. You are of course welcome to attach generated reports to your issue. However, this does not substitute the requirement for a minimal reproduction or a thorough discussion of the findings. We reserve the right to mark these issues as incomplete and close them. This practice ensures that we are addressing genuine concerns with precision and clarity, rather than navigating through extensive automated outputs.
Warning and blocking policy: Given the increasing popularity of our project and our commitment to a healthy community, we've defined clear guidelines on how we proceed with violations:
1.1. First warning: Users displaying repeated inappropriate, offensive, or harmful behavior will receive a first warning. This warning serves as a formal notice that their behavior is not in alignment with our community standards and Code of Conduct. The first warning is permanent.
1.2. Second warning and opportunity for resolution: If the behavior persists, a second warning will be issued. Upon receiving the second warning, the user will be given a 5-day period for reflection, during which they are encouraged to publicly explain or apologize for their actions. This period is designed to offer an opportunity for openly clearing out any misunderstanding.
1.3. Blocking: Should there be no response or improvement in behavior following the second warning, we reserve the right to block the user from the community and repository. Blocking is considered a last resort, used only when absolutely necessary to protect the community's integrity and positive atmosphere.
Blocking has been an exceptionally rare necessity in our overwhelmingly positive community, highlighting our preference for constructive dialogue and mutual respect. It aims to protect our community members and team.\u00a0\u21a9
You can contribute by making a pull request that will be reviewed by maintainers and integrated into the main repository when the changes made are approved. You can contribute bug fixes, documentation changes, or new functionalities.
Considering a pull request
Before deciding to spend effort on making changes and creating a pull request, please discuss what you intend to do. If you are responding to what you think might be a bug, please issue a bug report first. If you intend to work on documentation, create a documentation issue. If you want to work on a new feature, please create a change request.
Keep in mind the guidance given and let people advise you. It might be that there are easier solutions to the problem you perceive and want to address. It might be that what you want to achieve can already be done by configuration or [customization].
"},{"location":"community/making-a-pull-request/#learning-about-pull-requests","title":"Learning about pull requests","text":"
Pull requests are a concept layered on top of Git by services that provide Git hosting. Before you consider making a pull request, you should familiarize yourself with the documentation on GitHub, the service we are using. The following articles are of particular importance:
Forking a repository
Creating a pull request from a fork
Creating a pull request
Note that they provide tailored documentation for different operating systems and different ways of interacting with GitHub. We do our best in the documentation here to describe the process as it applies but cannot cover all possible combinations of tools and ways of doing things. It is also important that you understand the concept of a pull-request in general before continuing.
In the following, we describe the general process for making pull requests. The aim here is to provide the 30k ft overview before describing details later on.
"},{"location":"community/making-a-pull-request/#preparing-changes-and-draft-pr","title":"Preparing changes and draft PR","text":"
The diagram below describes what typically happens to repositories in the process or preparing a pull request. We will be discussing the review-revise process below. It is important that you understand the overall process first before you worry about specific commands. This is why we cover this first before providing instructions below.
sequenceDiagram\n autonumber\n\n participant upstream\n participant PR\n participant fork\n participant local\n\n upstream ->> fork: fork on GitHub\n fork ->> local: clone to local\n local ->> local: branch\n loop prepare\n loop push\n loop edit\n local ->> local: commit\n end\n local ->> fork: push\n end\n upstream ->> fork: merge in any changes\n fork ->>+ PR: create draft PR\n PR ->> PR: review your changes\n end
Fork the Repository: Fork the upstream repository on GitHub to create your own copy.
Clone to Local: Clone your fork to your local machine.
Create a Branch: Create a topic branch for your changes.
Set Up Development Environment: Follow the instructions to set up a development environment.
Iterate and Commit: Make incremental changes and commit them with meaningful messages.
Push Regularly: Push your commits to your fork regularly.
Merge Changes from Upstream: Regularly merge changes from the original upstream repository to avoid conflicts.
Create a Draft Pull Request: Once satisfied with your changes, create a draft pull request for early feedback.
Review and Revise: Review your work critically, address feedback, and refine your changes.
Once you are happy with your changes, you can move to the next step, finalizing your pull request and asking for a more formal and detailed review. The diagram below shows the process:
If you think you have discovered a bug, you can help us by submitting an issue in our public issue tracker, following this guide.
"},{"location":"community/reporting-a-bug/#before-creating-an-issue","title":"Before Creating an Issue","text":"
With numerous users, issues are created regularly. The maintainers of this project strive to address bugs promptly. By following this guide, you will know exactly what information we need to help you quickly.
Please do the following before creating an issue:
"},{"location":"community/reporting-a-bug/#upgrade-to-latest-version","title":"Upgrade to Latest Version","text":"
Chances are that the bug you discovered was already fixed in a subsequent version. Before reporting an issue, ensure that you're running the latest version.
Bug fixes are not backported
Please understand that only bugs that occur in the latest version will be addressed. Also, to reduce duplicate efforts, fixes cannot always be backported to earlier versions.
If you're using customizations like additional configurations, remove them before reporting a bug. We can't offer official support for bugs that might hide in your overrides, so make sure to omit custom settings from your configuration files.
Don't be shy to ask on our discussion board for help if you run into problems.
"},{"location":"community/reporting-a-bug/#search-for-solutions","title":"Search for Solutions","text":"
At this stage, we know that the problem persists in the latest version and is not caused by any of your customizations. However, the problem might result from a small typo or a syntactical error in a configuration file.
Before creating a bug report, save time for us and yourself by doing some research:
Search our documentation for relevant sections related to your problem. Ensure everything is configured correctly.
[Search our issue tracker] as another user might have already reported the same problem.
[Search our discussion board] to see if other users are facing similar issues and find possible solutions.
Keep track of all search terms and relevant links; you'll need them in the bug report.
If you still haven't found a solution to your problem, create an issue. It's now likely that you've encountered something new. Read the following section to learn how to create a complete and helpful bug report.
We have created a new issue template to make the bug reporting process as simple as possible and more efficient for our community and us. It consists of the following parts:
A good title is short and descriptive. It should be a one-sentence executive summary of the issue, so the impact and severity of the bug can be inferred from the title.
Example Clear apply command fails with specific CRD Wordy The apply command fails when used with a certain Custom Resource Definition Unclear Command does not work Useless Help"},{"location":"community/reporting-a-bug/#context","title":"Context optional","text":"
Before describing the bug, you can provide additional context to help us understand what you were trying to achieve. Explain the circumstances under which the bug happens, and what you think might be relevant. Don't describe the bug here.
Provide a clear, focused, specific, and concise summary of the bug you encountered. Explain why you think this is a bug that should be reported, and not to one of its dependencies. Follow these principles:
Explain the what, not the how \u2013 don't explain how to reproduce the bug here, we're getting there. Focus on articulating the problem and its impact.
Keep it short and concise \u2013 if the bug can be precisely explained in one or two sentences, perfect. Don't inflate it.
One bug at a time \u2013 if you encounter several unrelated bugs, create separate issues for them.
Share links to relevant sections of our documentation and any related issues or discussions. This helps us improve our documentation and understand the problem better.
A minimal reproduction is essential for a well-written bug report, as it allows us to recreate the conditions necessary to inspect the bug. Follow the guide to create a reproduction:
After creating the reproduction, you should have a .zip file, ideally not larger than 1 MB. Drag and drop the .zip file into the issue field, which will automatically upload it to GitHub.
Don't share links to repositories
While linking to a repository is a common practice, we currently don't support this. The reproduction, created using the built-in info plugin, contains all necessary environment information.
"},{"location":"community/reporting-a-bug/#steps-to-reproduce","title":"Steps to Reproduce","text":"
List specific steps to follow when running your reproduction to observe the bug. Keep the steps concise and ensure nothing is left out. Use simple language and focus on continuity.
If the bug only occurs in specific browsers, let us know which ones are affected. This field is optional, as it is only relevant for bugs that do not involve a crash when previewing or building your site.
Incognito Mode
Verify that the bug is not caused by a browser extension by switching to incognito mode. If the bug disappears, it is likely caused by an extension.
The documentation includes extensive information on features, configurations, customizations, and more. If you have found an inconsistency or see room for improvement, please follow this guide to submit an issue on our issue tracker.
Reporting a documentation issue is usually less involved than reporting a bug, as we don't need a [reproduction]. Please thoroughly read this guide before creating a new documentation issue, and provide the following information as part of the issue:
A good title should be a short, one-sentence description of the issue, containing all relevant information and keywords to simplify the search in our issue tracker.
Example Clear Clarify resource templating setup Unclear Missing information in the docs Useless Help"},{"location":"community/reporting-a-docs-issue/#description","title":"Description","text":"
Provide a clear and concise summary of the inconsistency or issue you encountered in the documentation or the documentation section that needs improvement. Explain why you think the documentation should be adjusted and describe the severity of the issue:
Keep it short and concise \u2013 if the inconsistency or issue can be precisely explained in one or two sentences, perfect. Maintainers and future users will be grateful for having to read less.
One issue at a time \u2013 if you encounter several unrelated inconsistencies, please create separate issues for them.
Why we need this: describing the problem clearly and concisely is a prerequisite for improving our documentation \u2013 we need to understand what's wrong so we can fix it.
After you describe the documentation section that needs to be adjusted, share the link to this specific documentation section and other possibly related sections. Use anchor links (permanent links) where possible, as it simplifies discovery.
Why we need this: providing the links to the documentation helps us understand which sections of our documentation need to be adjusted, extended, or overhauled.
Now that you have provided us with the description and links to the documentation sections, you can help us, maintainers, and the community by proposing an improvement. You can sketch out rough ideas or write a concrete proposal. This field is optional but very helpful.
Why we need this: an improvement proposal can be beneficial for other users who encounter the same issue, as they offer solutions before we maintainers can update the documentation.
Thanks for following the guide and providing valuable feedback for our documentation \u2013 you are almost done. The checklist ensures that you have read this guide and have worked to your best knowledge to provide us with every piece of information we need to improve it.
We value every idea or contribution from our community. Please follow this guide before submitting your change request in our public issue tracker. This helps us better understand the proposed change and how it will benefit our community.
"},{"location":"community/requesting-a-change/#before-creating-an-issue","title":"Before Creating an Issue","text":"
Before you invest time in submitting a change request, answer these questions to determine if your idea is a good fit and matches the project's philosophy and tone.
"},{"location":"community/requesting-a-change/#its-not-a-bug-its-a-feature","title":"It's Not a Bug, It's a Feature","text":"
Change requests suggest minor adjustments, new features, or influence the project's direction. They are not intended for reporting bugs. Refer to our bug reporting guide for that.
"},{"location":"community/requesting-a-change/#look-for-sources-of-inspiration","title":"Look for Sources of Inspiration","text":"
If your idea is implemented in another tool or framework, collect information on its implementation. This helps us evaluate its fit more quickly.
"},{"location":"community/requesting-a-change/#connect-with-our-community","title":"Connect with Our Community","text":"
Our discussion board is the best place to connect with our community. Seeking input from other users helps implement features that benefit a larger number of users.
A good title is short and descriptive, summarizing the idea so the potential impact and benefit can be inferred.
Example Clear Support for resource templating Wordy Add support for templating resources for easier testing Unclear Improve templating Useless Help"},{"location":"community/requesting-a-change/#context","title":"Context optional","text":"
Provide additional context to help us understand what you are trying to achieve. Explain the circumstances and relevant settings without describing the change request itself.
Provide a detailed and clear description of your idea. Explain why your idea is relevant and should be implemented here, not in one of its dependencies.
Explain the what, not the why \u2013 focus on describing the change request precisely.
Keep it short and concise \u2013 be brief and to the point.
One idea at a time \u2013 if you have multiple ideas, open separate change requests for each.
Explain how your change request would work from an author's and user's perspective. What is the expected impact, and why does it benefit other users? Would it potentially break existing functionality?
If you have any visuals, such as sketches, screenshots, mockups, or external assets, present them in this section. If you have seen this change used in other tools, showcase and describe its implementation.
Thanks for following the guide and creating a high-quality change request. The checklist ensures that you have read this guide and provided all necessary information for us to review your idea.
Your change request got rejected? We're sorry for that. We understand it can be frustrating, but we always need to consider the needs of our entire community. If you're unsure why your change request was rejected, please ask for clarification.
We consider the following principles when evaluating change requests:
Alignment with the project's vision and tone
Compatibility with existing features and plugins
Compatibility with all screen sizes and browsers
Effort of implementation and maintenance
Usefulness to the majority of users
Simplicity and ease of use
Accessibility
If your idea was rejected, you can always implement it via [customization]. If you're unsure how or want to know if someone has already done it, get in touch with our community on the discussion board.
This page offers guidance and best practices for benchmarking the performance of the Kyverno Authz Server, helping users understand the associated overhead. It outlines an example setup for conducting benchmarks, various benchmarking scenarios, and key metrics to capture for assessing the impact of the Kyverno Authz Server.
The first component is a simple Go application that provides information of books in the library books collection and exposes APIs to get, create and delete books collection. Check this out for more information about the Go test application .
The second component is the Envoy proxy, which runs alongside the example application. The Envoy configuration defines an external authorization filter envoy.ext_authz for a gRPC authorization server.
The config uses Envoy's in-built gRPC client to make external gRPC calls.
The following scenarios should be tested to compare the performance of the Kyverno Authz Server under different conditions:
App Only: Requests are sent directly to the application, without Envoy or the Kyverno Authz Server.
App and Envoy: Envoy is included in the request path, but the Kyverno Authz Server is not (i.e., Envoy External Authorization API is disabled).
App, Envoy, and Kyverno: Envoy External Authorization API is enabled, and a sample real-world policy is loaded into the Kyverno Authz Server.
"},{"location":"performance/#load-testing-with-k6","title":"Load Testing with k6","text":"
To perform load testing, we'll use the k6 tool. Follow these steps:
Install k6: Install k6 on your machine by following the instructions on the official website.
Write the k6 script: Below is the example k6 script.
import http from 'k6/http';\nimport { check, group, sleep } from 'k6';\n\nexport const options = {\n stages: [\n { duration: '30s', target: 100 }, // Ramp-up to 100 virtual users over 30 seconds\n { duration: '1m', target: 100 }, // Stay at 100 virtual users for 1 minute\n { duration: '30s', target: 0 }, // Ramp-down to 0 virtual users over 30 seconds\n ],\n};\n\n/*\nReplace ip for every scenerio\nexport SERVICE_PORT=$(kubectl -n demo get service testapp -o jsonpath='{.spec.ports[?(@.port==8080)].nodePort}')\nexport SERVICE_HOST=$(minikube ip)\nexport SERVICE_URL=$SERVICE_HOST:$SERVICE_PORT\necho $SERVICE_URL\n\nhttp://192.168.49.2:31541\n\n*/\nconst BASE_URL = 'http://192.168.49.2:31541'; \n\nexport default function () {\n group('GET /book with guest token', () => {\n const res = http.get(`${BASE_URL}/book`, {\n headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjIyNDEwODE1MzksIm5iZiI6MTUxNDg1MTEzOSwicm9sZSI6Imd1ZXN0Iiwic3ViIjoiWVd4cFkyVT0ifQ.ja1bgvIt47393ba_WbSBm35NrUhdxM4mOVQN8iXz8lk' },\n });\n check(res, {\n 'is status 200': (r) => r.status === 200,\n });\n });\n\n sleep(1); // Sleep for 1 second between iterations\n}\n
Run the k6 test: Run the load test with the following command:
$ k6 run -f - <<EOF\nimport http from 'k6/http';\nimport { check, group, sleep } from 'k6';\n\nexport const options = {\n stages: [\n { duration: '30s', target: 100 }, // Ramp-up to 100 virtual users over 30 seconds\n { duration: '1m', target: 100 }, // Stay at 100 virtual users for 1 minute\n { duration: '30s', target: 0 }, // Ramp-down to 0 virtual users over 30 seconds\n ],\n};\n\n\nconst BASE_URL = 'http://192.168.49.2:31700'; // Replace with your application URL \n\nexport default function () {\n group('GET /book with guest token', () => {\n const res = http.get(`${BASE_URL}/book`, {\n headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjIyNDEwODE1MzksIm5iZiI6MTUxNDg1MTEzOSwicm9sZSI6Imd1ZXN0Iiwic3ViIjoiWVd4cFkyVT0ifQ.ja1bgvIt47393ba_WbSBm35NrUhdxM4mOVQN8iXz8lk' },\n });\n check(res, {\n 'is status 200': (r) => r.status === 200,\n });\n });\n\n sleep(1); // Sleep for 1 second between iterations\n}\nEOF\n
Analyze the results: Generate an json report with detailed insight by running:
k6 run --out json=report.json k6-script.js\n
5. Repeat for different scenarios:
App only
In this case , request are sent directly to the sample application ie no Envoy and Kyverno-plugin in the request path . For this run this command to apply the sample applicaition and then test with k6
In this case, the Kyverno Authz Server is not included in the path but Envoy is but Envoy External Authorization API disabled For this run this command to apply the sample application with envoy.
In this case, performance measurements are observed with Envoy External Authorization API enabled and a sample real-world policy loaded into the Kyverno Authz Server.
For this apply this command to apply sample-application, envoy and Kyverno Authz Server:
The following metrics should be measured to evaluate the performance impact of the Kyverno Authz Server:
End-to-end latency
The end-to-end latency represents the time taken for a request to complete, from the client sending the request to receiving the response. Based on the k6 results, the average end-to-end latency for the different scenarios is as follows:
App Only: avg=1.01ms (from group_duration or http_req_duration)
App and Envoy: avg=2.38ms (from http_req_duration)
App, Envoy, and Kyverno Authz Server: avg=46.37ms (from http_req_duration)
Kyverno evaluation latency
The Kyverno evaluation latency represents the time taken by the Kyverno Authz Server to evaluate the request against the configured policies. While the k6 results do not directly provide this metric, an estimate can be inferred by analyzing the differences in latency between the \"App and Envoy\" scenario and the \"App, Envoy, and Kyverno Authz Server\" scenario.
The difference in average latency between these two scenarios is: 46.37ms - 2.38ms = 43.99ms
This difference can be attributed to the Kyverno evaluation latency and the gRPC server handler latency combined. Assuming the gRPC server handler latency is relatively small compared to the Kyverno evaluation latency, the estimated range for the Kyverno evaluation latency is around 40ms to 45ms.
Resource utilization
Refers to CPU and memory usage of the Kyverno Authz Server container , kubectl top utility can be laveraged to measure the resource utilization.
Get the resource utilization of the Kyverno Authz Server container using the following command:
$ kubectl top pod -n demo --containers\n
To monitor resource utilization overtime use the following command:
$ watch -n 1 \"kubectl top pod -n demo --containers\"\n
Now run the k6 script in different terminal window and observe the resource utilization of the Kyverno Authz Server container.
Initial resource utilization of the Kyverno Authz Server container:
POD NAME CPU(cores) MEMORY(bytes)\ntestapp-5955cd6f8b-dbvgd envoy 4m 70Mi\ntestapp-5955cd6f8b-dbvgd server 1m 51Mi\ntestapp-5955cd6f8b-dbvgd test-application 1m 11Mi\n
Resource utilization of the Kyverno Authz Server container after 100 requests:
POD NAME CPU(cores) MEMORY(bytes)\ntestapp-5955cd6f8b-dbvgd envoy 110m 70Mi\ntestapp-5955cd6f8b-dbvgd server 895m 60Mi\ntestapp-5955cd6f8b-dbvgd test-application 17m 15Mi\n
Observations:
The CPU utilization of the Kyverno Authz Server container increased significantly from 1m to 895m after receiving 100 requests during the load test.
The memory utilization also increased, but to a lesser extent, from 51Mi to 60Mi.
Resource utilization of the Kyverno Authz Server container after load completion:
POD NAME CPU(cores) MEMORY(bytes)\ntestapp-5955cd6f8b-dbvgd envoy 4m 70Mi\ntestapp-5955cd6f8b-dbvgd server 1m 51Mi\ntestapp-5955cd6f8b-dbvgd test-application 1m 11Mi\n
Observations:
After the load test completed and the request volume returned to normal levels, the CPU and memory utilization of the Kyverno Authz Server container returned to their initial values. This indicates that the Kyverno Authz Server can efficiently handle the increased load during the test and release the additional resources when the load subsides.
Correlation with k6 results:
The k6 script simulated a load test scenario with 100 virtual users, ramping up over 30 seconds, staying at 100 users for 1 minute, and then ramping down over 30 seconds.
During the load test, when the request volume was at its peak (100 virtual users), the Kyverno Authz Server container experienced a significant increase in CPU utilization, reaching 895m.
This CPU utilization spike aligns with the increased processing demand on the Kyverno Authz Server to evaluate the incoming requests against the configured Kyverno policies.
The memory utilization increase during the load test was relatively modest, suggesting that the policy evaluation did not significantly impact the memory requirements of the Kyverno Authz Server.
A Kyverno AuthorizationPolicy is a custom Kubernetes resources and can be easily managed via Kubernetes APIs, GitOps workflows, and other existing tools.
A Kyverno AuthorizationPolicy is a cluster-wide resource.
"},{"location":"policies/#api-group-and-kind","title":"API Group and Kind","text":"
An AuthorizationPolicy belongs to the envoy.kyverno.io/v1alpha1 group and can only be of kind AuthorizationPolicy.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n # if something fails the request will be denied\n failurePolicy: Fail\n variables:\n # `force_authorized` references the 'x-force-authorized' header\n # from the envoy check request (or '' if not present)\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n # `allowed` will be `true` if `variables.force_authorized` has the\n # value 'enabled' or 'true'\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n deny:\n # make an authorisation decision based on the value of `variables.allowed`\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n allow:\n - response: >\n envoy.Allowed().Response()\n
An AuthorizationPolicy main concern is to define authorization rules to deny or allow requests.
Every authorization rule is made of an optional match statement and a required response statement. Both statements are written in CEL.
If the match statement is present and evaluates to true, the response statement is used to create the response payload returned to the envoy proxy. Depending on the rule type, the response is expected to be an envoy.OkResponse or envoy.DeniedResponse.
Creating an OkResponse or DeniedResponse can be a tedious task, you need to remember the different types names and format.
The CEL engine used to evaluate the authorization rules has been extended with a library to make the creation of responses easier. Browse the available libraries documentation for details.
The policy below will allow requests if they contain the header x-force-authorized with the value enabled or true. If the header is not present or has a different value, the request will be denied.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n failurePolicy: Fail\n variables:\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n # make an authorisation decision based on the value of `variables.allowed`\n # - deny the request with 403 status code if it is `false`\n # - else allow the request\n deny:\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n allow:\n - response: >\n envoy.Allowed().Response()\n
In this simple rule:
envoy.Allowed().Response()
Creates an OkResponse to allow the request
envoy.Denied(403).Response()
Creates a DeniedResponse to deny the request with status code 403
However, we can do a lot more. Envoy can add or remove headers, query parameters, register dynamic metadata passed along the filters chain, and even change the response body.
"},{"location":"policies/authorization-rules/#the-hard-way","title":"The hard way","text":"
Below is the same policy, creating the envoy.OkResponse and envoy.DeniedResponse manually.
To add dynamic metadata in the envoy filter chain (this is useful when you want to pass data to another filter in the chain or you want to print it in the application logs)
Info
The full documentation of the CEL Envoy library is available here.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n # if something fails the failure will be ignored and the request will be allowed\n failurePolicy: Ignore\n variables:\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n deny:\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n
A Kyverno AuthorizationPolicy can define variables that will be made available to all authorization rules.
Variables can be used in composition of other expressions. Each variable is defined as a named CEL expression. The will be available under variables in other expressions of the policy.
The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
Info
The incoming CheckRequest from Envoy is made available to the policy under the object identifier.
apiVersion: envoy.kyverno.io/v1alpha1\nkind: AuthorizationPolicy\nmetadata:\n name: demo\nspec:\n failurePolicy: Fail\n variables:\n # `force_authorized` references the 'x-force-authorized' header\n # from the envoy check request (or '' if not present)\n - name: force_authorized\n expression: object.attributes.request.http.headers[?\"x-force-authorized\"].orValue(\"\")\n # `allowed` will be `true` if `variables.force_authorized` has the\n # value 'enabled' or 'true'\n - name: allowed\n expression: variables.force_authorized in [\"enabled\", \"true\"]\n deny:\n # make an authorisation decision based on the value of `variables.allowed`\n - match: >\n !variables.allowed\n response: >\n envoy.Denied(403).Response()\n
The Kyverno Envoy Plugin is a powerful tool that integrates with the Envoy proxy.
It allows you to enforce Kyverno policies on incoming and outgoing traffic in a service mesh environment, providing an additional layer of security and control over your applications.
Envoy is a Layer 7 proxy and communication bus tailored for large-scale, modern service-oriented architectures. Starting from version 1.7.0, Envoy includes an External Authorization filter that interfaces with an authorization service to determine the legitimacy of incoming requests.
This functionality allows authorization decisions to be offloaded to an external service, which can access the request context. The request context includes details such as the origin and destination of the network activity, as well as specifics of the network request (e.g., HTTP request). This information enables the external service to make a well-informed decision regarding the authorization of the incoming request processed by Envoy.
"},{"location":"quick-start/#what-is-the-kyverno-envoy-plugin","title":"What is the Kyverno Envoy Plugin?","text":"
The Kyverno Envoy Plugin is gRPC server that implements Envoy External Authorization API.
This allows you to enforce Kyverno policies on incoming and outgoing traffic in a service mesh environment, providing an additional layer of security and control over your applications. You can use this version of Kyverno to enforce fine-grained, context-aware access control policies with Envoy without modifying your microservice.
"},{"location":"quick-start/#how-does-this-work","title":"How does this work?","text":"
In addition to the Envoy sidecar, your application pods will include a Kyverno Authz Server component, either as a sidecar or as a separate pod. When Envoy receives an API request intended for your microservice, it consults the Kyverno Authz Server to determine whether the request should be permitted or not.
Performing policy evaluations locally with Envoy is advantageous, as it eliminates the need for an additional network hop for authorization checks, thus enhancing both performance and availability.
Info
The Kyverno Envoy Plugin is frequently deployed in Kubernetes environments as a sidecar container or as a separate pod. Additionally, it can be used in other environments as a standalone process running alongside Envoy.
In this quick start guide we will deploy the Kyverno Authz Server inside a cluster.
Then you will interface Istio, an open source service mesh with the Kyverno Authz Server to delegate the request authorisation based on policies installed in the cluster.
"},{"location":"quick-start/authz-server/#deploy-the-kyverno-authz-server","title":"Deploy the Kyverno Authz Server","text":"
The first step is to deploy the Kyverno Authz Server.
# create the kyverno namespace\nkubectl create ns kyverno\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace kyverno istio-injection=enabled\n\n# deploy the kyverno authz server\nhelm install kyverno-authz-server --namespace kyverno --wait \\\n --repo https://kyverno.github.io/kyverno-envoy-plugin \\\n kyverno-authz-server\n
"},{"location":"quick-start/authz-server/#deploy-a-sample-application","title":"Deploy a sample application","text":"
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace\nkubectl create ns demo\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace demo istio-injection=enabled\n\n# deploy the httpbin application\nkubectl apply -n demo -f \\\n https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml\n
"},{"location":"quick-start/authz-server/#deploy-an-istio-authorizationpolicy","title":"Deploy an Istio AuthorizationPolicy","text":"
An AuthorizationPolicy is the custom Istio resource that defines the services that will be protected by the Kyverno Authz Server.
# deploy istio authorization policy\nkubectl apply -f - <<EOF\napiVersion: security.istio.io/v1\nkind: AuthorizationPolicy\nmetadata:\n name: kyverno-authz-server\n namespace: demo\nspec:\n action: CUSTOM\n provider:\n name: kyverno-authz-server.local\n rules:\n - {} # empty rules, it will apply to all requests\nEOF\n
Notice that in this resource, we define the Kyverno Authz Server extensionProvider you set in the Istio configuration:
AuthorizationPolicy defines an authorization policy resource
Field Type Required Inline Description apiVersionstringenvoy.kyverno.io/v1alpha1kindstringAuthorizationPolicymetadatameta/v1.ObjectMeta No description provided. specAuthorizationPolicySpec No description provided."},{"location":"reference/apis/policy.v1alpha1/#envoy-kyverno-io-v1alpha1-Authorization","title":"Authorization","text":"
Appears in:
AuthorizationPolicySpec
Authorization defines an authorization policy rule
Field Type Required Inline Description matchstring
Match represents the match condition which will be evaluated by CEL. Must evaluate to bool.
responsestring
Response represents the response expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec CEL expressions have access to CEL variables as well as some other useful variables: - 'object' - The object from the incoming request. (https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto#service-auth-v3-checkrequest) CEL expressions are expected to return an envoy CheckResponse (https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto#service-auth-v3-checkresponse).
AuthorizationPolicySpec defines the spec of an authorization policy
Field Type Required Inline Description failurePolicyadmissionregistration/v1.FailurePolicyType
FailurePolicy defines how to handle failures for the policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions. FailurePolicy does not define how validations that evaluate to false are handled. Allowed values are Ignore or Fail. Defaults to Fail.
MatchConditions is a list of conditions that must be met for a request to be validated. An empty list of matchConditions matches all requests. The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the policy is skipped. 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the policy is skipped
variables[]admissionregistration/v1.Variable
Variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under variables in other expressions of the policy except MatchConditions because MatchConditions are evaluated before the rest of the policy. The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, Variables must be sorted by the order of first appearance and acyclic.
deny[]Authorization
Deny contain CEL expressions which is used to deny a request.
allow[]Authorization
Allow contain CEL expressions which is used to allow a request.
If you didn't read the Quick start section yet, we really recommend giving it a try to discover and familiarise with the Kyverno Envoy Plugin components first.
Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway. Gateway API resources are used to dynamically provision and configure the managed Envoy Proxies.
This tutorial shows how Envoy Gateway can be configured to delegate authorization decisions to the Kyverno Authz Server.
"},{"location":"tutorials/envoy-gateway/#deploy-a-sample-application","title":"Deploy a sample application","text":"
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace\nkubectl create ns demo\n\n# deploy the httpbin application\nkubectl apply \\\n -n demo \\\n -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml\n
"},{"location":"tutorials/envoy-gateway/#create-a-gatewayclass-and-a-gateway","title":"Create a GatewayClass and a Gateway","text":"
With Envoy Gateway installed we can now create a Gateway. To do so we will also create a dedicated GatewayClass.
Depending on your setup you will potentially need to create an EnvoyProxy resource to customize the way Envoy Gateway will create the underlying Service. The script below creates one to set the name and type of the service because the kind cluster created in the first step doesn't come with load balancer support.
# create a gateway\nkubectl apply -n demo -f - <<EOF\napiVersion: gateway.envoyproxy.io/v1alpha1\nkind: EnvoyProxy\nmetadata:\n name: demo\nspec:\n provider:\n type: Kubernetes\n kubernetes:\n envoyService:\n name: internet # use a known name for the created service\n type: ClusterIP # because a kind cluster has no support for LB\n---\napiVersion: gateway.networking.k8s.io/v1\nkind: GatewayClass\nmetadata:\n name: demo\nspec:\n controllerName: gateway.envoyproxy.io/gatewayclass-controller\n---\napiVersion: gateway.networking.k8s.io/v1\nkind: Gateway\nmetadata:\n name: demo\nspec:\n gatewayClassName: demo\n infrastructure:\n parametersRef:\n group: gateway.envoyproxy.io\n kind: EnvoyProxy\n name: demo\n listeners:\n - name: http\n protocol: HTTP\n port: 80\nEOF\n
"},{"location":"tutorials/envoy-gateway/#create-an-httproute-to-the-sample-application","title":"Create an HTTPRoute to the sample application","text":"
Next, we need to link the Gateway to our sample applicate with an HTTPRoute.
"},{"location":"tutorials/envoy-gateway/#deploy-an-envoy-gateway-securitypolicy","title":"Deploy an Envoy Gateway SecurityPolicy","text":"
A SecurityPolicy is the custom Envoy Gateway resource to configure underlying Envoy Proxy to use an external auth server (the Kyverno Authz Server we installed in a prior step).
"},{"location":"tutorials/envoy-gateway/#grant-access-to-the-kyverno-authz-server-service","title":"Grant access to the Kyverno Authz Server service","text":"
Last thing we need to configure is to grant access to the Kyverno Authz Server service for our SecurityPolicy to take effect.
Istio is an open source service mesh for managing the different microservices that make up a cloud-native application. Istio provides a mechanism to use a service as an external authorizer with the AuthorizationPolicy API.
This tutorial shows how Istio\u2019s AuthorizationPolicy can be configured to delegate authorization decisions to the Kyverno Authz Server.
"},{"location":"tutorials/istio/#deploy-the-kyverno-authz-server","title":"Deploy the Kyverno Authz Server","text":"
Now we can deploy the Kyverno Authz Server.
# create the kyverno namespace\nkubectl create ns kyverno\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace kyverno istio-injection=enabled\n\n# deploy the kyverno authz server\nhelm install kyverno-authz-server \\\n --namespace kyverno \\\n --wait \\\n --repo https://kyverno.github.io/kyverno-envoy-plugin kyverno-authz-server \\\n --set certificates.certManager.issuerRef.group=cert-manager.io \\\n --set certificates.certManager.issuerRef.kind=ClusterIssuer \\\n --set certificates.certManager.issuerRef.name=selfsigned-issuer\n
"},{"location":"tutorials/istio/#deploy-a-sample-application","title":"Deploy a sample application","text":"
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace\nkubectl create ns demo\n\n# label the namespace to inject the envoy proxy\nkubectl label namespace demo istio-injection=enabled\n\n# deploy the httpbin application\nkubectl apply \\\n -n demo \\\n -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml\n
"},{"location":"tutorials/istio/#deploy-an-istio-authorizationpolicy","title":"Deploy an Istio AuthorizationPolicy","text":"
An AuthorizationPolicy is the custom Istio resource that defines the services that will be protected by the Kyverno Authz Server.
# deploy istio authorization policy\nkubectl apply -f - <<EOF\napiVersion: security.istio.io/v1\nkind: AuthorizationPolicy\nmetadata:\n name: kyverno-authz-server\n namespace: demo\nspec:\n action: CUSTOM\n provider:\n name: kyverno-authz-server.local\n rules:\n - {} # empty rules, it will apply to all requests\nEOF\n
Notice that in this resource, we define the Kyverno Authz Server extensionProvider you set in the Istio configuration:
Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway. Gateway API resources are used to dynamically provision and configure the managed Envoy Proxies.
This tutorial shows how Envoy Gateway can be configured to delegate authorization decisions to the Kyverno Authz Server.
Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway. Gateway API resources are used to dynamically provision and configure the managed Envoy Proxies.
This tutorial shows how Envoy Gateway can be configured to delegate authorization decisions to the Kyverno Authz Server.
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace
kubectlcreatensdemo
# deploy the httpbin application
-kubectlapply-ndemo-fhttps://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
+kubectlapply\
+-ndemo\
+-fhttps://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
With Envoy Gateway installed we can now create a Gateway. To do so we will also create a dedicated GatewayClass.
Depending on your setup you will potentially need to create an EnvoyProxy resource to customize the way Envoy Gateway will create the underlying Service. The script below creates one to set the name and type of the service because the kind cluster created in the first step doesn't come with load balancer support.
Istio is an open source service mesh for managing the different microservices that make up a cloud-native application. Istio provides a mechanism to use a service as an external authorizer with the AuthorizationPolicy API.
This tutorial shows how Istio’s AuthorizationPolicy can be configured to delegate authorization decisions to the Kyverno Authz Server.
Istio is an open source service mesh for managing the different microservices that make up a cloud-native application. Istio provides a mechanism to use a service as an external authorizer with the AuthorizationPolicy API.
This tutorial shows how Istio’s AuthorizationPolicy can be configured to delegate authorization decisions to the Kyverno Authz Server.
# create the kyverno namespace
kubectlcreatenskyverno
# label the namespace to inject the envoy proxy
kubectllabelnamespacekyvernoistio-injection=enabled
# deploy the kyverno authz server
-helminstallkyverno-authz-server--namespacekyverno--wait--repohttps://kyverno.github.io/kyverno-envoy-pluginkyverno-authz-server
+helminstallkyverno-authz-server\
+--namespacekyverno\
+--wait\
+--repohttps://kyverno.github.io/kyverno-envoy-pluginkyverno-authz-server\
+--setcertificates.certManager.issuerRef.group=cert-manager.io\
+--setcertificates.certManager.issuerRef.kind=ClusterIssuer\
+--setcertificates.certManager.issuerRef.name=selfsigned-issuer
Httpbin is a well-known application that can be used to test HTTP requests and helps to show quickly how we can play with the request and response attributes.
# create the demo namespace
kubectlcreatensdemo
@@ -37,7 +59,9 @@
kubectllabelnamespacedemoistio-injection=enabled
# deploy the httpbin application
-kubectlapply-fhttps://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml-ndemo
+kubectlapply\
+-ndemo\
+-fhttps://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml