cwielenb/CNCF-Dataset huggingface dataset:
Project: secureCodeBox (Provisioning / Security & Compliance)
File: integration-tests.md

title: Integration Tests sidebar_position: 10 After you have finished the implementation, it's very much recommended to add some End-2-End Integration Tests for your scanner to check if everything is running smoothly together. In most cases, the simplest and most effective way to test your scanner is by running it against a `demo-target`. You can also re-use one of the examples you provided. Let's have a look at the test to understand all the steps required: ```javascript test( "ssh-scan should find a couple of findings for a dummy ssh service", async () => { const { categories, severities, count } = await scan( "ssh-scan-dummy-ssh", // Name of test "ssh-scan", // Name of scan command ["-t", "dummy-ssh.demo-targets.svc"], // Parameters 90 ); expect(count).toBe(4); expect(categories).toMatchInlineSnapshot(` Object { "SSH Policy Violation": 3, "SSH Service": 1, } `); expect(severities).toMatchInlineSnapshot(` Object { "informational": 1, "medium": 3, } `); }, 3 60 1000 ); ``` At first, we start our scan function, and we feed it with a scan name, the specific scan command and a list of parameters for the scan. Likely, you can copy them from an example. Note that you must refer to your targeted demo-target via `name.demp-apps.svc` if it is installed in the "demo-targets" namespace. Please don't use any external websites (like google.com) in your integration tests! The last parameter is a test timeout in seconds. This timeout should be lower than the general one for the jest test to provide us with better information in case that the test fails. Upon finishing successfully, the scan will give us back categories, severities and a number of findings (count). We can then use them to create our test assertions. If you use snapshots, you don't need to copy your findings manually, you can rather automatically update them via `npx jest --update-snapshot` (see below). The last parameter would be the test timeout for jest in milliseconds, make sure it is high enough and higher than the timeout provided above. Before pushing them to the repository, make sure your tests run successfully in your local cluster. You may use the to run your integration tests locally. If your tests are successful, you can eventually integrate them in the . Here you have to go through the same steps as above to install all the resources in the cluster. Please make sure to stick to the conventions already used in the yaml file and please do not install any resources for your tests that have already been installed or are not used in the tests. Thank you for helping us to provide high quality open source code! :)
Project: ArangoDB (App Definition and Development / Database)
File: co_try.md

+++ title = "`BOOSTOUTCOMECO_TRY(var, expr)`" description = "Evaluate within a coroutine an expression which results in an understood type, assigning `T` to a decl called `var` if successful, immediately returning `tryoperationreturn_as(X)` from the calling function if unsuccessful." +++ Evaluate within a coroutine an expression which results in a type matching the following customisation points, assigning `T` to a decl called `var` if successful, immediately returning {{% api "tryoperationreturn_as(X)" %}} from the calling function if unsuccessful: `BOOSTOUTCOMEV2NAMESPACE::`{{% api "tryoperationhasvalue(X)" %}} `BOOSTOUTCOMEV2NAMESPACE::`{{% api "tryoperationreturnas(X)" %}} `BOOSTOUTCOMEV2NAMESPACE::`{{% api "tryoperationextractvalue(X)" %}} Default overloads for these customisation points are provided. See . Hints are given to the compiler that the expression will be successful. If you expect failure, you should use {{% api "BOOSTOUTCOMECOTRYFAILURE_LIKELY(var, expr)" %}} instead. An internal temporary to hold the value of the expression is created, which generally invokes a copy/move. Overridable: Not overridable. Definition: See {{% api "BOOSTOUTCOMECO_TRYV(expr)" %}} for most of the mechanics. If successful, `var` is initialised or assigned to the expression result's `.assume_value()` if available, else to its `.value()`. This binds a reference possibly to the `T` stored inside the bound result of the expression, but possibly also to a temporary emitted from the value observer function. Header: `<boost/outcome/try.hpp>` Legacy: Before Outcome v2.2, `var` was always declared as an automatic rvalue ref. You can use the backwards compatibility macro `OUTCOME21COTRY()` if wish to retain the old behaviour.
Project: Podman (App Definition and Development / Application Definition & Image Build)
File: rootfs.md

