Watchlist Args
Represents a Watchlist in Azure Security Insights. Uses Azure REST API version 2024-09-01. In version 2.x of the Azure Native provider, it used API version 2023-02-01. Other available API versions: 2023-02-01, 2023-03-01-preview, 2023-04-01-preview, 2023-05-01-preview, 2023-06-01-preview, 2023-07-01-preview, 2023-08-01-preview, 2023-09-01-preview, 2023-10-01-preview, 2023-11-01, 2023-12-01-preview, 2024-01-01-preview, 2024-03-01, 2024-04-01-preview, 2024-10-01-preview, 2025-01-01-preview, 2025-03-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native securityinsights [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
Create or update a watchlist and bulk creates watchlist items.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var watchlist = new AzureNative.SecurityInsights.Watchlist("watchlist", new()
{
ContentType = "text/csv",
Description = "Watchlist from CSV content",
DisplayName = "High Value Assets Watchlist",
ItemsSearchKey = "header1",
NumberOfLinesToSkip = 1,
Provider = "Microsoft",
RawContent = @"This line will be skipped
header1,header2
value1,value2",
ResourceGroupName = "myRg",
Source = "watchlist.csv",
SourceType = AzureNative.SecurityInsights.SourceType.Local,
WatchlistAlias = "highValueAsset",
WorkspaceName = "myWorkspace",
});
});
package main
import (
securityinsights "github.com/pulumi/pulumi-azure-native-sdk/securityinsights/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := securityinsights.NewWatchlist(ctx, "watchlist", &securityinsights.WatchlistArgs{
ContentType: pulumi.String("text/csv"),
Description: pulumi.String("Watchlist from CSV content"),
DisplayName: pulumi.String("High Value Assets Watchlist"),
ItemsSearchKey: pulumi.String("header1"),
NumberOfLinesToSkip: pulumi.Int(1),
Provider: pulumi.String("Microsoft"),
RawContent: pulumi.String("This line will be skipped\nheader1,header2\nvalue1,value2"),
ResourceGroupName: pulumi.String("myRg"),
Source: pulumi.String("watchlist.csv"),
SourceType: pulumi.String(securityinsights.SourceTypeLocal),
WatchlistAlias: pulumi.String("highValueAsset"),
WorkspaceName: pulumi.String("myWorkspace"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.securityinsights.Watchlist;
import com.pulumi.azurenative.securityinsights.WatchlistArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var watchlist = new Watchlist("watchlist", WatchlistArgs.builder()
.contentType("text/csv")
.description("Watchlist from CSV content")
.displayName("High Value Assets Watchlist")
.itemsSearchKey("header1")
.numberOfLinesToSkip(1)
.provider("Microsoft")
.rawContent("""
This line will be skipped
header1,header2
value1,value2 """)
.resourceGroupName("myRg")
.source("watchlist.csv")
.sourceType("Local")
.watchlistAlias("highValueAsset")
.workspaceName("myWorkspace")
.build());
}
}
Create or update a watchlist.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var watchlist = new AzureNative.SecurityInsights.Watchlist("watchlist", new()
{
Description = "Watchlist from CSV content",
DisplayName = "High Value Assets Watchlist",
ItemsSearchKey = "header1",
Provider = "Microsoft",
ResourceGroupName = "myRg",
Source = "watchlist.csv",
SourceType = AzureNative.SecurityInsights.SourceType.Local,
WatchlistAlias = "highValueAsset",
WorkspaceName = "myWorkspace",
});
});
package main
import (
securityinsights "github.com/pulumi/pulumi-azure-native-sdk/securityinsights/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := securityinsights.NewWatchlist(ctx, "watchlist", &securityinsights.WatchlistArgs{
Description: pulumi.String("Watchlist from CSV content"),
DisplayName: pulumi.String("High Value Assets Watchlist"),
ItemsSearchKey: pulumi.String("header1"),
Provider: pulumi.String("Microsoft"),
ResourceGroupName: pulumi.String("myRg"),
Source: pulumi.String("watchlist.csv"),
SourceType: pulumi.String(securityinsights.SourceTypeLocal),
WatchlistAlias: pulumi.String("highValueAsset"),
WorkspaceName: pulumi.String("myWorkspace"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.securityinsights.Watchlist;
import com.pulumi.azurenative.securityinsights.WatchlistArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var watchlist = new Watchlist("watchlist", WatchlistArgs.builder()
.description("Watchlist from CSV content")
.displayName("High Value Assets Watchlist")
.itemsSearchKey("header1")
.provider("Microsoft")
.resourceGroupName("myRg")
.source("watchlist.csv")
.sourceType("Local")
.watchlistAlias("highValueAsset")
.workspaceName("myWorkspace")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:securityinsights:Watchlist highValueAsset /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}
Constructors
Properties
The content type of the raw content. Example : text/csv or text/tsv
Describes a user that created the watchlist
The default duration of a watchlist (in ISO 8601 duration format)
A description of the watchlist
The display name of the watchlist
The search key is used to optimize query performance when using watchlists for joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then use this field as the key field when joining to other event data by IP address.
The number of lines in a csv/tsv content to skip before the header
The raw content that represents to watchlist items to create. In case of csv/tsv content type, it's the content of the file that will parsed by the endpoint
The name of the resource group. The name is case insensitive.
The sourceType of the watchlist
Describes a user that updated the watchlist
The status of the Watchlist upload : New, InProgress or Complete. Note : When a Watchlist upload status is InProgress, the Watchlist cannot be deleted
The alias of the watchlist
The id (a Guid) of the watchlist
The type of the watchlist
The name of the workspace.