|
5 | 5 | # -------------------------------------------------------------------------------------------- |
6 | 6 |
|
7 | 7 | from knack.help_files import helps # pylint: disable=unused-import |
8 | | - |
| 8 | +from azext_confcom.config import SUPPORTED_ALGOS |
9 | 9 |
|
10 | 10 | helps[ |
11 | 11 | "confcom" |
|
51 | 51 |
|
52 | 52 | - name: --debug-mode |
53 | 53 | type: boolean |
54 | | - short-summary: 'When enabled, the generated security policy adds the ability to use /bin/sh or /bin/bash to debug the container. It also enabled stdio access, ability to dump stack traces, and enables runtime logging. It is recommended to only use this option for debugging purposes.' |
| 54 | + short-summary: 'When enabled, the generated security policy adds the ability to use /bin/sh or /bin/bash to debug the container. It also enabled stdio access, ability to dump stack traces, and enables runtime logging. It is recommended to only use this option for debugging purposes' |
55 | 55 |
|
56 | 56 | - name: --approve-wildcards -y |
57 | 57 | type: boolean |
58 | | - short-summary: 'When enabled, all prompts for using wildcards in environment variables are automatically approved.' |
| 58 | + short-summary: 'When enabled, all prompts for using wildcards in environment variables are automatically approved' |
59 | 59 |
|
60 | 60 | - name: --disable-stdio |
61 | 61 | type: boolean |
62 | | - short-summary: 'When enabled, the containers in the container group do not have access to stdio.' |
| 62 | + short-summary: 'When enabled, the containers in the container group do not have access to stdio' |
63 | 63 |
|
64 | 64 | - name: --print-existing-policy |
65 | 65 | type: boolean |
66 | | - short-summary: 'When enabled, the existing security policy that is present in the ARM Template is printed to the command line, and no new security policy is generated.' |
| 66 | + short-summary: 'When enabled, the existing security policy that is present in the ARM Template is printed to the command line, and no new security policy is generated' |
67 | 67 |
|
68 | 68 | - name: --diff -d |
69 | 69 | type: boolean |
70 | | - short-summary: 'When combined with an input ARM Template, verifies the policy present in the ARM Template under "ccePolicy" and the containers within the ARM Template are compatible. If they are incompatible, a list of reasons is given and the exit status code will be 2.' |
| 70 | + short-summary: 'When combined with an input ARM Template file (or YAML file for Virtual Node policy generation), verifies the policy present in the ARM Template under "ccePolicy" and the containers within the file are compatible. If they are incompatible, a list of reasons is given and the exit status code will be 2' |
71 | 71 |
|
72 | 72 | - name: --outraw |
73 | 73 | type: boolean |
|
79 | 79 |
|
80 | 80 | - name: --save-to-file -s |
81 | 81 | type: string |
82 | | - short-summary: 'Save output policy to given file path.' |
| 82 | + short-summary: 'Save output policy to given file path' |
83 | 83 |
|
84 | 84 | - name: --print-policy |
85 | 85 | type: boolean |
|
89 | 89 | type: boolean |
90 | 90 | short-summary: 'When enabled, the hashing algorithm used to generate the policy is faster but less memory efficient' |
91 | 91 |
|
| 92 | + - name: --omit-id |
| 93 | + type: boolean |
| 94 | + short-summary: 'When enabled, the generated policy will not contain the ID field. This will keep the policy from being tied to a specific image name and tag' |
| 95 | +
|
| 96 | + - name: --include-fragments -f |
| 97 | + type: boolean |
| 98 | + short-summary: 'When enabled, the path specified by --fragments-json will be used to pull fragments from an OCI registry or locally and include them in the generated policy' |
| 99 | +
|
| 100 | + - name: --fragments-json -j |
| 101 | + type: string |
| 102 | + short-summary: 'Path to JSON file containing fragment information to use for generating a policy. This requires --include-fragments to be enabled' |
| 103 | +
|
| 104 | + - name: --exclude-default-fragments -e |
| 105 | + type: boolean |
| 106 | + short-summary: 'When enabled, the default fragments are not included in the generated policy. This includes containers needed to mount azure files, mount secrets, mount git repos, and other common ACI features' |
| 107 | +
|
92 | 108 | examples: |
93 | 109 | - name: Input an ARM Template file to inject a base64 encoded Confidential Container Security Policy into the ARM Template |
94 | 110 | text: az confcom acipolicygen --template-file "./template.json" |
|
98 | 114 | text: az confcom acipolicygen --template-file "./template.json" -s "./output-file.txt" --print-policy |
99 | 115 | - name: Input an ARM Template file and use a tar file as the image source instead of the Docker daemon |
100 | 116 | text: az confcom acipolicygen --template-file "./template.json" --tar "./image.tar" |
| 117 | + - name: Input an ARM Template file and use a fragments JSON file to generate a policy |
| 118 | + text: az confcom acipolicygen --template-file "./template.json" --fragments-json "./fragments.json" --include-fragments |
| 119 | +""" |
| 120 | + |
| 121 | +helps[ |
| 122 | + "confcom acifragmentgen" |
| 123 | +] = f""" |
| 124 | + type: command |
| 125 | + short-summary: Create a Confidential Container Policy Fragment for ACI. |
| 126 | +
|
| 127 | + parameters: |
| 128 | + - name: --image |
| 129 | + type: string |
| 130 | + short-summary: 'Image to use for the generated policy fragment' |
| 131 | +
|
| 132 | + - name: --input -i |
| 133 | + type: string |
| 134 | + short-summary: 'Path to a JSON file containing the configuration for the generated policy fragment' |
| 135 | +
|
| 136 | + - name: --tar |
| 137 | + type: string |
| 138 | + short-summary: 'Path to either a tarball containing image layers or a JSON file containing paths to tarballs of image layers' |
| 139 | +
|
| 140 | + - name: --namespace -n |
| 141 | + type: string |
| 142 | + short-summary: 'Namespace to use for the generated policy fragment' |
| 143 | +
|
| 144 | + - name: --svn |
| 145 | + type: string |
| 146 | + short-summary: 'Minimum Allowed Software Version Number for the generated policy fragment. This should be a monotonically increasing integer' |
| 147 | +
|
| 148 | + - name: --feed -f |
| 149 | + type: string |
| 150 | + short-summary: 'Feed to use for the generated policy fragment. This is typically the same as the image name when using image-attached fragments. It is the location in the remote repository where the fragment will be stored' |
| 151 | +
|
| 152 | + - name: --key -k |
| 153 | + type: string |
| 154 | + short-summary: 'Path to .pem formatted key file to use for signing the generated policy fragment. This must be used with --chain' |
| 155 | +
|
| 156 | + - name: --chain |
| 157 | + type: string |
| 158 | + short-summary: 'Path to .pem formatted certificate chain file to use for signing the generated policy fragment. This must be used with --key' |
| 159 | +
|
| 160 | + - name: --algo |
| 161 | + type: string |
| 162 | + short-summary: | |
| 163 | + Algorithm used for signing the generated policy fragment. This must be used with --key and --chain. |
| 164 | + Supported algorithms are {SUPPORTED_ALGOS} |
| 165 | +
|
| 166 | + - name: --fragment-path -p |
| 167 | + type: string |
| 168 | + short-summary: 'Path to an existing policy fragment file to be used with --generate-import. This option allows you to create import statements for the specified fragment without needing to pull it from an OCI registry' |
| 169 | +
|
| 170 | + - name: --generate-import -g |
| 171 | + type: boolean |
| 172 | + short-summary: 'Generate an import statement for a policy fragment' |
| 173 | +
|
| 174 | + - name: --disable-stdio |
| 175 | + type: boolean |
| 176 | + short-summary: 'When enabled, the containers in the container group do not have access to stdio' |
| 177 | +
|
| 178 | + - name: --debug-mode |
| 179 | + type: boolean |
| 180 | + short-summary: 'When enabled, the generated security policy adds the ability to use /bin/sh or /bin/bash to debug the container. It also enabled stdio access, ability to dump stack traces, and enables runtime logging. It is recommended to only use this option for debugging purposes' |
| 181 | +
|
| 182 | + - name: --output-filename |
| 183 | + type: string |
| 184 | + short-summary: 'Save output policy to given file path' |
| 185 | +
|
| 186 | + - name: --outraw |
| 187 | + type: boolean |
| 188 | + short-summary: 'Output policy in clear text compact JSON instead of default pretty print format' |
| 189 | +
|
| 190 | + - name: --upload-fragment -u |
| 191 | + type: boolean |
| 192 | + short-summary: 'When enabled, the generated policy fragment will be uploaded to the registry of the image being used' |
| 193 | +
|
| 194 | + - name: --fragments-json -j |
| 195 | + type: string |
| 196 | + short-summary: 'Path to a JSON file that will store the fragment import information generated when using --generate-import. This file can later be fed into the policy generation command (acipolicygen) to include the fragment in a new or existing policy. If not specified, the import statement will be printed to the console instead of being saved to a file' |
| 197 | +
|
| 198 | + examples: |
| 199 | + - name: Input an image name to generate a simple fragment |
| 200 | + text: az confcom acifragmentgen --image mcr.microsoft.com/azuredocs/aci-helloworld |
| 201 | + - name: Input a config file to generate a fragment with a custom namespace and debug mode enabled |
| 202 | + text: az confcom acifragmentgen --input "./config.json" --namespace "my-namespace" --debug-mode |
| 203 | + - name: Generate an import statement for a signed local fragment |
| 204 | + text: az confcom acifragmentgen --fragment-path "./fragment.json" --generate-import --minimum-svn 1 |
| 205 | + - name: Generate a fragment and COSE sign it with a key and chain |
| 206 | + text: az confcom acifragmentgen --image mcr.microsoft.com/azuredocs/aci-helloworld --key "./key.pem" --chain "./chain.pem" --svn 1 --namespace contoso --no-print |
101 | 207 | """ |
102 | 208 |
|
103 | 209 | helps[ |
|
0 commit comments