If specified, the first argument refers to an exploded container on the file system. This is useful to run a container without requiring any image management, the rootfs of the container is assumed to be managed externally. `Overlay Rootfs Mounts` The `:O` flag tells Podman to mount the directory from the rootfs path as storage using the `overlay file system`. The container processes can modify content within the mount point which is stored in the container storage in a separate directory. In overlay terms, the source directory is the lower, and the container storage directory is the upper. Modifications to the mount point are destroyed when the container finishes executing, similar to a tmpfs mount point being unmounted. Note: On SELinux systems, the rootfs needs the correct label, which is by default unconfined_u:object_r:container_file_t:s0. `idmap` If `idmap` is specified, create an idmapped mount to the target user namespace in the container. The idmap option supports a custom mapping that can be different than the user namespace used by the container. The mapping can be specified after the idmap option like: `idmap=uids=0-1-10#10-11-10;gids=0-100-10`. For each triplet, the first value is the start of the backing file system IDs that are mapped to the second value on the host. The length of this mapping is given in the third value. Multiple ranges are separated with #.
Project: Lagoon (App Definition and Development / Application Definition & Image Build)
File: rabbitmq.md

The with management plugin installed. Based on the official `rabbitmq:3-management` image at . This Dockerfile is intended to be used to set up a standalone RabbitMQ queue broker, as well as a base image to set up a cluster with high availability queue support by default \(\). By default, the RabbitMQ broker is started as single node. If you want to start a cluster, you need to use the Docker image, based on `rabbitmq` image plus the `rabbitmqpeerdiscovery_k8s` plugin. 3.10 (Security Support until July 2023) - `uselagoon/rabbitmq` This image is prepared to be used on Lagoon. There are therefore some things already done: Folder permissions are automatically adapted with , so this image will work with a random user. The file `/etc/rabbitmq/definitions.json` is parsed through with a container-entrypoint. To enable the support for Mirrored Queues, at least one must exist. In the `definitions.json` schema file, minimal entities are defined to make the container run: `virtualhost` \(`vhost`\), `username` , and `password` to access management UI, `permissions` , and `policies`. By default, a policy called `lagoon-ha` is created at startup, but it is not active because it doesn't match any queue's name pattern \(see default \). ```javascript title="definitions.json" "policies":[ {"vhost":"${RABBITMQDEFAULTVHOST}","name":"lagoon-ha","pattern":"${RABBITMQDEFAULTHA_PATTERN}", "definition":{"ha-mode":"exactly","ha-params":2,"ha-sync-mode":"automatic","ha-sync-batch-size":5}} ] ``` By default, the `ha-mode` is set to `exactly` which controls the exact number of mirroring nodes for a queue \(mirrors\). The number of nodes is controller by `ha-params`. For further information and custom configuration, please refer to . Some options are configurable via [environment variables](../concepts-advanced/environment-variables.md). | Environment Variable | Default | Description | | :-- | : | :-- | | RABBITMQDEFAULTUSER | guest | Username for management UI access. | | RABBITMQDEFAULTPASS | guest | Password for management UI access. | | RABBITMQDEFAULTVHOST | / | RabbitMQ main virtualhost. | | RABBITMQDEFAULTHA_PATTERN | ^$ | Regular expression to match for mirrored queues. |
Project: KICS (Provisioning / Security & Compliance)
File: 0d0c12b9-edce-4510-9065-13f6a758750c.md

