Documentation ¶
Index ¶
- Constants
- Variables
- func BulkInsertComplianceReportDocs(client *elastic.Client, ctx context.Context, index string, ...) error
- func BulkInsertComplianceSummaryDocs(client *elastic.Client, ctx context.Context, index string, ...) error
- func FetchLatestDataOrNot(filters map[string][]string) bool
- func FilterByProjects(ctx context.Context, filters map[string][]string) (map[string][]string, error)
- func GetEsIndex(filters map[string][]string, useSummaryIndex bool) (esIndex string, err error)
- func GetFilterDepth(filters map[string][]string) int
- func GetMaxInnerResultWindow(backend ES2Backend) (int64, error)
- func IndexDates(prefix string, startTimeAsStringRFC3339 string, endTimeAsStringRFC3339 string) (indices string, err error)
- func LogQueryPartMin(indices string, partToPrint interface{}, name string)
- func MapKeys(m map[string]string) []string
- func MapValues(m map[string]string) []string
- func Remove(arr *[]string, i int)
- func ReportComplianceStatus(summary *reportingTypes.NodeControlSummary) (status string)
- func ResetClockImplementation()
- func RunMigrations(backend ES2Backend, statusSrv *statusserver.Server) error
- func SetMaxInnerResultWindow(backend ES2Backend) error
- func StoreExists(client *elastic.Client, indexName string) (bool, error)
- func ValidateTimeRangeForFilters(startTime string, endTime string) error
- type A1ElasticSearchIndices
- type A2V1ElasticSearchIndices
- type A2V2CompRunIndices
- type A2V2ElasticSearchIndices
- type A2V3ElasticSearchIndices
- type A2V4ElasticSearchIndices
- type A2V5ElasticSearchIndices
- type A2V6ElasticSearchIndices
- type AggregatedComplianceSummary
- type AggregatedComplianceSummaryA2v2
- type AssetSummary
- type Control
- type ControlDepth
- type ControlMeta
- type ControlMetaA2v2
- type ControlNodesInfo
- type ControlRunInfo
- type ControlSource
- type ControlStatSummary
- type ControlStatSummaryA2v2
- type ControlStats
- type ControlStatsA2v2
- type DateRange
- type Depends
- type DependsA2v2
- type Depth
- type ES2Backend
- func (backend *ES2Backend) ES2Client() (*elastic.Client, error)
- func (backend *ES2Backend) GetAllProfilesFromNodes(from int32, size int32, filters map[string][]string, sort_field string, ...) ([]*reportingapi.ProfileMin, *reportingapi.ProfileCounts, error)
- func (backend ES2Backend) GetAsset(ctx context.Context, filters map[string][]string, size int32, from int32, ...) ([]*reportingapi.Assets, error)
- func (backend ES2Backend) GetAssetSummary(ctx context.Context, filters map[string][]string) (*reportingapi.AssetSummary, error)
- func (backend ES2Backend) GetConfigs(ctx context.Context) (int, error)
- func (backend *ES2Backend) GetControlListItems(ctx context.Context, filters map[string][]string, size int32, pageNumber int32) (*reportingapi.ControlItems, error)
- func (backend *ES2Backend) GetControlListItemsRange(ctx context.Context, filters map[string][]string, size int32, pageNumber int32) (*reportingapi.ControlItems, error)
- func (backend ES2Backend) GetControlListStatsByProfileID(profileID string, from int, size int, filters map[string][]string, ...) ([]*stats.ControlStats, error)
- func (backend *ES2Backend) GetNode(nodeUuid string, filters map[string][]string) (*reportingapi.Node, error)
- func (backend *ES2Backend) GetNodeControlListItems(ctx context.Context, filters map[string][]string, reportID string) (*reportingapi.ControlElements, error)
- func (backend *ES2Backend) GetNodeInfoFromReportID(reportId string, filters map[string][]string) (*reportingapi.NodeHeaderInfo, error)
- func (backend *ES2Backend) GetNodes(from int32, size int32, filters map[string][]string, sortField string, ...) ([]*reportingapi.Node, TotalNodeCounts, error)
- func (backend *ES2Backend) GetProfile(hash string) (reportingapi.Profile, error)
- func (backend ES2Backend) GetProfileListWithAggregatedComplianceSummaries(filters map[string][]string, size int32) ([]*stats.ProfileList, error)
- func (backend ES2Backend) GetProfileSummaryByProfileId(profileId string, filters map[string][]string) (*stats.ProfileSummary, error)
- func (backend *ES2Backend) GetReport(reportId string, filters map[string][]string) (*reportingapi.Report, error)
- func (backend ES2Backend) GetReportIds(esIndex string, filters map[string][]string) (*reportingapi.ReportIds, error)
- func (backend *ES2Backend) GetReportManagerRequest(reportId string, filters map[string][]string) (*reportingapi.ReportResponse, error)
- func (backend *ES2Backend) GetReports(from int32, size int32, filters map[string][]string, sortField string, ...) ([]*reportingapi.ReportSummaryLevelOne, int64, error)
- func (backend ES2Backend) GetStatsFailures(reportTypes []string, size int, filters map[string][]string) (*stats.Failures, error)
- func (backend ES2Backend) GetStatsSummary(filters map[string][]string) (*stats.ReportSummary, error)
- func (backend ES2Backend) GetStatsSummaryControls(filters map[string][]string) (*stats.ControlsSummary, error)
- func (backend ES2Backend) GetStatsSummaryControlsRange(filters map[string][]string) (*stats.ControlsSummary, error)
- func (backend ES2Backend) GetStatsSummaryNodes(filters map[string][]string) (*stats.NodeSummary, error)
- func (backend ES2Backend) GetSuggestions(ctx context.Context, typeParam string, filters map[string][]string, ...) ([]*reportingapi.Suggestion, error)
- func (backend ES2Backend) GetTrend(filters map[string][]string, interval int, trendType string) ([]*stats.Trend, error)
- func (backend ES2Backend) GetUniqueNodesCount(daysSinceLastPost int64, lastTelemetryReportedAt time.Time) (int64, error)
- func (backend ES2Backend) GetUnreachable(ctx context.Context, filters map[string][]string) (int32, error)
- func (backend ES2Backend) NewDepth(filters map[string][]string, latestOnly bool) (Depth, error)
- func (backend *ES2Backend) ReindexStatus(ctx context.Context, taskID string) (bool, error)
- func (backend ES2Backend) StoreProfile(profile inspec.Profile) error
- type ESComplianceRunInfo
- type ESInSpecReport
- type ESInSpecReportA2v2
- type ESInSpecReportControl
- type ESInSpecReportControlA2v2
- type ESInSpecReportControlRefs
- type ESInSpecReportControlRemovedResultsCounts
- type ESInSpecReportControlStringTags
- type ESInSpecReportControlsResult
- type ESInSpecReportControlsResultA2v2
- type ESInSpecReportControlsWaiverData
- type ESInSpecReportDepends
- type ESInSpecReportDependsA2v2
- type ESInSpecReportMinA2v2
- type ESInSpecReportProfile
- type ESInSpecReportProfileA2v2
- type ESInSpecSummary
- type ESInSpecSummaryA2v2
- type ESInSpecSummaryProfile
- type ESInspecAttribute
- type ESInspecControl
- type ESInspecProfile
- type ESInspecProfileControlSummaryA2v2
- type ESMigrationInfo
- type EndTimeSource
- type EnvironmentStatSummary
- type EnvironmentStatSummaryA2v2
- type Failure
- type FailureA2v2
- type FirstRunInfo
- type Node
- type NodeControlSummaryA2v2
- type NodeListWithAggregatedComplianceSummary
- type NodeListWithAggregatedComplianceSummaryA2v2
- type NodesControlInfo
- type NodesUpgradation
- type OS
- type OSA2v2
- type PassedFailedSkipped
- type PassedFailedSkippedA2v2
- type Platform
- type PlatformA2v2
- type PlatformStatSummary
- type PlatformStatSummaryA2v2
- type Profile
- type ProfileDepth
- type ProfileListWithAggregatedComplianceSummary
- type ProfileListWithAggregatedComplianceSummaryA2v2
- type ProfileMinA2v2
- type ProfileRunInfo
- type ProfileSource
- type ProfileStatSummary
- type ProfileStatSummaryA2v2
- type QueryInfo
- type ReportDepth
- type ReportId
- type ReportingTransport
- type StatsComplianceSummary
- type StatsComplianceSummaryA2v2
- type StatsTopFailures
- type StatsTopFailuresA2v2
- type Status
- type Straddle
- type Suggestion
- type SuggestionA2v2
- type TimeBucketedReportIds
- type TotalNodeCounts
- type TrendBucket
Constants ¶
const ( WholeCalMonthBadDateRangeErrMsg string = "" /* 147-byte string literal not displayed */ StartDateGreaterThanEndDateErrMsg string = "bad date range. end date must be greater than or equal to start date" RestOfDaysDiffMonthOrYearErrMsg string = "restOfDays only computes indices within the same month. spanning months not supported" TimeParseError string = "could not parse %s error: %s. please check format of date" CompDailySumIndexPrefix string = mappings.IndexNameSum + "-" CompDailyRepIndexPrefix string = mappings.IndexNameRep + "-" CompDailyControlIndexPrefix string = mappings.IndexNameControl + "-" ComplianceDailySumTwenty string = CompDailySumIndexPrefix + "20*" ComplianceDailyRepTwenty string = CompDailyRepIndexPrefix + "20*" CompProfilesIndex string = mappings.IndexNameProf CompRunInfoIndex string = mappings.IndexNameComplianceRunInfo )
const ( InvalidLevel = iota - 1 ReportLevel ProfileLevel ControlLevel )
const MaxScrollRecordSize = 10000
Variables ¶
var NowFunc nowFuncT
Functions ¶
func FetchLatestDataOrNot ¶
func FilterByProjects ¶
func GetEsIndex ¶
GetEsIndex returns the index(s) to query based on the end_time filter A good reason would be when you pass a job_id and you don't know when it ran so you want to search all indices
func GetFilterDepth ¶
func GetMaxInnerResultWindow ¶
func GetMaxInnerResultWindow(backend ES2Backend) (int64, error)
func IndexDates ¶
func IndexDates(prefix string, startTimeAsStringRFC3339 string, endTimeAsStringRFC3339 string) (indices string, err error)
IndexDates takes a start time and end time, both as strings, formatted as RFC3339 UTC, and returns a comma separated list of strings, each of which is an ES index wildcard.
func LogQueryPartMin ¶
func ReportComplianceStatus ¶
func ReportComplianceStatus(summary *reportingTypes.NodeControlSummary) (status string)
ReportComplianceStatus returns the overall compliance status of a report based on the passed/failed/skipped control counts
func ResetClockImplementation ¶
func ResetClockImplementation()
func RunMigrations ¶
func RunMigrations(backend ES2Backend, statusSrv *statusserver.Server) error
func SetMaxInnerResultWindow ¶
func SetMaxInnerResultWindow(backend ES2Backend) error
Types ¶
type A1ElasticSearchIndices ¶
type A1ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type A2V1ElasticSearchIndices ¶
type A2V1ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type A2V2CompRunIndices ¶
type A2V2CompRunIndices struct {
// contains filtered or unexported fields
}
type A2V2ElasticSearchIndices ¶
type A2V2ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type A2V3ElasticSearchIndices ¶
type A2V3ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type A2V4ElasticSearchIndices ¶
type A2V4ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type A2V5ElasticSearchIndices ¶
type A2V5ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type A2V6ElasticSearchIndices ¶
type A2V6ElasticSearchIndices struct {
// contains filtered or unexported fields
}
type AssetSummary ¶
type Control ¶
type Control struct { ControlID string `json:"control_id"` Title string `json:"title"` WaivedStr string `json:"waived_str"` WaiverData interface{} `json:"waiver_data"` Impact float64 `json:"impact"` EndTime time.Time `json:"end_time"` DailyLatest bool `json:"daily_latest"` DayLatest bool `json:"day_latest"` Status string `json:"status"` Nodes []Node `json:"nodes"` StringTags []ESInSpecReportControlStringTags `json:"string_tags"` Profile Profile `json:"profile"` }
type ControlDepth ¶
type ControlDepth struct {
*QueryInfo
}
type ControlMeta ¶
ControlMeta is for getting extra info from inspec_profiles needed for report 8
type ControlMetaA2v2 ¶
ControlMeta is for getting extra info from inspec_profiles needed for report 8
type ControlNodesInfo ¶
type ControlNodesInfo struct { Status string `json:"status"` Nodes []NodesControlInfo `json:"nodes"` }
type ControlRunInfo ¶
type ControlRunInfo struct { ID string `json:"id"` ControlTags []ESInSpecReportControlStringTags `json:"control_tags"` }
type ControlSource ¶
type ControlStatSummary ¶
type ControlStatSummaryA2v2 ¶
type ControlStats ¶
type ControlStatsA2v2 ¶
type DependsA2v2 ¶
type ES2Backend ¶
type ES2Backend struct { ESUrl string Enterprise string ChefDeliveryUser string ChefDeliveryToken string PGdb *pgdb.DB IsEnhancedReportingEnabled bool }
func (*ES2Backend) GetAllProfilesFromNodes ¶
func (backend *ES2Backend) GetAllProfilesFromNodes(from int32, size int32, filters map[string][]string, sort_field string, sort_asc bool) ([]*reportingapi.ProfileMin, *reportingapi.ProfileCounts, error)
TODO: header with amount of results GetAllProfilesFromNodes - list all of the profiles from scan data
func (ES2Backend) GetAssetSummary ¶
func (backend ES2Backend) GetAssetSummary(ctx context.Context, filters map[string][]string) (*reportingapi.AssetSummary, error)
func (ES2Backend) GetConfigs ¶
func (backend ES2Backend) GetConfigs(ctx context.Context) (int, error)
func (*ES2Backend) GetControlListItems ¶
func (backend *ES2Backend) GetControlListItems(ctx context.Context, filters map[string][]string, size int32, pageNumber int32) (*reportingapi.ControlItems, error)
func (*ES2Backend) GetControlListItemsRange ¶
func (backend *ES2Backend) GetControlListItemsRange(ctx context.Context, filters map[string][]string, size int32, pageNumber int32) (*reportingapi.ControlItems, error)
func (ES2Backend) GetControlListStatsByProfileID ¶
func (backend ES2Backend) GetControlListStatsByProfileID(profileID string, from int, size int, filters map[string][]string, sortField string, sortAsc bool) ([]*stats.ControlStats, error)
GetControlListStatsByProfileID returns the control list for a given profile or profile and a child control the data retrieved from this appears at the bottom of the a2 page when you select a profile from list
func (*ES2Backend) GetNode ¶
func (backend *ES2Backend) GetNode(nodeUuid string, filters map[string][]string) (*reportingapi.Node, error)
func (*ES2Backend) GetNodeControlListItems ¶
func (backend *ES2Backend) GetNodeControlListItems(ctx context.Context, filters map[string][]string, reportID string) (*reportingapi.ControlElements, error)
GetNodeControlListItems returns the paginated control list response.
func (*ES2Backend) GetNodeInfoFromReportID ¶
func (backend *ES2Backend) GetNodeInfoFromReportID(reportId string, filters map[string][]string) (*reportingapi.NodeHeaderInfo, error)
GetNodeInfoFromReportID returns report header information of a single report
func (*ES2Backend) GetNodes ¶
func (backend *ES2Backend) GetNodes(from int32, size int32, filters map[string][]string, sortField string, sortAsc bool) ([]*reportingapi.Node, TotalNodeCounts, error)
TODO: header with amount of results TODO: need to be able to sort on
"latest_report.controls.failed.total": "controls_sums.failed.total", "latest_report.controls.failed.critical": "controls_sums.failed.critical"
GetNodes - list all of the nodes or all nodes for a profile-id
func (*ES2Backend) GetProfile ¶
func (backend *ES2Backend) GetProfile(hash string) (reportingapi.Profile, error)
internal helper method to get profile information
func (ES2Backend) GetProfileListWithAggregatedComplianceSummaries ¶
func (backend ES2Backend) GetProfileListWithAggregatedComplianceSummaries( filters map[string][]string, size int32) ([]*stats.ProfileList, error)
GetProfileListWithAggregatedComplianceSummaries - Report #6 todo - Where in A2 UI is this being called? It now works with deep filtering but not sure if we need it.
func (ES2Backend) GetProfileSummaryByProfileId ¶
func (backend ES2Backend) GetProfileSummaryByProfileId(profileId string, filters map[string][]string) (*stats.ProfileSummary, error)
GetProfileSummaryByProfileId across nodes - report 8 - top this is the summary that appears at the top of the page when you select a profile from profiles list at the moment this one does not immediately need to be deep aware as the only things that are used from it in a2 api are version, maintainer and license todo - deep filtering - this should be made depth aware as this still needs to be consumed by api users todo - do we need to handle waiver info in here too?
func (*ES2Backend) GetReport ¶
func (backend *ES2Backend) GetReport(reportId string, filters map[string][]string) (*reportingapi.Report, error)
GetReport returns the information about a single report
func (ES2Backend) GetReportIds ¶
func (backend ES2Backend) GetReportIds(esIndex string, filters map[string][]string) (*reportingapi.ReportIds, error)
func (*ES2Backend) GetReportManagerRequest ¶
func (backend *ES2Backend) GetReportManagerRequest(reportId string, filters map[string][]string) (*reportingapi.ReportResponse, error)
GetReportManagerRequest takes report id and filters to populate the report manager request
func (*ES2Backend) GetReports ¶
func (backend *ES2Backend) GetReports(from int32, size int32, filters map[string][]string, sortField string, sortAsc bool) ([]*reportingapi.ReportSummaryLevelOne, int64, error)
GetReports returns all reports in a given timeframe TODO: support timeframe and pagination
func (ES2Backend) GetStatsFailures ¶
func (backend ES2Backend) GetStatsFailures(reportTypes []string, size int, filters map[string][]string) (*stats.Failures, error)
GetStatsFailures - Gets top failures, aggregate data for the given set of filters
func (ES2Backend) GetStatsSummary ¶
func (backend ES2Backend) GetStatsSummary(filters map[string][]string) (*stats.ReportSummary, error)
GetStatsSummary - Report #16
func (ES2Backend) GetStatsSummaryControls ¶
func (backend ES2Backend) GetStatsSummaryControls(filters map[string][]string) (*stats.ControlsSummary, error)
GetStatsSummaryControls - Gets summary stats, control centric, aggregate data for the given set of filters
func (ES2Backend) GetStatsSummaryControlsRange ¶
func (backend ES2Backend) GetStatsSummaryControlsRange(filters map[string][]string) (*stats.ControlsSummary, error)
GetStatsSummaryControlsRange - Gets summary stats, control centric, aggregate data for the given set of filters with date range
func (ES2Backend) GetStatsSummaryNodes ¶
func (backend ES2Backend) GetStatsSummaryNodes(filters map[string][]string) (*stats.NodeSummary, error)
GetStatsSummaryNodes - Gets summary stats, node centric, aggregate data for the given set of filters
func (ES2Backend) GetSuggestions ¶
func (backend ES2Backend) GetSuggestions(ctx context.Context, typeParam string, filters map[string][]string, text string, size32 int32, typeParamKey string) ([]*reportingapi.Suggestion, error)
GetSuggestions - Report #12
func (ES2Backend) GetTrend ¶
func (backend ES2Backend) GetTrend(filters map[string][]string, interval int, trendType string) ([]*stats.Trend, error)
GetTrend get either a nodes or controls trend graph
func (ES2Backend) GetUniqueNodesCount ¶
func (backend ES2Backend) GetUniqueNodesCount(daysSinceLastPost int64, lastTelemetryReportedAt time.Time) (int64, error)
GetUniqueNodesCount: Get the unique nodes count based on the lastTelemetryReportedAt
func (ES2Backend) GetUnreachable ¶
func (*ES2Backend) ReindexStatus ¶
func (ES2Backend) StoreProfile ¶
func (backend ES2Backend) StoreProfile(profile inspec.Profile) error
StoreProfile stores an InSpec profile to ES
type ESComplianceRunInfo ¶
type ESComplianceRunInfo struct { NodeID string `json:"node_uuid"` ResourceId string `json:""` ResourceType string `json:""` Status string `json:"status"` FirstRun time.Time `json:"first_run"` LastRun time.Time `json:"last_run"` Platform struct { Name string `json:"name"` Release string `json:"release"` Full string `json:"full"` } `json:"platform_version"` ChefServer string `json:"chef_server"` Organization string `json:"organization"` InspecVersion string `json:"version"` PolicyName string `json:"policy_name"` Profiles []ProfileRunInfo `json:"profiles"` Recipe []string `json:"recipes"` Role []string `json:"roles"` ChefTags []string `json:"chef_tags"` Environment string `json:"environment"` PolicyGroup string `json:"policy_group"` }
type ESInSpecReport ¶
type ESInSpecReport struct { ID string `json:"_id,omitempty"` InSpecVersion string `json:"version"` NodeID string `json:"node_uuid"` ReportID string `json:"report_uuid"` DailyLatest bool `json:"daily_latest"` DayLatest bool `json:"day_latest"` NodeName string `json:"node_name"` Environment string `json:"environment"` EndTime time.Time `json:"end_time"` Status string `json:"status"` StatusMessage string `json:"status_message"` JobID string `json:"job_uuid"` Roles []string `json:"roles"` Recipes []string `json:"recipes"` Platform struct { Name string `json:"name"` Release string `json:"release"` Full string `json:"full"` } `json:"platform"` ControlsSums reporting.NodeControlSummary `json:"controls_sums"` Profiles []ESInSpecReportProfile `json:"profiles"` Statistics struct { Duration float32 `json:"duration"` } `json:"statistics"` DocVersion string `json:"doc_version"` ESTimestamp string `json:"@timestamp"` Projects []string `json:"projects"` PolicyName string `json:"policy_name"` PolicyGroup string `json:"policy_group"` OrganizationName string `json:"organization_name"` SourceFQDN string `json:"source_fqdn"` ChefTags []string `json:"chef_tags"` // Elastic won't accept empty string for a field of data type 'ip'. Defining IPAddress // as pointer so we can assign null to it when we get a report without an IP IPAddress *string `json:"ipaddress"` FQDN string `json:"fqdn"` RunTimeLimit float32 `json:"run_time_limit"` }
Used to unmarshal report documents stored in comp-r-* ElasticSearch indices
type ESInSpecReportA2v2 ¶
type ESInSpecReportA2v2 struct { ID string `json:"_id,omitempty"` InSpecVersion string `json:"version"` NodeID string `json:"node_uuid"` ReportID string `json:"report_uuid"` DailyLatest bool `json:"daily_latest"` NodeName string `json:"node_name"` Environment string `json:"environment"` EndTime time.Time `json:"end_time"` Status string `json:"status"` JobID string `json:"job_uuid"` Roles []string `json:"roles"` Recipes []string `json:"recipes"` Platform struct { Name string `json:"name"` Release string `json:"release"` } `json:"platform"` Controls NodeControlSummaryA2v2 `json:"controls"` ProfilesMin []ESInSpecReportMinA2v2 `json:"profiles_min"` Profiles []ESInSpecReportProfileA2v2 `json:"profiles"` Statistics struct { Duration float32 `json:"duration"` } `json:"statistics"` DocVersion string `json:"doc_version"` ESTimestamp string `json:"@timestamp"` }
Main type for the report documents used in the timeseries
type ESInSpecReportControl ¶
type ESInSpecReportControl struct { ID string `json:"id"` Impact float32 `json:"impact"` Title string `json:"title"` Status string `json:"status"` Results []*ESInSpecReportControlsResult `json:"results"` WaiverData *ESInSpecReportControlsWaiverData `json:"waiver_data"` WaivedStr string `json:"waived_str"` Tags string `json:"tags"` StringTags []ESInSpecReportControlStringTags `json:"string_tags"` Refs []ESInSpecReportControlRefs `json:"refs"` RemovedResultsCounts *ESInSpecReportControlRemovedResultsCounts `json:"removed_results_counts"` }
type ESInSpecReportControlStringTags ¶
type ESInSpecReportControlStringTags struct { Key string `json:"key"` Values []string `json:"values"` }
func StringTagsFromProtoFields ¶
func StringTagsFromProtoFields(tKey string, tValue *structpb.Value) *ESInSpecReportControlStringTags
StringTagsFromProtoFields extracts tags supported from generic protobuf struct
type ESInSpecReportControlsResult ¶
type ESInSpecReportControlsResult struct { Status string `json:"status"` CodeDesc string `json:"code_desc"` RunTime float32 `json:"run_time"` StartTime string `json:"start_time,omitempty"` Message string `json:"message,omitempty"` SkipMessage string `json:"skip_message,omitempty"` ResourceId string `json:"resource_id"` }
type ESInSpecReportDepends ¶
type ESInSpecReportMinA2v2 ¶
type ESInSpecReportMinA2v2 struct { Name string `json:"name"` Version string `json:"version"` Namespace string `json:"namespace,omitempty"` SHA256 string `json:"sha256"` Controls []ESInSpecReportControlA2v2 `json:"controls"` Depends []ESInSpecReportDependsA2v2 `json:"depends"` Status string `json:"status"` SkipMessage string `json:"skip_message"` }
type ESInSpecReportProfile ¶
type ESInSpecReportProfile struct { Name string `json:"name"` Title string `json:"title"` Profile string `json:"profile"` Full string `json:"full"` Version string `json:"version"` Namespace string `json:"namespace,omitempty"` SHA256 string `json:"sha256"` Controls []ESInSpecReportControl `json:"controls"` ControlsSums reporting.NodeControlSummary `json:"controls_sums"` Depends []ESInSpecReportDepends `json:"depends"` Status string `json:"status"` SkipMessage string `json:"skip_message"` StatusMessage string `json:"status_message"` }
type ESInSpecReportProfileA2v2 ¶
type ESInSpecReportProfileA2v2 struct { Name string `json:"name"` Title string `json:"title"` Profile string `json:"profile"` Version string `json:"version"` Namespace string `json:"namespace,omitempty"` SHA256 string `json:"sha256"` Controls []ESInSpecReportControlA2v2 `json:"controls"` Depends []ESInSpecReportDependsA2v2 `json:"depends"` Status string `json:"status"` SkipMessage string `json:"skip_message"` }
type ESInSpecSummary ¶
type ESInSpecSummary struct { NodeID string `json:"node_uuid"` InSpecVersion string `json:"version"` ReportID string `json:"report_uuid"` DailyLatest bool `json:"daily_latest"` DayLatest bool `json:"day_latest"` NodeName string `json:"node_name"` Environment string `json:"environment"` EndTime time.Time `json:"end_time"` Status string `json:"status"` StatusMessage string `json:"status_message"` JobID string `json:"job_uuid"` Roles []string `json:"roles"` Recipes []string `json:"recipes"` Platform struct { Name string `json:"name"` Release string `json:"release"` Full string `json:"full"` } `json:"platform"` ControlsSums reporting.NodeControlSummary `json:"controls_sums"` Profiles []ESInSpecSummaryProfile `json:"profiles"` Statistics struct { Duration float32 `json:"duration"` } `json:"statistics"` DocVersion string `json:"doc_version"` ESTimestamp string `json:"@timestamp"` PolicyName string `json:"policy_name"` PolicyGroup string `json:"policy_group"` OrganizationName string `json:"organization_name"` SourceFQDN string `json:"source_fqdn"` ChefTags []string `json:"chef_tags"` Projects []string `json:"projects"` }
Used to unmarshal summary documents stored in comp-s-* ElasticSearch indices
type ESInSpecSummaryA2v2 ¶
type ESInSpecSummaryA2v2 struct { NodeID string `json:"node_uuid"` ReportID string `json:"report_uuid"` DailyLatest bool `json:"daily_latest"` NodeName string `json:"node_name"` Environment string `json:"environment"` EndTime time.Time `json:"end_time"` Status string `json:"status"` JobID string `json:"job_uuid"` Roles []string `json:"roles"` Recipes []string `json:"recipes"` Platform struct { Name string `json:"name"` Release string `json:"release"` } `json:"platform"` Controls NodeControlSummaryA2v2 `json:"controls"` ProfilesSums []ESInspecProfileControlSummaryA2v2 `json:"profiles_sums"` DocVersion string `json:"doc_version"` ESTimestamp string `json:"@timestamp"` }
Main type for the summary documents used in the timeseries
type ESInSpecSummaryProfile ¶
type ESInSpecSummaryProfile struct { Profile string `json:"profile"` Status string `json:"status"` Name string `json:"name"` Title string `json:"title"` Version string `json:"version"` Full string `json:"full"` SHA256 string `json:"sha256"` ControlsSums reporting.NodeControlSummary `json:"controls_sums"` }
type ESInspecAttribute ¶
type ESInspecControl ¶
type ESInspecControl struct { ID string `json:"id"` Code string `json:"code"` Desc string `json:"desc"` Impact float32 `json:"impact"` Title string `json:"title"` SourceLocation inspec.SourceLocation `json:"source_location"` Refs string `json:"refs"` Tags string `json:"tags"` Results []reportingapi.Result `json:"results,omitempty"` }
type ESInspecProfile ¶
type ESInspecProfile struct { Name string `json:"name"` Title string `json:"title"` Version string `json:"version"` Summary string `json:"summary"` Maintainer string `json:"maintainer"` License string `json:"license"` Copyright string `json:"copyright"` CopyrightEmail string `json:"copyright_email"` Controls []ESInspecControl `json:"controls"` Supports []*ingestinspec.Support `json:"supports"` Attributes []ESInspecAttribute `json:"attributes"` Dependencies []inspec.Dependency `json:"depends,omitempty"` Sha256 string `json:"sha256"` Groups []inspec.Group `json:"groups"` // ES specific not required by code, harmonized with logstash DocVersion string `json:"doc_version"` ESTimestamp string `json:"@timestamp"` }
type ESInspecProfileControlSummaryA2v2 ¶
type ESInspecProfileControlSummaryA2v2 struct { Profile string `json:"profile"` Status string `json:"status"` Controls NodeControlSummaryA2v2 `json:"controls"` }
type ESMigrationInfo ¶
type EndTimeSource ¶
type EnvironmentStatSummary ¶
type FailureA2v2 ¶
type FirstRunInfo ¶
type FirstRunInfo struct {
LastRun string `json:"last_run""`
}
type Node ¶
type Node struct { NodeUUID string `json:"node_uuid"` NodeEndTime time.Time `json:"node_end_time"` Status string `json:"status"` DayLatest bool `json:"day_latest"` DailyLatest bool `json:"daily_latest"` ReportUUID string `json:"report_uuid"` NodeName string `json:"node_name"` Environment string `json:"environment"` Roles []string `json:"roles"` Recipes []string `json:"recipes"` Platform struct { Name string `json:"name"` Release string `json:"release"` Full string `json:"full"` } `json:"platform"` PolicyName string `json:"policy_name"` PolicyGroup string `json:"policy_group"` OrganizationName string `json:"organization_name"` SourceFQDN string `json:"source_fqdn"` ChefTags []string `json:"chef_tags"` JobID string `json:"job_uuid"` }
type NodeControlSummaryA2v2 ¶
type NodeControlSummaryA2v2 struct { Total int `json:"total"` Passed struct { Total int `json:"total"` } `json:"passed"` Skipped struct { Total int `json:"total"` } `json:"skipped"` Failed struct { Total int `json:"total"` Minor int `json:"minor"` Major int `json:"major"` Critical int `json:"critical"` } `json:"failed"` }
type NodeListWithAggregatedComplianceSummaryA2v2 ¶
type NodeListWithAggregatedComplianceSummaryA2v2 struct { NodeID string `json:"node_id"` Name string `json:"node_name"` Environment string `json:"environment"` EndTime time.Time `json:"end_time"` Platform PlatformA2v2 `json:"platform"` Failed FailureA2v2 `json:"failed"` }
type NodesControlInfo ¶
type NodesUpgradation ¶
type PassedFailedSkipped ¶
type PassedFailedSkippedA2v2 ¶
type PlatformA2v2 ¶
type PlatformStatSummary ¶
type PlatformStatSummaryA2v2 ¶
type ProfileDepth ¶
type ProfileDepth struct {
*QueryInfo
}
type ProfileMinA2v2 ¶
type ProfileRunInfo ¶
type ProfileRunInfo struct { SHA256 string `json:"sha256"` Controls []ControlRunInfo `json:"controls"` Name string `json:"name"` Title string `json:"title"` Full string `json:"full"` }
type ProfileSource ¶
type ProfileStatSummary ¶
type ProfileStatSummaryA2v2 ¶
type ReportDepth ¶
type ReportDepth struct {
*QueryInfo
}
type ReportingTransport ¶
type ReportingTransport struct { Enterprise string ChefDeliveryUser string ChefDeliveryToken string }
ReportingTransport structure for Automate login
type StatsComplianceSummary ¶
type StatsTopFailures ¶
type StatsTopFailures struct { Profiles []ProfileStatSummary `json:"profiles,omitempty"` Platforms []PlatformStatSummary `json:"platforms,omitempty"` Controls []ControlStatSummary `json:"controls,omitempty"` Environments []EnvironmentStatSummary `json:"environments,omitempty"` }
type StatsTopFailuresA2v2 ¶
type StatsTopFailuresA2v2 struct { Profiles []ProfileStatSummaryA2v2 `json:"profiles,omitempty"` Platforms []PlatformStatSummaryA2v2 `json:"platforms,omitempty"` Controls []ControlStatSummaryA2v2 `json:"controls,omitempty"` Environments []EnvironmentStatSummaryA2v2 `json:"environments,omitempty"` }
type Suggestion ¶
type SuggestionA2v2 ¶
type TimeBucketedReportIds ¶
type TotalNodeCounts ¶
type TotalNodeCounts struct {
Total, Passed, Failed, Skipped, Waived int32
}
Source Files ¶
- assets.go
- depth.go
- es_types.go
- es_types_a2v2.go
- filters.go
- indices.go
- indices_settings.go
- migrations.go
- migrations_from_a1.go
- migrations_from_a2_v1.go
- migrations_from_a2_v2.go
- migrations_from_a2_v2_comp_run.go
- migrations_from_a2_v3.go
- migrations_from_a2_v4.go
- migrations_from_a2_v5.go
- migrations_from_a2_v6.go
- nodes.go
- profiles.go
- profiles_control_level.go
- profiles_profile_level.go
- profiles_report_level.go
- reports.go
- stats.go
- stats_control_level.go
- stats_profile_level.go
- stats_report_level.go
- suggestions.go
- trend.go
- trends_control_level.go
- trends_profile_level.go
- trends_report_level.go
- util.go