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

Azurekid/documentation #7

Merged
merged 15 commits into from
Aug 14, 2023
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## v0.2.0 [2023-08-13]

_What's new?_
* Signature to all scripts has been added. ([#2](https://github.com/securehats/AzWorkspaceManager/issues/2))

_Bug fixes_
* Solved an issue that showed the payload. ([#5](https://github.com/securehats/AzWorkspaceManager/issues/5))
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing to AzWorkspaceManager
Because Open Source plays a major part in how products are build,
I see it as a matter of course to give the same effort back to our
community by creating extensible and easy-to-use software.

We welcome contributions from the community and have created some
resources to help you get started extending AzWorkspaceManager:

## Coding Standards

[Coding standards](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines?view=powershell-7.3)

## PS Script Analyzer

[PsScriptAnalyzer](https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/overview?view=ps-modules)

224 changes: 203 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,216 @@ contains some errors, I have decided to create a PowerShell Module called **AzWo

This module is especially useful in scenario's where you want to manage the Workspace Manager using Infrastructure as Code or using pipelines.

## Common setup
## Installation

To get started with this PowerShell module you only need to follow these basic steps.

### Prerequisites
> Click on the topics below to fold them out.

<details>

<summary>Prerequisites</summary>
<br/>

- [PowerShell Core](https://github.com/PowerShell/PowerShell)
- [Az.Accounts 2.10.0 or higher](https://www.powershellgallery.com/packages/Az.Accounts/2.12.5)
</details>

<details>
<summary>Install Module</summary>

```powershell
Install-Module AzWorkspaceManager
```
<br/>

</details>

## Get started with the module

Installing the module
This section shows a couple of examples on how to get started with this module.

```powershell
Install-Module -AzWorkspaceManager
<details>

<summary>Workspace Manager Configuration</summary>
<br/>

### Create a Workspace Manager configuration

Creating a Workspace Manager configuration in the parent Microsoft Sentinel instance.
```pwsh
Add-AzWorkpaceManager -Name 'myWorkspace' -ResourceGroup 'myResourceGroup'
```
</br>
</br>

![Add-WorkspaceManager](https://github.com/SecureHats/AzWorkspaceManager/assets/40334679/759beecd-2768-4c74-952f-32b04c34ee2b)


</details>

<details>

<summary>Add Workspace Manager Members and Groups</summary>
<br/>

### Add a Workspace Manager Member

Creating Workspace Manager members in the Workspace Manager Configuration.

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
resourceId = $resourceId
tenantId = $tenantId
}

Add-AzWorkpaceManagerMember @arguments
```
</br>

### Add a Workspace Manager Group

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
name = 'myGroup'
workspaceManagerMembers = 'mySecondWorkspace(f6426b36-04fa-4a41-a9e4-7f13abe34d55)'
}

Add-AzWorkpaceManagerGroup @arguments
```
</br>

### Create a member and add through pipeline to group

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
resourceId = $resourceId
tenantId = $tenantId
}

Add-AzWorkpaceManagerMember @arguments | Add-AzWorkspaceManagerGroup -GroupName 'myGroup'
}

```

![Add-WorkspaceManagerMember-Group](https://github.com/SecureHats/AzWorkspaceManager/assets/40334679/a01048f2-3aca-4d64-bf01-8f0b669269f1)

</details>

<details>

<summary>Add Workspace Manager Assignments</summary>
<br/>

### Add a Workspace Manager Assignment

This example creates an empty assignment.
Because the assignment name is not provided, the 'GroupName' value will be used.

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
groupName = 'myGroup'
resourceId = $resourceId
}

Add-AzWorkspaceManagerAssignment @arguments
```
</br>

### Add an Alert Rules to a Workspace Manager Assignment

This example adds the resourceId of an alert rule to an assignment

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
name = 'myAssignment'
groupName = 'myGroup'
resourceId = $resourceId
}

Add-AzWorkspaceManagerAssignment @arguments
```

### Add Alert Rules to a Workspace Manager Assignment

This example gets all saved searches and adds them to an assignment

```pwsh
$SavedSearches = Get-AzWorkspaceManagerItem -WorkspaceName 'myWorkspace' -Type SavedSearches

$arguments = @{
workspaceName = 'myWorkspace'
name = 'myAssignment'
groupName = 'myGroup'
resourceId = $SavedSearches.resourceId
}

Add-AzWorkspaceManagerAssignment @arguments
```
</br>

</details>

<details>

<summary>Create an Assignment Job and get status </summary>
<br/>

### Adding a Workspace Manager Assignment Job

Creating a Workspace Manager assignment job.

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
name = 'myAssignment'
}

Add-AzWorkspaceManagerAssignmentJob @arguments
```
</br>


### Add a Workspace Manager Assignment Job for all assignments

This example creates an assignment job for each Workspace Manager assignment

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
}

Get-AzWorkspaceManagerAssignment @arguments | Add-AzWorkspaceManagerAssignmentJob
```

### Get all Workspace Manager Assignment Jobs for an assignment

This example gets all jobs for a Workspace Manager Assignment

```pwsh
$arguments = @{
workspaceName = 'myWorkspace'
name = 'myAssignment'
}

Get-AzWorkspaceManagerAssignmentJob @arguments
```
</br>

</details>

## Community

We all thrive on feedback and community involvement!

**Have a question?** → open a [GitHub issue](https://github.com/SecureHats/AzWorkspaceManager/issues/new/choose).

<!-- This SecureHats repository is used to organize project information and artifacts.
> Note field
- [ ] unchecked
- [x] checked
```Pwsh
Code example
```
## Heading 2
### Heading 3
#### Heading 4
_italic_
**bold**
inline `code-example`
-->
**Want to get involved?** → Learn how to [contribute](https://github.com/SecureHats/AzWorkspaceManager/blob/main/CONTRIBUTING.md).

## Buy me a Coffee

Expand All @@ -54,8 +235,9 @@ I am running on coffee and good music when busy writing code. so feel free to bu
<img src="./media/bmc.png" width="200" height="200" />


## Not happy?
## Feedback

If you encounter any issues, or have suggestions for improvements, feel free to open an Issue
If you encounter any issues, have suggestions for improvements or anything else, feel free to open an Issue
I will try to respond to each issue and Pull requests within 48 hours.

[Create Issue](../../issues/new/choose)
9 changes: 9 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
I deeply appreciate any effort to discover and disclose security vulnerabilities responsibly.

If you would like to report a vulnerability in one of the modules, or have security concerns regarding the AzWorkspaceManager, please email [email protected].

In order for me to best respond to your report, please include any of the following:

Steps to reproduce or proof-of-concept
Any relevant tools, including versions used
Tool output