Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run executes enterprise telemetry: scan, build payload, upload to S3. Output format matches the shell script's sample_log:
========================================== StepSecurity Device Agent v1.9.1 ========================================== [scanning] Lock acquired (PID: 32560) [scanning] Device ID (Serial): ... ...
Types ¶
type ExecutionLogs ¶
type LogCapture ¶
type LogCapture struct {
// contains filtered or unexported fields
}
LogCapture captures all stderr output during telemetry execution. The captured output is base64-encoded and included in the execution_logs payload.
Nesting with internal/progress/filelog: when filelog is active, os.Stderr is already the filelog pipe's write end. StartCapture saves that value as origErr, swaps os.Stderr to its own pipe, and on Finalize restores os.Stderr = origErr — re-enabling the filelog tee. Do not change Finalize to assign os.Stderr to the "real" stderr directly; that would orphan filelog mid-run and lose the suffix of the log file.
func StartCapture ¶
func StartCapture() *LogCapture
StartCapture redirects stderr to a tee that writes to both the original stderr and an in-memory buffer for later base64 encoding.
func (*LogCapture) Finalize ¶
func (lc *LogCapture) Finalize() string
Finalize stops capture and returns the base64-encoded output. Safe to call multiple times — subsequent calls return the cached result.
func (*LogCapture) Fprintf ¶
func (lc *LogCapture) Fprintf(format string, args ...any)
Fprintf is a convenience method.
type Payload ¶
type Payload struct {
CustomerID string `json:"customer_id"`
DeviceID string `json:"device_id"`
SerialNumber string `json:"serial_number"`
UserIdentity string `json:"user_identity"`
Hostname string `json:"hostname"`
Platform string `json:"platform"`
OSVersion string `json:"os_version"`
Resources model.MachineResources `json:"resources"`
AgentVersion string `json:"agent_version"`
CollectedAt int64 `json:"collected_at"`
NoUserLoggedIn bool `json:"no_user_logged_in"`
IDEExtensions []model.Extension `json:"ide_extensions"`
IDEInstallations []model.IDE `json:"ide_installations"`
NodePkgManagers []model.PkgManager `json:"node_package_managers"`
NodeGlobalPackages []model.NodeScanResult `json:"node_global_packages"`
NodeProjects []model.NodeScanResult `json:"node_projects"`
BrewPkgManager *model.PkgManager `json:"brew_package_manager,omitempty"`
BrewScans []model.BrewScanResult `json:"brew_scans"`
BrewFormulae []model.BrewPackage `json:"brew_formulae,omitempty"`
BrewCasks []model.BrewPackage `json:"brew_casks,omitempty"`
PythonPkgManagers []model.PkgManager `json:"python_package_managers"`
PythonGlobalPackages []model.PythonScanResult `json:"python_global_packages"`
PythonProjects []model.ProjectInfo `json:"python_projects"`
SystemPackageScans []model.SystemPackageScanResult `json:"system_package_scans"`
AIAgents []model.AITool `json:"ai_agents"`
MCPConfigs []model.MCPConfigEnterprise `json:"mcp_configs"`
NPMRCAudit *model.NPMRCAudit `json:"npmrc_audit,omitempty"`
PipAudit *model.PipAudit `json:"pip_audit,omitempty"`
ExecutionLogs *ExecutionLogs `json:"execution_logs,omitempty"`
PerformanceMetrics *PerformanceMetrics `json:"performance_metrics,omitempty"`
}
Payload is the enterprise telemetry JSON structure.
type PerformanceMetrics ¶
type PerformanceMetrics struct {
ExtensionsCount int `json:"extensions_count"`
NodePackagesScanMs int64 `json:"node_packages_scan_ms"`
NodeGlobalPkgsCount int `json:"node_global_packages_count"`
NodeProjectsCount int `json:"node_projects_count"`
BrewFormulaeCount int `json:"brew_formulae_count"`
BrewCasksCount int `json:"brew_casks_count"`
PythonGlobalPkgsCount int `json:"python_global_packages_count"`
PythonProjectsCount int `json:"python_projects_count"`
SystemPackagesCount int `json:"system_packages_count"`
}