@@ -2153,6 +2153,7 @@ func getOrborusStats(ctx context.Context, sensorMode shuffle.SensorMode) shuffle
21532153 }
21542154
21552155 newStats .SensorDetails .InstalledSoftware = []shuffle.Software {}
2156+ newStats .SensorDetails .CodeScanner = []shuffle.ProjectInfo {}
21562157 return newStats
21572158 }
21582159 // If there's an error, we ignore the cache and continue to gather details
@@ -2174,19 +2175,24 @@ func getOrborusStats(ctx context.Context, sensorMode shuffle.SensorMode) shuffle
21742175 newStats .SensorDetails .ElevatedAccess = shuffle .IsElevated ()
21752176 newStats .SensorDetails .Serial = shuffle .GetProfiler ()
21762177
2177- if sensorMode .SoftwareListEnabled {
2178+ if sensorMode .SoftwareListEnabled == "true" {
21782179 // Check cache first before running the command
21792180 newStats .SensorDetails .InstalledSoftware = shuffle .ListInstalledSoftware ()
21802181 }
21812182
2182- if sensorMode .HdEncryptedCheck {
2183+ if sensorMode .CodeScannerEnabled == "true" {
2184+ newStats .SensorDetails .CodeScanner = shuffle .ListCodeScannerProjects ()
2185+ }
2186+
2187+ if sensorMode .HdEncryptedCheck == "true" {
21832188 newStats .SensorDetails .HdEncrypted = fmt .Sprintf ("%t" , shuffle .IsDiskEncrypted ())
21842189 }
21852190
2186- if sensorMode .ScreenlockCheck {
2191+ if sensorMode .ScreenlockCheck == "true" {
21872192 newStats .SensorDetails .AutomaticScreenlockEnabled = fmt .Sprintf ("%t" , shuffle .IsAutomaticScreenlockEnabled ())
21882193 }
21892194
2195+
21902196 if len (sensorMode .LogForwarding ) > 0 {
21912197 newStats .SensorDetails .LogForwarding = fmt .Sprintf ("not implemented: %s" , sensorMode .LogForwarding )
21922198 }
@@ -2520,9 +2526,10 @@ func mainLoop() {
25202526 sensorMode := shuffle.SensorMode {
25212527 Enabled : os .Getenv ("SHUFFLE_AGENT_SENSOR_MODE" ) == "true" ,
25222528
2523- SoftwareListEnabled : os .Getenv ("SHUFFLE_SOFTWARE_LIST_ENABLED" ) == "true" ,
2524- HdEncryptedCheck : os .Getenv ("SHUFFLE_HD_ENCRYPTED_CHECK" ) == "true" ,
2525- ScreenlockCheck : os .Getenv ("SHUFFLE_SCREENLOCK_CHECK" ) == "true" ,
2529+ SoftwareListEnabled : os .Getenv ("SHUFFLE_SOFTWARE_LIST_ENABLED" ),
2530+ CodeScannerEnabled : os .Getenv ("SHUFFLE_CODE_SCANNER_ENABLED" ),
2531+ HdEncryptedCheck : os .Getenv ("SHUFFLE_HD_ENCRYPTED_CHECK" ),
2532+ ScreenlockCheck : os .Getenv ("SHUFFLE_SCREENLOCK_CHECK" ),
25262533
25272534 LogForwarding : os .Getenv ("SHUFFLE_LOG_FORWARDING" ),
25282535 ResponseActions : os .Getenv ("SHUFFLE_RESPONSE_ACTIONS" ),
@@ -2594,6 +2601,20 @@ func mainLoop() {
25942601
25952602 }
25962603
2604+ // Autoconfig these. They are off if set to false
2605+ if len (sensorMode .SoftwareListEnabled ) == 0 {
2606+ sensorMode .SoftwareListEnabled = "true"
2607+ }
2608+ if len (sensorMode .CodeScannerEnabled ) == 0 {
2609+ sensorMode .CodeScannerEnabled = "true"
2610+ }
2611+ if len (sensorMode .HdEncryptedCheck ) == 0 {
2612+ sensorMode .HdEncryptedCheck = "true"
2613+ }
2614+ if len (sensorMode .ScreenlockCheck ) == 0 {
2615+ sensorMode .ScreenlockCheck = "true"
2616+ }
2617+
25972618 log .Printf ("[INFO] Running in sensor/agent mode. Starting the agent." )
25982619 err := StartAgentSensor (sensorMode )
25992620 if err != nil {
0 commit comments