|
| 1 | +--- |
| 2 | +sidebar_label: "Find insecure Security.setProperty calls" |
| 3 | +--- |
| 4 | + |
| 5 | +import Tabs from '@theme/Tabs'; |
| 6 | +import TabItem from '@theme/TabItem'; |
| 7 | + |
| 8 | +# Find insecure `Security.setProperty` calls |
| 9 | + |
| 10 | +**io.moderne.cryptography.FindInsecureSecuritySetProperties** |
| 11 | + |
| 12 | +_Locate calls to `Security.setProperty` that set insecure properties._ |
| 13 | + |
| 14 | +## Recipe source |
| 15 | + |
| 16 | +This recipe is only available to users of [Moderne](https://docs.moderne.io/). |
| 17 | + |
| 18 | + |
| 19 | +This recipe is available under the [Moderne Proprietary License](https://docs.moderne.io/licensing/overview). |
| 20 | + |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI: |
| 25 | +<Tabs groupId="projectType"> |
| 26 | + |
| 27 | + |
| 28 | +<TabItem value="moderne-cli" label="Moderne CLI"> |
| 29 | + |
| 30 | +You will need to have configured the [Moderne CLI](https://docs.moderne.io/user-documentation/moderne-cli/getting-started/cli-intro) on your machine before you can run the following command. |
| 31 | + |
| 32 | +```shell title="shell" |
| 33 | +mod run . --recipe FindInsecureSecuritySetProperties |
| 34 | +``` |
| 35 | + |
| 36 | +If the recipe is not available locally, then you can install it using: |
| 37 | +```shell |
| 38 | +mod config recipes jar install io.moderne.recipe:rewrite-cryptography:{{VERSION_IO_MODERNE_RECIPE_REWRITE_CRYPTOGRAPHY}} |
| 39 | +``` |
| 40 | +</TabItem> |
| 41 | +</Tabs> |
| 42 | + |
| 43 | +## See how this recipe works across multiple open-source repositories |
| 44 | + |
| 45 | +import RecipeCallout from '@site/src/components/ModerneLink'; |
| 46 | + |
| 47 | +<RecipeCallout link="https://app.moderne.io/recipes/io.moderne.cryptography.FindInsecureSecuritySetProperties" /> |
| 48 | + |
| 49 | +The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories. |
| 50 | + |
| 51 | +Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. |
| 52 | +## Data Tables |
| 53 | + |
| 54 | +<Tabs groupId="data-tables"> |
| 55 | +<TabItem value="io.moderne.cryptography.table.InsecureSetProperties" label="InsecureSetProperties"> |
| 56 | + |
| 57 | +### Insecure `Security.setProperty(..)` uses. |
| 58 | +**io.moderne.cryptography.table.InsecureSetProperties** |
| 59 | + |
| 60 | +_An itemization of the properties used in such calls_ |
| 61 | + |
| 62 | +| Column Name | Description | |
| 63 | +| ----------- | ----------- | |
| 64 | +| Source code | The source code where the insecure property is defined, which may not contain a `Security.setProperty(..)` call directly if the property was defined somewhere and through data flow analysis we've concluded that it is later used in a `Security.setProperty(..)` call. | |
| 65 | +| Property | The property that is set insecurely, e.g. `crypto.policy`. | |
| 66 | + |
| 67 | +</TabItem> |
| 68 | + |
| 69 | +<TabItem value="org.openrewrite.table.SourcesFileResults" label="SourcesFileResults"> |
| 70 | + |
| 71 | +### Source files that had results |
| 72 | +**org.openrewrite.table.SourcesFileResults** |
| 73 | + |
| 74 | +_Source files that were modified by the recipe run._ |
| 75 | + |
| 76 | +| Column Name | Description | |
| 77 | +| ----------- | ----------- | |
| 78 | +| Source path before the run | The source path of the file before the run. `null` when a source file was created during the run. | |
| 79 | +| Source path after the run | A recipe may modify the source path. This is the path after the run. `null` when a source file was deleted during the run. | |
| 80 | +| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. | |
| 81 | +| Recipe that made changes | The specific recipe that made a change. | |
| 82 | +| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. | |
| 83 | +| Cycle | The recipe cycle in which the change was made. | |
| 84 | + |
| 85 | +</TabItem> |
| 86 | + |
| 87 | +<TabItem value="org.openrewrite.table.SourcesFileErrors" label="SourcesFileErrors"> |
| 88 | + |
| 89 | +### Source files that errored on a recipe |
| 90 | +**org.openrewrite.table.SourcesFileErrors** |
| 91 | + |
| 92 | +_The details of all errors produced by a recipe run._ |
| 93 | + |
| 94 | +| Column Name | Description | |
| 95 | +| ----------- | ----------- | |
| 96 | +| Source path | The file that failed to parse. | |
| 97 | +| Recipe that made changes | The specific recipe that made a change. | |
| 98 | +| Stack trace | The stack trace of the failure. | |
| 99 | + |
| 100 | +</TabItem> |
| 101 | + |
| 102 | +<TabItem value="org.openrewrite.table.RecipeRunStats" label="RecipeRunStats"> |
| 103 | + |
| 104 | +### Recipe performance |
| 105 | +**org.openrewrite.table.RecipeRunStats** |
| 106 | + |
| 107 | +_Statistics used in analyzing the performance of recipes._ |
| 108 | + |
| 109 | +| Column Name | Description | |
| 110 | +| ----------- | ----------- | |
| 111 | +| The recipe | The recipe whose stats are being measured both individually and cumulatively. | |
| 112 | +| Source file count | The number of source files the recipe ran over. | |
| 113 | +| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. | |
| 114 | +| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. | |
| 115 | +| 99th percentile scanning time (ns) | 99 out of 100 scans completed in this amount of time. | |
| 116 | +| Max scanning time (ns) | The max time scanning any one source file. | |
| 117 | +| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. | |
| 118 | +| 99th percentile edit time (ns) | 99 out of 100 edits completed in this amount of time. | |
| 119 | +| Max edit time (ns) | The max time editing any one source file. | |
| 120 | + |
| 121 | +</TabItem> |
| 122 | + |
| 123 | +</Tabs> |
| 124 | + |
| 125 | +## Contributors |
| 126 | +[Jonathan Schneider](mailto:jkschneider@gmail.com), [Tim te Beek](mailto:tim@moderne.io) |
0 commit comments