compliancebenchmarks

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package compliancebenchmarks provides typed access to Jamf Platform compliancebenchmarks API endpoints.

Index

Constants

This section is empty.

Variables

View Source
var Privileges = map[string]jamfplatform.MethodPrivileges{
	"CreateBenchmark":                  {Method: "CreateBenchmark", HTTPMethod: "POST", Path: "/v1/benchmarks", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:create"}, Legacy: nil, Source: "spec"},
	"DeleteBenchmark":                  {Method: "DeleteBenchmark", HTTPMethod: "DELETE", Path: "/v1/benchmarks/{id}", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:delete"}, Legacy: nil, Source: "spec"},
	"GetBaselineRules":                 {Method: "GetBaselineRules", HTTPMethod: "GET", Path: "/v1/rules", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
	"GetBenchmark":                     {Method: "GetBenchmark", HTTPMethod: "GET", Path: "/v1/benchmarks/{id}", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
	"GetBenchmarkCompliancePercentage": {Method: "GetBenchmarkCompliancePercentage", HTTPMethod: "GET", Path: "/v1/benchmarks/{id}/compliance-percentage", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
	"ListBaselines":                    {Method: "ListBaselines", HTTPMethod: "GET", Path: "/v1/baselines", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
	"ListBenchmarkRuleDevices":         {Method: "ListBenchmarkRuleDevices", HTTPMethod: "GET", Path: "/v1/benchmarks/{id}/devices", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
	"ListBenchmarkRulesStats":          {Method: "ListBenchmarkRulesStats", HTTPMethod: "GET", Path: "/v1/benchmarks/{id}/rules", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
	"ListBenchmarks":                   {Method: "ListBenchmarks", HTTPMethod: "GET", Path: "/v1/benchmarks", Scopes: []jamfplatform.ScopeKind{jamfplatform.ScopeEnvironment}, ScopesSource: "spec", Scoped: []string{"compliance-benchmarks:read"}, Legacy: nil, Source: "spec"},
}

Privileges maps each compliancebenchmarks SDK method name to the Jamf API privileges it requires, sourced from the x-required-privileges vendor extensions in the Jamf OpenAPI specs. Identifiers are GA capability permissions in {capability}:{action} form and a multi-entry Scoped slice means all of them are required.

Source names where each entry's Scoped set came from: "spec" for the operation's own x-required-privileges, "gateway-policy" for one the published spec omits and this SDK supplies from the gateway's authorization policy, and "" when Scoped is empty. An empty Scoped slice means nothing declares a privilege for the endpoint, which is NOT the same as none being required — see jamfplatform.MethodPrivileges. Do not render it as "no permission needed".

Scopes lists the scope kinds each endpoint accepts. It is an alternatives set: a client carries one scope, so a consumer needs a credential matching one of the listed kinds. ScopesSource names where the set came from — "spec" for the spec root's own x-scope-types, "config-override" for one this SDK supplies because the published spec understates what the gateway serves or declares no extension at all. A spec-sourced set is what the spec declares, which for the Platform APIs is currently stricter than the gateway — see jamfplatform.MethodPrivileges.

Synthetic Resolve<X>ByName / Apply<X> methods are not present; document the privileges of the operations they call instead.

Functions

func PrivilegesFor

func PrivilegesFor(method string) (jamfplatform.MethodPrivileges, bool)

PrivilegesFor returns the privilege metadata for the named SDK method and true when the method is present in the registry, or the zero value and false otherwise.

Types

type ApiError

type ApiError struct {
	Errors []ApiErrorErrorsItem `json:"errors"`
	// HTTP status of the response.
	HttpStatus int `json:"httpStatus"`
	// Unique identifier for the request, useful for tracing and debugging.
	TraceID string `json:"traceId"`
}

ApiError represents a api error.

type ApiErrorErrorsItem

type ApiErrorErrorsItem struct {
	// Error-specific code for troubleshooting.
	Code string `json:"code"`
	// A detailed error message.
	Description string `json:"description"`
	// The field that caused the error.
	Field string `json:"field"`
}

ApiErrorErrorsItem represents a api error errors item.

type BaselineInfo

type BaselineInfo struct {
	BaselineID  string `json:"baselineId"`
	Description string `json:"description"`
	ID          string `json:"id"`
	RuleCount   int    `json:"ruleCount"`
	Title       string `json:"title"`
}

BaselineInfo Summary information about a compliance baseline including its ID, title, description, and rule count.

type BaselinesResponse

type BaselinesResponse struct {
	Baselines []BaselineInfo `json:"baselines"`
}

BaselinesResponse List of available compliance baselines.

type BenchmarkRequestV2

type BenchmarkRequestV2 struct {
	// A detailed description of the benchmark.
	Description *string `json:"description,omitempty"`
	// The enforcement mode for this benchmark.
	// Allowed values: see the BenchmarkRequestV2EnforcementMode constants.
	EnforcementMode string `json:"enforcementMode"`
	// The rules that make up this benchmark.
	Rules []RuleRequest `json:"rules"`
	// The selected OS versions for this benchmark, default is all available baseline OS versions.
	SelectedOsVersions *[]OsVersion `json:"selectedOsVersions,omitempty"`
	// The identifier of the source baseline from which this benchmark is derived.
	SourceBaselineID string `json:"sourceBaselineId"`
	// The target device group IDs to which a benchmark is deployed.
	Target TargetV2 `json:"target"`
	// A short, descriptive name for the benchmark.
	Title string `json:"title"`
}

BenchmarkRequestV2 Request body for creating a new compliance benchmark from a source baseline.

type BenchmarkRequestV2EnforcementMode

type BenchmarkRequestV2EnforcementMode = string

BenchmarkRequestV2EnforcementMode is the set of values accepted by BenchmarkRequestV2.EnforcementMode.

const (
	BenchmarkRequestV2EnforcementModeMonitor           BenchmarkRequestV2EnforcementMode = "MONITOR"
	BenchmarkRequestV2EnforcementModeMonitorAndEnforce BenchmarkRequestV2EnforcementMode = "MONITOR_AND_ENFORCE"
)

BenchmarkRequestV2EnforcementMode values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func BenchmarkRequestV2EnforcementModeValues

func BenchmarkRequestV2EnforcementModeValues() []BenchmarkRequestV2EnforcementMode

BenchmarkRequestV2EnforcementModeValues returns every value the Jamf API accepts for BenchmarkRequestV2EnforcementMode, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type BenchmarkResponseV2

type BenchmarkResponseV2 struct {
	// Available OS versions that this baseline supports.
	AvailableOsVersions []OsVersion `json:"availableOsVersions"`
	BaselineID          string      `json:"baselineId"`
	BenchmarkID         string      `json:"benchmarkId"`
	CanSwitchToEnforce  bool        `json:"canSwitchToEnforce"`
	Deleted             bool        `json:"deleted"`
	Description         string      `json:"description"`
	// Allowed values: see the BenchmarkResponseV2EnforcementMode constants.
	EnforcementMode string     `json:"enforcementMode"`
	LastUpdatedAt   time.Time  `json:"lastUpdatedAt"`
	Rules           []RuleInfo `json:"rules"`
	// The user-selected OS versions with full metadata.
	SelectedOsVersions []OsVersion `json:"selectedOsVersions"`
	Sources            []Source    `json:"sources"`
	// The target device group IDs to which a benchmark is deployed.
	Target          *TargetV2 `json:"target,omitempty"`
	TenantID        string    `json:"tenantId"`
	Title           string    `json:"title"`
	UpdateAvailable bool      `json:"updateAvailable"`
}

BenchmarkResponseV2 Detailed view of a compliance benchmark including its configuration, rules, and sync state.

type BenchmarkResponseV2EnforcementMode

type BenchmarkResponseV2EnforcementMode = string

BenchmarkResponseV2EnforcementMode is the set of values accepted by BenchmarkResponseV2.EnforcementMode.

const (
	BenchmarkResponseV2EnforcementModeMonitor           BenchmarkResponseV2EnforcementMode = "MONITOR"
	BenchmarkResponseV2EnforcementModeMonitorAndEnforce BenchmarkResponseV2EnforcementMode = "MONITOR_AND_ENFORCE"
)

BenchmarkResponseV2EnforcementMode values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func BenchmarkResponseV2EnforcementModeValues

func BenchmarkResponseV2EnforcementModeValues() []BenchmarkResponseV2EnforcementMode

BenchmarkResponseV2EnforcementModeValues returns every value the Jamf API accepts for BenchmarkResponseV2EnforcementMode, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type BenchmarkRuleDevicesResponse

type BenchmarkRuleDevicesResponse struct {
	Results    []DeviceRuleResult `json:"results"`
	TotalCount int                `json:"totalCount"`
}

BenchmarkRuleDevicesResponse Representation of devices for a benchmark rule. Used for drill-down view controller.

type BenchmarkRulesStatsResponse

type BenchmarkRulesStatsResponse struct {
	Results    []RuleResult `json:"results"`
	TotalCount int          `json:"totalCount"`
}

BenchmarkRulesStatsResponse Representation of rules results for whole benchmark. Used for top-level view controller.

type BenchmarkV2

type BenchmarkV2 struct {
	Description string `json:"description"`
	ID          string `json:"id"`
	Modified    bool   `json:"modified"`
	// Allowed values: see the BenchmarkV2SyncState constants.
	SyncState string `json:"syncState"`
	// The target device group IDs to which a benchmark is deployed.
	Target          *TargetV2 `json:"target,omitempty"`
	Title           string    `json:"title"`
	UpdateAvailable bool      `json:"updateAvailable"`
}

BenchmarkV2 Summary view of a compliance benchmark for list display.

type BenchmarkV2SyncState

type BenchmarkV2SyncState = string

BenchmarkV2SyncState is the set of values accepted by BenchmarkV2.SyncState.

const (
	BenchmarkV2SyncStateSynced       BenchmarkV2SyncState = "SYNCED"
	BenchmarkV2SyncStatePending      BenchmarkV2SyncState = "PENDING"
	BenchmarkV2SyncStateFailed       BenchmarkV2SyncState = "FAILED"
	BenchmarkV2SyncStateDeleting     BenchmarkV2SyncState = "DELETING"
	BenchmarkV2SyncStateDeleteFailed BenchmarkV2SyncState = "DELETE_FAILED"
)

BenchmarkV2SyncState values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func BenchmarkV2SyncStateValues

func BenchmarkV2SyncStateValues() []BenchmarkV2SyncState

BenchmarkV2SyncStateValues returns every value the Jamf API accepts for BenchmarkV2SyncState, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type BenchmarksResponseV2

type BenchmarksResponseV2 struct {
	Benchmarks []BenchmarkV2 `json:"benchmarks"`
}

BenchmarksResponseV2 List of compliance benchmarks for the tenant.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides typed methods for compliancebenchmarks operations.

func New

func New(base *jamfplatform.Client) *Client

New creates a compliancebenchmarks client that shares the authenticated transport of the given root client.

func (*Client) CreateBenchmark

func (c *Client) CreateBenchmark(ctx context.Context, request *BenchmarkRequestV2) (*BenchmarkResponseV2, error)

CreateBenchmark creates a new benchmark from provided benchmark request.

Required privileges: compliance-benchmarks:create.

func (*Client) DeleteBenchmark

func (c *Client) DeleteBenchmark(ctx context.Context, id string) error

DeleteBenchmark removes benchmark with given benchmark ID.

Required privileges: compliance-benchmarks:delete.

Parameters:

  • id: Given benchmark ID.

func (*Client) GetBaselineRules

func (c *Client) GetBaselineRules(ctx context.Context, baselineID string) (*SourcedRules, error)

GetBaselineRules returns list of rules for specific baseline.

Required privileges: compliance-benchmarks:read.

Parameters:

  • baselineID: Given baseline ID.

func (*Client) GetBenchmark

func (c *Client) GetBenchmark(ctx context.Context, id string) (*BenchmarkResponseV2, error)

GetBenchmark returns benchmark for given benchmark ID.

Required privileges: compliance-benchmarks:read.

Parameters:

  • id: Given benchmark ID.

func (*Client) GetBenchmarkCompliancePercentage

func (c *Client) GetBenchmarkCompliancePercentage(ctx context.Context, id string) (*CompliancePercentage, error)

GetBenchmarkCompliancePercentage get compliance percentage for a benchmark report.

Required privileges: compliance-benchmarks:read.

Parameters:

  • id: Tenant's benchmark ID.

func (*Client) ListBaselines

func (c *Client) ListBaselines(ctx context.Context) (*BaselinesResponse, error)

ListBaselines returns list of the mSCP baselines.

Required privileges: compliance-benchmarks:read.

func (*Client) ListBenchmarkRuleDevices

func (c *Client) ListBenchmarkRuleDevices(ctx context.Context, id string, ruleID string, sort string, deviceSearch string, ruleResult string) ([]DeviceRuleResult, error)

ListBenchmarkRuleDevices get devices for a benchmark report rule.

Required privileges: compliance-benchmarks:read.

Parameters:

  • id: Tenant's benchmark ID.
  • sort: Sort order of result (e.g., 'deviceName:asc', 'ruleResult:desc'). Supports chained sorting like 'deviceName,ruleResult:desc'. Ascending order is default and in such a case doesn't require to be specified.
  • deviceSearch: Search devices with matching device name or device ID.
  • ruleResult: Allowed values: see the RuleResultState constants.

func (*Client) ListBenchmarkRulesStats

func (c *Client) ListBenchmarkRulesStats(ctx context.Context, id string, sort string, ruleSearch string) ([]RuleResult, error)

ListBenchmarkRulesStats get benchmark rules for a tenant.

Required privileges: compliance-benchmarks:read.

Parameters:

  • id: Tenant's benchmark ID.
  • sort: Sort order of result (e.g., 'ruleTitle:asc', 'passed:desc', 'failed:desc', 'unknown:desc'). Supports chained sorting like 'ruleId,passed:desc'. Ascending order is default and in such a case doesn't require to be specified, such as 'ruleNumber,ruleTitle'.
  • ruleSearch: string to search in rule title and rule id.

func (*Client) ListBenchmarks

func (c *Client) ListBenchmarks(ctx context.Context) (*BenchmarksResponseV2, error)

ListBenchmarks returns list of tenant benchmarks.

Required privileges: compliance-benchmarks:read.

func (*Client) ResolveBaselineByName

func (c *Client) ResolveBaselineByName(ctx context.Context, name string) (*BaselineInfo, error)

ResolveBaselineByName looks up a Baseline by its title field and returns the decoded resource. Shares the same HTTP call as the ID-only variant; error semantics are identical.

func (*Client) ResolveBaselineIDByName

func (c *Client) ResolveBaselineIDByName(ctx context.Context, name string) (string, error)

ResolveBaselineIDByName looks up a Baseline by its title field and returns the ID. Returns *APIResponseError with HasStatus(404) when no match exists, or *AmbiguousMatchError when multiple resources share the name.

func (*Client) ResolveBenchmarkByName

func (c *Client) ResolveBenchmarkByName(ctx context.Context, name string) (*BenchmarkV2, error)

ResolveBenchmarkByName looks up a Benchmark by its title field and returns the decoded resource. Shares the same HTTP call as the ID-only variant; error semantics are identical.

func (*Client) ResolveBenchmarkIDByName

func (c *Client) ResolveBenchmarkIDByName(ctx context.Context, name string) (string, error)

ResolveBenchmarkIDByName looks up a Benchmark by its title field and returns the ID. Returns *APIResponseError with HasStatus(404) when no match exists, or *AmbiguousMatchError when multiple resources share the name.

type CompliancePercentage

type CompliancePercentage struct {
	CompliancePercentage float32 `json:"compliancePercentage"`
}

CompliancePercentage represents a compliance percentage.

type DeviceRuleResult

type DeviceRuleResult struct {
	// Device Platform ID.
	DeviceID   string          `json:"deviceId"`
	DeviceName *string         `json:"deviceName,omitempty"`
	State      RuleResultState `json:"state"`
}

DeviceRuleResult represents a device rule result.

type ODVRecommendation

type ODVRecommendation struct {
	Hint  string `json:"hint"`
	Value string `json:"value"`
}

ODVRecommendation Recommended value and hint for an organization-defined value (ODV) field.

type ODVRequest

type ODVRequest struct {
	Value string `json:"value"`
}

ODVRequest User-supplied value for an organization-defined value (ODV) rule parameter.

type OrganizationDefinedValue

type OrganizationDefinedValue struct {
	Hint        string `json:"hint"`
	Placeholder string `json:"placeholder"`
	// Allowed values: see the OrganizationDefinedValueType constants.
	Type string `json:"type"`
	// Validation constraints for an organization-defined value (ODV), specifying allowed range, enum
	// values, or regex pattern.
	Validation *ValidationConstraints `json:"validation,omitempty"`
	Value      string                 `json:"value"`
}

OrganizationDefinedValue An organization-defined value (ODV) that customizes a parameterized compliance rule.

type OrganizationDefinedValueType

type OrganizationDefinedValueType = string

OrganizationDefinedValueType is the set of values accepted by OrganizationDefinedValue.Type.

const (
	OrganizationDefinedValueTypeInteger OrganizationDefinedValueType = "INTEGER"
	OrganizationDefinedValueTypeString  OrganizationDefinedValueType = "STRING"
	OrganizationDefinedValueTypeEnum    OrganizationDefinedValueType = "ENUM"
	OrganizationDefinedValueTypeRegex   OrganizationDefinedValueType = "REGEX"
	OrganizationDefinedValueTypeBoolean OrganizationDefinedValueType = "BOOLEAN"
)

OrganizationDefinedValueType values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func OrganizationDefinedValueTypeValues

func OrganizationDefinedValueTypeValues() []OrganizationDefinedValueType

OrganizationDefinedValueTypeValues returns every value the Jamf API accepts for OrganizationDefinedValueType, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type OsInfo

type OsInfo struct {
	// Allowed values: see the OsInfoManagementType constants.
	ManagementType string `json:"managementType"`
	// Allowed values: see the OsInfoOsType constants.
	OsType    string `json:"osType"`
	OsVersion int    `json:"osVersion"`
}

OsInfo Operating system type, version, and management type, uniquely identifying a supported OS target.

type OsInfoManagementType

type OsInfoManagementType = string

OsInfoManagementType is the set of values accepted by OsInfo.ManagementType.

const (
	OsInfoManagementTypeManaged OsInfoManagementType = "MANAGED"
	OsInfoManagementTypeByod    OsInfoManagementType = "BYOD"
)

OsInfoManagementType values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func OsInfoManagementTypeValues

func OsInfoManagementTypeValues() []OsInfoManagementType

OsInfoManagementTypeValues returns every value the Jamf API accepts for OsInfoManagementType, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type OsInfoOsType

type OsInfoOsType = string

OsInfoOsType is the set of values accepted by OsInfo.OsType.

const (
	OsInfoOsTypeMacOs    OsInfoOsType = "MAC_OS"
	OsInfoOsTypeIos      OsInfoOsType = "IOS"
	OsInfoOsTypeVisionOs OsInfoOsType = "VISION_OS"
)

OsInfoOsType values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func OsInfoOsTypeValues

func OsInfoOsTypeValues() []OsInfoOsType

OsInfoOsTypeValues returns every value the Jamf API accepts for OsInfoOsType, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type OsSpecificRuleInfo

type OsSpecificRuleInfo struct {
	Description string `json:"description"`
	// Recommended value and hint for an organization-defined value (ODV) field.
	ODV   *ODVRecommendation `json:"odv,omitempty"`
	Title string             `json:"title"`
}

OsSpecificRuleInfo OS-specific overrides for a compliance rule's title, description, and ODV recommendation.

type OsVersion

type OsVersion struct {
	// Operating system type.
	// Allowed values: see the OsVersionOsType constants.
	OsType string `json:"osType"`
	// Operating system version number.
	OsVersion int `json:"osVersion"`
}

OsVersion The selected OS versions for this benchmark, default is all available baseline OS versions.

type OsVersionOsType

type OsVersionOsType = string

OsVersionOsType is the set of values accepted by OsVersion.OsType.

const (
	OsVersionOsTypeMacOs    OsVersionOsType = "MAC_OS"
	OsVersionOsTypeIos      OsVersionOsType = "IOS"
	OsVersionOsTypeVisionOs OsVersionOsType = "VISION_OS"
)

OsVersionOsType values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func OsVersionOsTypeValues

func OsVersionOsTypeValues() []OsVersionOsType

OsVersionOsTypeValues returns every value the Jamf API accepts for OsVersionOsType, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type RuleInfo

type RuleInfo struct {
	Description string `json:"description"`
	Enabled     bool   `json:"enabled"`
	ID          string `json:"id"`
	// An organization-defined value (ODV) that customizes a parameterized compliance rule.
	ODV                *OrganizationDefinedValue     `json:"odv,omitempty"`
	OsSpecificDefaults map[string]OsSpecificRuleInfo `json:"osSpecificDefaults"`
	References         *[]string                     `json:"references,omitempty"`
	Reportable         bool                          `json:"reportable"`
	// Dependency and conflict relationships between compliance rules.
	RuleRelation *RuleRelation `json:"ruleRelation,omitempty"`
	SectionName  string        `json:"sectionName"`
	SmartCard    bool          `json:"smartCard"`
	SupportedOs  []OsInfo      `json:"supportedOs"`
	Title        string        `json:"title"`
}

RuleInfo A compliance rule definition including its title, description, enabled state, supported OS targets, and optional ODV configuration.

type RuleRelation

type RuleRelation struct {
	ConflictsWith   []string `json:"conflictsWith"`
	DefaultDisabled bool     `json:"defaultDisabled"`
	DependsOn       []string `json:"dependsOn"`
}

RuleRelation Dependency and conflict relationships between compliance rules.

type RuleRequest

type RuleRequest struct {
	Enabled bool   `json:"enabled"`
	ID      string `json:"id"`
	// User-supplied value for an organization-defined value (ODV) rule parameter.
	ODV *ODVRequest `json:"odv,omitempty"`
}

RuleRequest A rule configuration within a benchmark request, specifying the rule ID, enabled state, and optional ODV value.

type RuleResult

type RuleResult struct {
	Discussion      string  `json:"discussion"`
	Failed          int     `json:"failed"`
	NumberOfDevices int     `json:"numberOfDevices"`
	PassPercentage  float32 `json:"passPercentage"`
	Passed          int     `json:"passed"`
	RuleID          string  `json:"ruleId"`
	// Rule number in the benchmark, if applicable. E.g. CIS numbers like '2.5.1.1'.
	RuleNumber string `json:"ruleNumber"`
	RuleTitle  string `json:"ruleTitle"`
	Unknown    int    `json:"unknown"`
}

RuleResult represents a rule result.

type RuleResultState

type RuleResultState = string

RuleResultState represents a rule result state value.

const (
	RuleResultStatePassed  RuleResultState = "PASSED"
	RuleResultStateFailed  RuleResultState = "FAILED"
	RuleResultStateUnknown RuleResultState = "UNKNOWN"
)

RuleResultState values accepted by the Jamf API. The alias above is a string, so these constants pass to any parameter or field declared as a plain string.

func RuleResultStateValues

func RuleResultStateValues() []RuleResultState

RuleResultStateValues returns every value the Jamf API accepts for RuleResultState, in the order the spec declares them. Returns a fresh slice per call, so no caller can corrupt the set for the rest of the process — which a package level var would allow. Suits attribute validation (Terraform's stringvalidator.OneOf, say) and anything that needs to enumerate the set rather than name one member.

type Source

type Source struct {
	Branch   string `json:"branch"`
	Revision string `json:"revision"`
}

Source A Git source reference identifying a branch and revision of the compliance rules repository.

type SourcedRules

type SourcedRules struct {
	AvailableOsVersions []OsVersion `json:"availableOsVersions"`
	Rules               []RuleInfo  `json:"rules"`
	Sources             []Source    `json:"sources"`
}

SourcedRules A set of compliance rules sourced from one or more Git branches, with the available OS versions.

type TargetV2

type TargetV2 struct {
	DeviceGroups []string `json:"deviceGroups"`
}

TargetV2 The target device group IDs to which a benchmark is deployed.

type ValidationConstraints

type ValidationConstraints struct {
	EnumValues []string `json:"enumValues"`
	Max        int      `json:"max"`
	Min        int      `json:"min"`
	Regex      string   `json:"regex"`
}

ValidationConstraints Validation constraints for an organization-defined value (ODV), specifying allowed range, enum values, or regex pattern.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL