You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AOSM CLI - Fixing a zip-slip security bug for code that was using tar.extractall() on nfd build command (#9234)
* AOSM CLI - Fixing a zip-slip security bug for code that was using tar.extractall() on `nfd build` command
* fixing tests
* fixing tests
* review updates
---------
Co-authored-by: Daniel Steven <[email protected]>
Copy file name to clipboardExpand all lines: src/aosm/HISTORY.rst
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,20 @@
2
2
3
3
Release History
4
4
===============
5
+
6
+
2.0.0b3
7
+
++++++++
8
+
* Fixing a zip-slip security bug for code that was using tar.extractall() on `nfd build` command.
9
+
* This version requires a minimum of 2.70.0 Azure core CLI. See install instructions: https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli.md
10
+
5
11
2.0.0b2
6
12
++++++++
7
-
* Remove msrestazure dependency
13
+
* Added sns generate-config, build and deploy commands.
14
+
* Added a check to make sure resource type used in ARM template are in allowed list.
15
+
* Fixed multi NF RETs issue in nsdvs.
16
+
* Fixed: Better exception messages for Azure permissions problems.
17
+
* Fixed: skip-steps help text to reflect current implementation.
18
+
* Added finetuning of parameter exposure with yaml comments for CNF
Copy file name to clipboardExpand all lines: src/aosm/README.md
+27-18Lines changed: 27 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Microsoft Azure CLI 'aosm' Extension
2
2
3
-
This package is for the 'aosm' extension to support Azure Operator Service Manager
3
+
This package is for the 'aosm' extension to support Azure Operator Service Manager
4
4
functions.
5
5
i.e. `az aosm`
6
6
@@ -23,16 +23,18 @@ These commands help with the publishing of Network Function Definition and Netwo
23
23
Service Design resources.
24
24
25
25
## Overview of function
26
+
26
27
A generic workflow of using the tool would be:
28
+
27
29
- Find the pre-requisite items you require for your use-case
28
30
- Run a `generate-config` command to output an example JSON config file for subsequent commands
29
31
- Fill in the config file
30
32
- Run a `build` command to output one or more bicep templates for your Network Function Definition or Network Service Design
31
33
- Review the output of the build command, edit the output as necessary for your requirements
32
34
- Run a `publish` command to:
33
-
* Create all pre-requisite resources such as Resource Group, Publisher, Artifact Stores, Groups
34
-
* Deploy those bicep templates
35
-
* Upload artifacts to the artifact stores
35
+
- Create all pre-requisite resources such as Resource Group, Publisher, Artifact Stores, Groups
36
+
- Deploy those bicep templates
37
+
- Upload artifacts to the artifact stores
36
38
37
39
### Pre-requisites
38
40
@@ -45,14 +47,16 @@ image that would be used for the VNF Virtual Machine.
45
47
#### CNFs
46
48
47
49
For CNFs you must have these packages installed on the machine you are running the CLI from:
48
-
-`helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/).
49
-
-`docker` installed only in some circumstances, those being if the source image is in your local docker repository, or you do not have subscription-wide permissions required to push charts and images. See the remainder of this section for further details. Docker provides packages that easily configure docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems.
50
+
51
+
-`helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/).
52
+
-`docker` installed only in some circumstances, those being if the source image is in your local docker repository, or you do not have subscription-wide permissions required to push charts and images. See the remainder of this section for further details. Docker provides packages that easily configure docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems.
50
53
51
54
For CNFs, you must provide:
52
-
* Helm packages with an associated schema. These files must be on your disk and will be referenced in the `cnf-input.jsonc` config file.
53
-
* A reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this, fill in `source_registry` and optionally `source_registry_namespace` in the cnf-input.jsonc file.
54
-
* Optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF.
55
-
* When filling in the cnf-input.jsonc file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your cnf-input.jsonc should look something like this:
55
+
56
+
- Helm packages with an associated schema. These files must be on your disk and will be referenced in the `cnf-input.jsonc` config file.
57
+
- A reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this, fill in `source_registry` and optionally `source_registry_namespace` in the cnf-input.jsonc file.
58
+
- Optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF.
59
+
- When filling in the cnf-input.jsonc file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your cnf-input.jsonc should look something like this:
56
60
57
61
"helm_packages": [
58
62
{
@@ -73,19 +77,21 @@ For CNFs, you must provide:
73
77
},
74
78
75
79
##### Permissions for publishing CNFs
80
+
76
81
If sourcing the CNF images from an existing ACR, you need to have `Reader`/`AcrPull` permissions
77
-
from this ACR, and ideally, `Contributor` role + `AcrPush` role (or a custom role that allows the `importImage` action and `AcrPush`) over the whole subscription in order to be able to import to the new Artifact store. If you have these, you
82
+
from this ACR, and ideally, `Contributor` role + `AcrPush` role (or a custom role that allows the `importImage` action and `AcrPush`) over the whole subscription in order to be able to import to the new Artifact store. If you have these, you
78
83
do not need docker to be installed locally, and the image copy is very quick.
79
84
80
85
If you do not have the subscription-wide permissions then you can run the `az aosm nfd publish` command using the `--no-subscription-permissions` flag to pull the image to your local machine and then push it to the Artifact Store using manifest credentials scoped only to the store. This requires docker to be installed locally.
81
86
82
87
#### NSDs
83
-
For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources.
84
88
89
+
For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources.
85
90
86
91
### Command examples
87
92
88
93
#### Before you start
94
+
89
95
`az login` to login to the Azure CLI.
90
96
`az account set --subscription <subscription>` to choose the subscription you will work on.
91
97
@@ -104,7 +110,7 @@ Create an example config file for building a definition
104
110
105
111
`az aosm nfd generate-config`
106
112
107
-
This will output a file called `cnf-input.jsonc` which must be filled in.
113
+
This will output a file called `cnf-input.jsonc` which must be filled in.
108
114
Once the config file has been filled in the following commands can be run.
109
115
110
116
Build an nfd definition locally
@@ -115,7 +121,6 @@ Publish a pre-built definition
It would be much appreciated if you could report these so that we're aware of them!
147
151
148
-
Please see [Logging](#logging) for how to view and collect logs.
152
+
Please see [Logging](#logging) for how to view and collect logs.
149
153
150
154
Please describe what you are doing and if possible provide the input and output files.
151
155
@@ -157,20 +161,25 @@ CLI issues should be tagged and triaged as UX bugs.
157
161
## Logging
158
162
159
163
The CLI uses the standard Azure CLI logging mechanism. To enable logging to the console, you can use the following flags depending on the desired level of logging:
164
+
160
165
-`--verbose` - This flag changes the logging level to Info and above.
161
166
-`--debug` - This flag changes the logging level to Debug and above.
162
167
-`--only-show-errors` - This flag changes the logging level to Error only, suppressing Warning.
163
168
164
169
It is also possible to enable logging to file by running the following command:
170
+
165
171
```
166
172
az config set logging.enable_log_file=true
167
173
```
168
-
This will create a log file in the `~/.azure/logs` directory.
174
+
175
+
This will create a log file in the `~/.azure/logs` directory.
169
176
170
177
**Note:** The above command will enable logging for all Azure CLI commands until the logging is disabled again by the user. Not disabling file logging could slow down the performance of the CLI. To disable file logging, run the following command:
178
+
171
179
```
172
180
az config set logging.enable_log_file=false
173
181
```
174
182
175
183
## Development
184
+
176
185
Information about setting up and maintaining a development environment for this extension can be found [here](https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/cli_contributing).
Copy file name to clipboardExpand all lines: src/aosm/azext_aosm/_help.py
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -121,3 +121,26 @@
121
121
- name: Publish a Network Service Design.
122
122
text: az aosm nsd publish --build-output-folder my-nsd-output-folder
123
123
"""
124
+
125
+
helps[
126
+
"aosm sns"
127
+
] ="""
128
+
type: group
129
+
short-summary: Manage AOSM Site Network Services.
130
+
long-summary: |
131
+
A Site Network Service (SNS) is a collection of network functions along with platform that come together to offer a service..
132
+
"""
133
+
134
+
helps[
135
+
"aosm sns generate-config"
136
+
] ="""
137
+
type: command
138
+
short-summary: Generate configuration file for building an AOSM SNS.
139
+
long-summary: |
140
+
Generates a configuration file that you can use to build an AOSM Site Network Service (SNS). The configuration file is a JSONC file that contains the required parameters for building the SNS. You must complete the configuration file with your specific values before building the SNS.
141
+
examples:
142
+
- name: Generate a configuration file for a Site Network Service.
143
+
text: az aosm sns generate-config
144
+
- name: Generate a configuration file for a Site Network Service and write to a specific file.
145
+
text: az aosm sns generate-config --output-file my-sns-input-config.jsonc
0 commit comments