/
getSandboxReport.go
229 lines (201 loc) · 9.27 KB
/
getSandboxReport.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package zia
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/zscaler/pulumi-zia/sdk/go/zia/internal"
)
// Use the **zia_sandbox_report** data source gets a full (i.e., complete) or summary detail report for an MD5 hash of a file that was analyzed by Sandbox.
//
// ## Example Usage
//
// ### Obtain Full Sandbox Report
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/zscaler/pulumi-zia/sdk/go/zia"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := zia.GetSandboxReport(ctx, &zia.GetSandboxReportArgs{
// Details: pulumi.StringRef("full"),
// Md5Hash: "F69CA01D65E6C8F9E3540029E5F6AB92",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Obtain Summarized Sandbox Report
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/zscaler/pulumi-zia/sdk/go/zia"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := zia.GetSandboxReport(ctx, &zia.GetSandboxReportArgs{
// Details: pulumi.StringRef("summary"),
// Md5Hash: "F69CA01D65E6C8F9E3540029E5F6AB92",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetSandboxReport(ctx *pulumi.Context, args *GetSandboxReportArgs, opts ...pulumi.InvokeOption) (*GetSandboxReportResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetSandboxReportResult
err := ctx.Invoke("zia:index/getSandboxReport:getSandboxReport", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSandboxReport.
type GetSandboxReportArgs struct {
// (Required) Type of report, full or summary.
Details *string `pulumi:"details"`
Exploits []GetSandboxReportExploit `pulumi:"exploits"`
// (Required) MD5 hash of the file that was analyzed by Sandbox.
Md5Hash string `pulumi:"md5Hash"`
Networkings []GetSandboxReportNetworking `pulumi:"networkings"`
Persistences []GetSandboxReportPersistence `pulumi:"persistences"`
SecurityBypasses []GetSandboxReportSecurityBypass `pulumi:"securityBypasses"`
Spywares []GetSandboxReportSpyware `pulumi:"spywares"`
Stealths []GetSandboxReportStealth `pulumi:"stealths"`
}
// A collection of values returned by getSandboxReport.
type GetSandboxReportResult struct {
Classifications []GetSandboxReportClassification `pulumi:"classifications"`
// (Required) Type of report, full or summary.
Details *string `pulumi:"details"`
Exploits []GetSandboxReportExploit `pulumi:"exploits"`
FileProperties []GetSandboxReportFileProperty `pulumi:"fileProperties"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// (Required) MD5 hash of the file that was analyzed by Sandbox.
Md5Hash string `pulumi:"md5Hash"`
Networkings []GetSandboxReportNetworking `pulumi:"networkings"`
Origins []GetSandboxReportOrigin `pulumi:"origins"`
Persistences []GetSandboxReportPersistence `pulumi:"persistences"`
SecurityBypasses []GetSandboxReportSecurityBypass `pulumi:"securityBypasses"`
Spywares []GetSandboxReportSpyware `pulumi:"spywares"`
Stealths []GetSandboxReportStealth `pulumi:"stealths"`
// Summary detail report for an MD5 hash of a file that was analyzed by Sandbox
Summaries []GetSandboxReportSummary `pulumi:"summaries"`
SystemSummaries []GetSandboxReportSystemSummary `pulumi:"systemSummaries"`
}
func GetSandboxReportOutput(ctx *pulumi.Context, args GetSandboxReportOutputArgs, opts ...pulumi.InvokeOption) GetSandboxReportResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetSandboxReportResult, error) {
args := v.(GetSandboxReportArgs)
r, err := GetSandboxReport(ctx, &args, opts...)
var s GetSandboxReportResult
if r != nil {
s = *r
}
return s, err
}).(GetSandboxReportResultOutput)
}
// A collection of arguments for invoking getSandboxReport.
type GetSandboxReportOutputArgs struct {
// (Required) Type of report, full or summary.
Details pulumi.StringPtrInput `pulumi:"details"`
Exploits GetSandboxReportExploitArrayInput `pulumi:"exploits"`
// (Required) MD5 hash of the file that was analyzed by Sandbox.
Md5Hash pulumi.StringInput `pulumi:"md5Hash"`
Networkings GetSandboxReportNetworkingArrayInput `pulumi:"networkings"`
Persistences GetSandboxReportPersistenceArrayInput `pulumi:"persistences"`
SecurityBypasses GetSandboxReportSecurityBypassArrayInput `pulumi:"securityBypasses"`
Spywares GetSandboxReportSpywareArrayInput `pulumi:"spywares"`
Stealths GetSandboxReportStealthArrayInput `pulumi:"stealths"`
}
func (GetSandboxReportOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetSandboxReportArgs)(nil)).Elem()
}
// A collection of values returned by getSandboxReport.
type GetSandboxReportResultOutput struct{ *pulumi.OutputState }
func (GetSandboxReportResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetSandboxReportResult)(nil)).Elem()
}
func (o GetSandboxReportResultOutput) ToGetSandboxReportResultOutput() GetSandboxReportResultOutput {
return o
}
func (o GetSandboxReportResultOutput) ToGetSandboxReportResultOutputWithContext(ctx context.Context) GetSandboxReportResultOutput {
return o
}
func (o GetSandboxReportResultOutput) Classifications() GetSandboxReportClassificationArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportClassification { return v.Classifications }).(GetSandboxReportClassificationArrayOutput)
}
// (Required) Type of report, full or summary.
func (o GetSandboxReportResultOutput) Details() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetSandboxReportResult) *string { return v.Details }).(pulumi.StringPtrOutput)
}
func (o GetSandboxReportResultOutput) Exploits() GetSandboxReportExploitArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportExploit { return v.Exploits }).(GetSandboxReportExploitArrayOutput)
}
func (o GetSandboxReportResultOutput) FileProperties() GetSandboxReportFilePropertyArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportFileProperty { return v.FileProperties }).(GetSandboxReportFilePropertyArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetSandboxReportResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetSandboxReportResult) string { return v.Id }).(pulumi.StringOutput)
}
// (Required) MD5 hash of the file that was analyzed by Sandbox.
func (o GetSandboxReportResultOutput) Md5Hash() pulumi.StringOutput {
return o.ApplyT(func(v GetSandboxReportResult) string { return v.Md5Hash }).(pulumi.StringOutput)
}
func (o GetSandboxReportResultOutput) Networkings() GetSandboxReportNetworkingArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportNetworking { return v.Networkings }).(GetSandboxReportNetworkingArrayOutput)
}
func (o GetSandboxReportResultOutput) Origins() GetSandboxReportOriginArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportOrigin { return v.Origins }).(GetSandboxReportOriginArrayOutput)
}
func (o GetSandboxReportResultOutput) Persistences() GetSandboxReportPersistenceArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportPersistence { return v.Persistences }).(GetSandboxReportPersistenceArrayOutput)
}
func (o GetSandboxReportResultOutput) SecurityBypasses() GetSandboxReportSecurityBypassArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportSecurityBypass { return v.SecurityBypasses }).(GetSandboxReportSecurityBypassArrayOutput)
}
func (o GetSandboxReportResultOutput) Spywares() GetSandboxReportSpywareArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportSpyware { return v.Spywares }).(GetSandboxReportSpywareArrayOutput)
}
func (o GetSandboxReportResultOutput) Stealths() GetSandboxReportStealthArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportStealth { return v.Stealths }).(GetSandboxReportStealthArrayOutput)
}
// Summary detail report for an MD5 hash of a file that was analyzed by Sandbox
func (o GetSandboxReportResultOutput) Summaries() GetSandboxReportSummaryArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportSummary { return v.Summaries }).(GetSandboxReportSummaryArrayOutput)
}
func (o GetSandboxReportResultOutput) SystemSummaries() GetSandboxReportSystemSummaryArrayOutput {
return o.ApplyT(func(v GetSandboxReportResult) []GetSandboxReportSystemSummary { return v.SystemSummaries }).(GetSandboxReportSystemSummaryArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetSandboxReportResultOutput{})
}