MCPcopy Create free account
hub / github.com/crashappsec/github-analyzer / AuditCoreStats

Method AuditCoreStats

pkg/github/org/org.go:488–519  ·  view source on GitHub ↗
(
	ctx context.Context)

Source from the content-addressed store, hash-verified

486}
487
488func (org *Organization) AuditCoreStats(
489 ctx context.Context) ([]issue.Issue, map[issue.IssueID]error, error) {
490 var issues []issue.Issue
491 execStatus := make(map[issue.IssueID]error, 2)
492
493 if org.CoreStats == nil {
494 log.Logger.Fatalf(
495 "It appears you don't have permissions to query this org",
496 )
497 }
498
499 if org.CoreStats.AdvancedSecurityEnabledForNewRepos == nil {
500 execStatus[issue.TOOLING_ADVANCED_SECURITY_DISABLED] = utils.PermissionsError
501 } else if !*org.CoreStats.AdvancedSecurityEnabledForNewRepos {
502 execStatus[issue.TOOLING_ADVANCED_SECURITY_DISABLED] = nil
503 issues = append(
504 issues,
505 issue.OrgAdvancedSecurityDisabled(*org.info.Login),
506 )
507 }
508
509 if org.CoreStats.SecretScanningEnabledForNewRepos == nil {
510 execStatus[issue.INF_DISC_SECRET_SCANNING_DISABLED] = utils.PermissionsError
511 } else if !*org.CoreStats.SecretScanningEnabledForNewRepos {
512 execStatus[issue.INF_DISC_SECRET_SCANNING_DISABLED] = nil
513 issues = append(
514 issues,
515 issue.OrgSecretScanningDisabledForNewRepos(*org.info.Login),
516 )
517 }
518 return issues, execStatus, nil
519}
520
521// Summarize provides generic statistics for a given org and serializes them
522// to disc

Callers

nothing calls this directly

Tested by

no test coverage detected