Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sentinel] Upgrade Microsoft Sentinel #5050

Merged
merged 18 commits into from
Jul 5, 2022
Merged

Conversation

necusjz
Copy link
Member

@necusjz necusjz commented Jun 27, 2022

Resolves: Azure/azure-cli#21665


Powered by CodeGen v2. Due to current limitation, the following command groups are not generated:

  • az sentinel entity;
  • az sentinel watchlist item;

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify src/index.json.

@necusjz necusjz added this to the Jun 2022 (2022-07-05) milestone Jun 27, 2022
@necusjz necusjz requested review from jsntcy and kairu-ms June 27, 2022 09:16
@necusjz necusjz self-assigned this Jun 27, 2022
@ghost ghost added the Auto-Assign Auto assign by bot label Jun 27, 2022
@ghost ghost assigned kairu-ms Jun 27, 2022
@ghost ghost requested a review from yonzhan June 27, 2022 09:16
@ghost ghost added the Code Gen label Jun 27, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 27, 2022

Sentinel

Comment on lines 2 to 5
##### Create #####
```
az sentinel data-connector create \
--office-data-connector etag="\\"0300bf09-0000-0000-0000-5c37296e0000\\"" tenant-id="2070ecc9-b4d5-4ae4-adaa-936fa1954fa8" \
--data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "b96d014d-b5c2-4a01-9aba-a8058f629d42" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "06b3ccb8-1384-4bcc-aec7-852f6d57161b" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "c345bf40-8509-4ed2-b947-50cb773aaf04" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "07e42cb3-e658-4e90-801c-efa0f29d3d44" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "c345bf40-8509-4ed2-b947-50cb773aaf04" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel data-connector show --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### List #####
```
az sentinel data-connector list --resource-group "myRg" --workspace-name "myWorkspace"
```
##### Delete #####
```
az sentinel data-connector delete --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
#### sentinel incident ####
##### Create #####
```
az sentinel incident create --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" \
--description "This is a demo incident" --classification "FalsePositive" \
--classification-comment "Not a malicious activity" --classification-reason "IncorrectAlertLogic" \
--first-activity-time-utc "2019-01-01T13:00:30Z" --last-activity-time-utc "2019-01-01T13:05:30Z" \
--owner object-id="2046feea-040d-4a46-9e2b-91c2941bfa70" --severity "High" --status "Closed" --title "My incident" \
--incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel incident show --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### List #####
```
az sentinel incident list --orderby "properties/createdTimeUtc desc" --top 1 --resource-group "myRg" \
--workspace-name "myWorkspace"
```
##### Delete #####
```
az sentinel incident delete --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
--workspace-name "myWorkspace"
```
#### sentinel incident-comment ####
##### Create #####
```
az sentinel incident-comment create --message "Some message" \
--incident-comment-id "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014" --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" \
--resource-group "myRg" --workspace-name "myWorkspace"
```
##### Show #####
```
az sentinel incident-comment show --incident-comment-id "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014" \
--incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
```
##### List #####
```
az sentinel incident-comment list --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
--workspace-name "myWorkspace"
``` No newline at end of file
## How to use ##
Please add commands usage here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please complete this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIP🚧

with open('README.md', 'r', encoding='utf-8') as f:
README = f.read()
with open('HISTORY.rst', 'r', encoding='utf-8') as f:
HISTORY = f.read()

setup(
name='sentinel',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't change the extension name

@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.37.0"
Copy link
Contributor

@kairu-ms kairu-ms Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please wait for the release of "2.38.0"

Suggested change
"azext.minCliCoreVersion": "2.37.0"
"azext.minCliCoreVersion": "2.38.0"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch👍

Copy link
Contributor

@kairu-ms kairu-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please release this extension after azure-cli 2.38.0 is released.

@necusjz necusjz merged commit 043ac50 into Azure:main Jul 5, 2022
@necusjz necusjz deleted the feature-sentinel branch July 5, 2022 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Code Gen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI for SecurityInsights based on 2022-01-01-preview (with codegen)
3 participants