title: Redis Entirely Accessible hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 0d0c12b9-edce-4510-9065-13f6a758750c Query name: Redis Entirely Accessible Platform: Ansible Severity: <span style="color:#ff0000">Critical</span> Category: Networking and Firewall URL: Firewall rule allowing unrestricted access to Redis from the Internet<br> ```yaml title="Positive test num. 1 - yaml file" hl_lines="7" name: Create a Firewall rule for Azure Cache for Redis azurermrediscachefirewallrule: resource_group: myResourceGroup cache_name: myRedisCache name: myRule startipaddress: 0.0.0.0 endipaddress: 0.0.0.0 ``` ```yaml title="Negative test num. 1 - yaml file" name: Create a Firewall rule for Azure Cache for Redis azurermrediscachefirewallrule: resource_group: myResourceGroup cache_name: myRedisCache name: myRule startipaddress: 192.168.1.1 endipaddress: 192.168.1.4 ```
Project: YugabyteDB (App Definition and Development / Database)
File: yba_task.md

Manage YugabyteDB Anywhere tasks Manage YugabyteDB Anywhere tasks ``` yba task [flags] ``` ``` -h, --help help for task ``` ``` -a, --apiToken string YugabyteDB Anywhere api token. --config string Config file, defaults to $HOME/.yba-cli.yaml --debug Use debug mode, same as --logLevel debug. --disable-color Disable colors in output. (default false) -H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000") -l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info") -o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table") --timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) --wait Wait until the task is completed, otherwise it will exit immediately. (default true) ``` - yba - Command line tools to manage your YugabyteDB Anywhere (Self-managed Database-as-a-Service) resources. - List YugabyteDB Anywhere tasks - Retry a YugabyteDB Anywhere task
Project: StarRocks (App Definition and Development / Database)
File: hours_diff.md

displayed_sidebar: "English" Returns the hour difference between two date expressions (`expr1` `expr2`), accurate to the hour. ```Haskell BIGINT hours_diff(DATETIME expr1, DATETIME expr2); ``` `expr1`: the end time. It must be of the DATETIME type. `expr2`: the start time. It must be of the DATETIME type. Returns a BIGINT value. NULL is returned if the date does not exist, for example, 2022-02-29. ```Plain select hours_diff('2010-11-30 23:59:59', '2010-11-30 20:58:59'); +-+ | hours_diff('2010-11-30 23:59:59', '2010-11-30 20:58:59') | +-+ | 3 | +-+ ```
Project: Kui (App Definition and Development / Application Definition & Image Build)
File: DISCUSSION.md

name: Discussion about: Create a discussion topic. <!-- Hello Thank you for submitting a discussion topic. To make your topic readable make sure you use valid Markdown syntax. https://guides.github.com/features/mastering-markdown/ --> Describe the topic A clear and concise description of what the topic is. Your suggestions for this topic Clear and simple suggestions for how you think this should be handled. Screenshots If applicable, add screenshots to help explain your points. Code snippets If applicable, add code samples to help explain your points.
Project: YugabyteDB (App Definition and Development / Database)
File: postgresql.md

<!-- +++ private=true +++ --> Create a database user and provide the user with READ access to all the resources which need to be migrated. Run the following commands in a `psql` session: Create a new user named `ybvoyager`. ```sql CREATE USER ybvoyager PASSWORD 'password'; ``` Switch to the database that you want to migrate. ```sql \c <database_name> ``` Grant the `USAGE` permission to the `ybvoyager` user on all schemas of the database. ```sql SELECT 'GRANT USAGE ON SCHEMA ' || schemaname || ' TO ybvoyager;' FROM informationschema.schemata; \gexec ``` The above `SELECT` statement generates a list of `GRANT USAGE` statements which are then executed by `psql` because of the `\gexec` switch. The `\gexec` switch works for PostgreSQL v9.6 and later. For older versions, you'll have to manually execute the `GRANT USAGE ON SCHEMA schema_name TO ybvoyager` statement, for each schema in the source PostgreSQL database. Grant `SELECT` permission on all the tables and sequences. ```sql SELECT 'GRANT SELECT ON ALL TABLES IN SCHEMA ' || schemaname || ' TO ybvoyager;' FROM informationschema.schemata; \gexec SELECT 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA ' || schemaname || ' TO ybvoyager;' FROM informationschema.schemata; \gexec ``` The `ybvoyager` user can now be used for migration. If you want yb-voyager to connect to the source database over SSL, refer to .
Project: Sonobuoy (Provisioning / Security & Compliance)
File: CONTRIBUTING.md

All authors to the project retain copyright to their work. However, to ensure that they are only submitting work that they have rights to, we are requiring everyone to acknowledge this by signing their work. Any copyright notices in this repo should specify the authors as "the Sonobuoy project contributors". To sign your work, just add a line like this at the end of your commit message: ``` Signed-off-by: Joe Beda <joe@heptio.com> ``` This can easily be done with the `--signoff` option to `git commit`. By doing this you state that you can certify the following (from https://developercertificate.org/): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```
Project: Glasskube (App Definition and Development / Application Definition & Image Build)
File: PULL_REQUEST_TEMPLATE.md

<!-- Thanks for creating this pull request Please make sure you followed the conventional commit --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes # <!-- Issue # here --> <!-- Add a brief description of the pr --> [ ] My code requires changes to the documentation [ ] I have updated the documentation as required <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behavior, etc. -->
Project: Meshery (Provisioning / Automation & Configuration)
File: v0.6.64.md

layout: release date: 2023-03-14 tag: v0.6.64 Generate new components and dump csv @Revolyssup (#7349) Add trim flag for /api/meshmodel/model/<modelname> @Revolyssup (#7344) feat: suggestions for miss spelled sub commands @gurpreet-legend (#7308) [MeshModels] add green svgs with label style @Abhishek-kumar09 (#7348) Publish to meshery catalog action prevented for users signed in using local provider @krishna9304 (#7142) Update meshery-ui doc contribution flow @senali-d (#7343) [Docs] Fix table of contents not auto generated and add auto-scrolling @chinu-anand (#7307) publish Meshery Connections and thier Actions table in docs ( /architecture ) @vishalvivekm (#7317) Thank you to our contributors for making this release possible: @Abhishek-kumar09, @Revolyssup, @chinu-anand, @gurpreet-legend, @krishna9304, @leecalcote, @senali-d, @vishalvivekm and l5io
Project: KICS (Provisioning / Security & Compliance)
File: 6d23d87e-1c5b-4308-b224-92624300f29b.md

title: User With Privilege Escalation By Actions 'iam:AttachGroupPolicy' hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 6d23d87e-1c5b-4308-b224-92624300f29b Query name: User With Privilege Escalation By Actions 'iam:AttachGroupPolicy' Platform: Terraform Severity: <span style="color:#ff7213">Medium</span> Category: Access Control URL: User with privilege escalation by actions 'iam:AttachGroupPolicy' and Resource set to '*'. For more information see https://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation/.<br> ```tf title="Positive test num. 1 - tf file" hl_lines="1" resource "awsiamuser" "cosmic" { name = "cosmic" } resource "awsiamuserpolicy" "testinline_policy" { name = "testinlinepolicy" user = awsiamuser.cosmic.name policy = jsonencode({ Version = "2012-10-17" Statement = [ { Action = [ "iam:AttachGroupPolicy", ] Effect = "Allow" Resource = "*" }, ] }) } resource "awsiampolicy_attachment" "test-attach" { name = "test-attachment" users = [awsiamuser.cosmic.name] roles = [awsiamrole.role.name] groups = [awsiamgroup.group.name] } ``` ```tf title="Negative test num. 1 - tf file" resource "awsiamuser" "cosmic2" { name = "cosmic2" } resource "awsiamuserpolicy" "inlinepolicyruninstances2" { name = "inlinepolicyrun_instances" user = awsiamuser.cosmic2.name policy = jsonencode({ Version = "2012-10-17" Statement = [ { Action = [ "ec2:Describe*", ] Effect = "Allow" Resource = "*" }, ] }) } ```
Project: StarRocks (App Definition and Development / Database)
File: if.md

displayed_sidebar: "English" If `expr1` evaluates to TRUE, returns `expr2`. Otherwise, returns `expr3`. ```Haskell if(expr1,expr2,expr3); ``` `expr1`: the condition. It must be a BOOLEAN value. `expr2` and `expr3` must be compatible in data type. The return value has the same type as `expr2`. ```Plain Text mysql> select if(true,1,2); +-+ | if(TRUE, 1, 2) | +-+ | 1 | +-+ mysql> select if(false,2.14,2); +--+ | if(FALSE, 2.14, 2) | +--+ | 2.00 | +--+ ```
Project: StarRocks (App Definition and Development / Database)
File: regexp_extract_all.md

displayed_sidebar: "English" Extracts all substrings from the target string (`str`) that matches a regular expression pattern (`pattern`) and corresponds to the regex group index specified by `pos`. This function returns an array. In regex, groups are enclosed within the parentheses () and numbered by counting their opening parentheses from left to right, starting from 1. For example, `([[:lower:]]+)C([[:lower:]]+)` is to match lowercase letters to the left or right side of the uppercase letter `C`. This pattern contains two groups: `([[:lower:]]+)` to the left of `C` is the first group and `([[:lower:]]+)` to the right of `C` is the second group. The pattern must completely match some parts of `str`. If no matches are found, an empty string is returned. This function is supported from v2.5.19. ```Haskell ARRAY<VARCHAR> regexpextractall(VARCHAR str, VARCHAR pattern, BIGINT pos) ``` `str`: the string to be matched. `pattern`: the regular expression pattern used to match substrings. `pos`: `pattern` may contain multiple groups. `pos` indicates which regex group to extract. Returns an ARRAY that consists of VARCHAR elements. ```Plain Text -- Return all the letters that match group 1 in the pattern. MySQL > SELECT regexpextractall('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 1); +-+ | regexpextractall('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 1) | +-+ | ['b'] | +-+ -- Return all the letters that match group 2 in the pattern. MySQL > SELECT regexpextractall('AbCdExCeF', '([[:lower:]]+)C([[:lower:]]+)', 2); ++ | regexpextractall('AbCdExCeF', '([[:lower:]]+)C([[:lower:]]+)', 2) | ++ | ['d','e'] | ++ ``` REGEXPEXTRACTALL,REGEXP,EXTRACT
Project: Meshery (Provisioning / Automation & Configuration)
File: schemahero.md

layout: integration title: Schemahero subtitle: Collaborative and visual infrastructure as code for Schemahero image: /assets/img/integrations/schemahero/icons/color/schemahero-color.svg permalink: extensibility/integrations/schemahero docURL: https://docs.meshery.io/extensibility/integrations/schemahero description: integrations-category: App Definition and Development integrations-subcategory: Database registrant: Artifact Hub components: featureList: [ "Drag-n-drop cloud native infrastructure designer to configure, model, and deploy your workloads.", "Invite anyone to review and make changes to your private designs.", "Ongoing synchronization of Kubernetes configuration and changes across any number of clusters." ] howItWorks: "Collaborative Infrastructure as Code" howItWorksDetails: "Collaboratively manage infrastructure with your coworkers synchronously sharing the same designs." language: en list: include type: extensibility category: integrations
Project: YugabyteDB (App Definition and Development / Database)
File: ttl-data-expiration-ysql.md

title: TTL for data expiration in YSQL headerTitle: TTL for data expiration linkTitle: 9. TTL for data expiration description: Learn how to use TTL for data expiration in YSQL. menu: v2.18: identifier: ttl-data-expiration-ysql parent: learn weight: 581 type: docs <ul class="nav nav-tabs-alt nav-tabs-yb"> <li > <a href="../ttl-data-expiration-ysql/" class="nav-link active"> <i class="icon-postgres" aria-hidden="true"></i> YSQL </a> </li> <li > <a href="../ttl-data-expiration-ycql/" class="nav-link"> <i class="icon-cassandra" aria-hidden="true"></i> YCQL </a> </li> </ul> YSQL content is pending.