Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos (code / user facing) #4415

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion providers/azure/resources/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ func (a *mqlAzureSubscriptionNetworkServiceSubnet) ipConfigurations() ([]interfa
}
mqlNetwork := network.(*mqlAzureSubscriptionNetworkService)
// the subnet ip configs are referencing the virtual network gateways ip config. There seems to be no
// no API to fetch this so we fetch the gateaways and iterate through them
// no API to fetch this so we fetch the gateways and iterate through them
gateways := mqlNetwork.GetVirtualNetworkGateways()
if gateways.Error != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion providers/github/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (s *Service) detect(asset *inventory.Asset, conn *connection.GithubConnecti

repoOpt := conf.Options["repository"]
ownerOpt := conf.Options["owner"]
// try and parse the repo ßonly if the owner isn't explicitly set
// try and parse the repo only if the owner isn't explicitly set
if repoOpt != "" && ownerOpt == "" {
repoParts := strings.Split(repoOpt, "/")
if len(repoParts) > 1 {
Expand Down
2 changes: 1 addition & 1 deletion providers/k8s/resources/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TestLoadManifestDirRecursively(t *testing.T) {
assert.NotContains(t, manifestsAsString, "README")
assert.NotContains(t, manifestsAsString, "operators.coreos.com")

// This is from files in subdirs whicch should be included
// This is from files in subdirs which should be included
assert.Contains(t, manifestsAsString, "hello-1")
assert.Contains(t, manifestsAsString, "hello-2")
assert.Contains(t, manifestsAsString, "MondooAuditConfig")
Expand Down
8 changes: 4 additions & 4 deletions providers/ms365/resources/ms365_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $outlookToken= '%s'

Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser -Force
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -AccessToken $outlookToken -AppID $appId -Organization $organization -ShowBanner:$false -ShowProgress:$false
Connect-ExchangeOnline -AccessToken $outlookToken -AppID $appId -Organization $organization -ShowBanner:$false -ShowProgress:$false

$MalwareFilterPolicy = (Get-MalwareFilterPolicy)
$HostedOutboundSpamFilterPolicy = (Get-HostedOutboundSpamFilterPolicy)
Expand Down Expand Up @@ -168,7 +168,7 @@ func (r *mqlMs365Exchangeonline) getOrg() (string, error) {
if org == "" {
tenantDomainName := mqlMicrosoft.GetTenantDomainName()
if tenantDomainName.Error != nil {
// note: we dont want to err here. maybe the app registration has no perms to get the organization
// note: we don't want to err here. maybe the app registration has no perms to get the organization
// in that case we try and get the report by using the explicitly passed in exchange organization
log.Debug().Err(tenantDomainName.Error).Msg("unable to get tenant domain name")
} else {
Expand All @@ -178,7 +178,7 @@ func (r *mqlMs365Exchangeonline) getOrg() (string, error) {
return org, nil
}

// Related to TeamsProtectionPolicy as a seperate function
// Related to TeamsProtectionPolicy as a separate function
func convertTeamsProtectionPolicy(r *mqlMs365Exchangeonline, data []*TeamsProtectionPolicy) ([]interface{}, error) {
var result []interface{}
for _, t := range data {
Expand All @@ -198,7 +198,7 @@ func convertTeamsProtectionPolicy(r *mqlMs365Exchangeonline, data []*TeamsProtec
return result, nil
}

// Related to ReportSubmissionPolicy as a seperate function
// Related to ReportSubmissionPolicy as a separate function
func convertReportSubmissionPolicy(r *mqlMs365Exchangeonline, data []*ReportSubmissionPolicy) ([]interface{}, error) {
var result []interface{}
for _, t := range data {
Expand Down
6 changes: 3 additions & 3 deletions providers/ms365/resources/ms365_sharepoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Add-Member -InputObject $sharepoint -MemberType NoteProperty -Name SPOTenant -Va
Add-Member -InputObject $sharepoint -MemberType NoteProperty -Name SPOTenantSyncClientRestriction -Value $SPOTenantSyncClientRestriction
Add-Member -InputObject $sharepoint -MemberType NoteProperty -Name SPOSite -Value $SPOSite

Disconnect-PnPOnline
Disconnect-PnPOnline

ConvertTo-Json -Depth 4 $sharepoint -EnumsAsStrings
`
Expand Down Expand Up @@ -78,7 +78,7 @@ func (r *mqlMs365Sharepointonline) getTenant() (string, error) {
if spUrl == "" {
tenantDomainName := mqlMicrosoft.GetTenantDomainName()
if tenantDomainName.Error != nil {
// note: we dont want to err here. maybe the app registration has no perms to get the organization
// note: we don't want to err here. maybe the app registration has no perms to get the organization
// in that case we try and get the report by using the explicitly passed in sharepoint url
log.Debug().Err(tenantDomainName.Error).Msg("unable to get tenant domain name")
} else {
Expand Down Expand Up @@ -119,7 +119,7 @@ func (r *mqlMs365Sharepointonline) getSharepointOnlineReport() error {
// for some reasons, tokens issued by a client secret do not work. only certificates do
// TODO: ^ we should try and investigate why, its unclear to me why it happens.
if !conn.IsCertProvided() {
return errHandler(fmt.Errorf("only certificate authentication is supported for fetching sharepoint onine report"))
return errHandler(fmt.Errorf("only certificate authentication is supported for fetching sharepoint online report"))
}

tenant, err := r.getTenant()
Expand Down
2 changes: 1 addition & 1 deletion providers/network/resources/domain/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// Public Suffix List https://publicsuffix.org
// Reserved Top-Level Domains https://datatracker.ietf.org/doc/html/rfc2606

// Domain embeds net/url and adds extra fields ontop
// Domain embeds net/url and adds extra fields on top
type Name struct {
Host string
Port int
Expand Down
2 changes: 1 addition & 1 deletion providers/network/resources/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func parseCertificates(runtime *plugin.Runtime, domainName string, certificateLi
raw, err := CreateResource(runtime, "certificate", map[string]*llx.RawData{
"pem": llx.StringData(string(pem)),
// NOTE: if we do not set the hash here, it will generate the cache content before we can store it
// we are using the hashs for the id, therefore it is required during creation
// we are using the hashes for the id, therefore it is required during creation
"fingerprints": llx.MapData(certificates.Fingerprints(cert), types.String),
"isRevoked": llx.BoolData(isRevoked),
"revokedAt": llx.TimeData(revokedAt),
Expand Down
2 changes: 1 addition & 1 deletion providers/os/connection/device/linux/lun.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func findMatchingDeviceByBlock(scsiDevices scsiDevices, blockDevices *snapshot.B
log.Debug().Str("name", b.Name).Msg("device connection> checking block")
for _, ch := range b.Children {
if len(ch.MountPoint) > 0 && ch.MountPoint != "" {
log.Debug().Str("name", ch.Name).Str("mountpoint", ch.MountPoint).Str("parent", b.Name).Msg("device connection> has mounted partitons, skipping parent block")
log.Debug().Str("name", ch.Name).Str("mountpoint", ch.MountPoint).Str("parent", b.Name).Msg("device connection> has mounted partitions, skipping parent block")
break
}
matching = &b
Expand Down
2 changes: 1 addition & 1 deletion providers/os/detector/platform_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (r *PlatformResolver) resolvePlatform(pf *inventory.Platform, conn shared.C
}
}

// we reached this point, we know it is the platfrom but we could not
// we reached this point, we know it is the platform but we could not
// identify the system
// TODO: add generic platform instance
// TODO: should we return an error?
Expand Down
2 changes: 1 addition & 1 deletion providers/os/id/aws/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestDetectNotInstance(t *testing.T) {
require.Len(t, related, 0)
}

func TestDetectConainer(t *testing.T) {
func TestDetectContainer(t *testing.T) {
conn, err := mock.New(0, "./testdata/container.toml", &inventory.Asset{})
require.NoError(t, err)
platform, ok := detector.DetectOS(conn)
Expand Down
2 changes: 1 addition & 1 deletion providers/os/resources/asset_vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func fetchVulnReport(runtime *plugin.Runtime) (interface{}, error) {
apiPackages := []*mvd.Package{}
kernelVersion := ""

// collect pacakges if the platform supports gathering files
// collect packages if the platform supports gathering files
if conn.Capabilities().Has(shared.Capability_File) {
obj, err := CreateResource(runtime, "packages", map[string]*llx.RawData{})
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (a *DockerRegistryImages) Repositories(reg name.Registry) ([]string, error)
return res, nil
}

// ListRegistry tries to iterate over all repositores in one registry
// ListRegistry tries to iterate over all repositories in one registry
// eg. 1234567.dkr.ecr.us-east-1.amazonaws.com
func (a *DockerRegistryImages) ListRegistry(registry string) ([]*inventory.Asset, error) {
reg, err := name.NewRegistry(registry)
Expand Down
2 changes: 1 addition & 1 deletion providers/os/resources/docker_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (p *mqlDockerFile) stage2resource(stage instructions.Stage) (*mqlDockerFile

if len(unsupported) != 0 {
slices.Sort(unsupported)
log.Debug().Strs("commands", slices.Compact(unsupported)).Msg("unsuppoprted dockerfile commands")
log.Debug().Strs("commands", slices.Compact(unsupported)).Msg("unsupported dockerfile commands")
}

args := map[string]*llx.RawData{
Expand Down
2 changes: 1 addition & 1 deletion providers/os/resources/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestResource_Groups(t *testing.T) {
assert.NotEmpty(t, res)
})

t.Run("test a specific grroup", func(t *testing.T) {
t.Run("test a specific group", func(t *testing.T) {
res := x.TestQuery(t, "groups.list[0].name")
assert.NotEmpty(t, res)
assert.Empty(t, res[0].Result().Error)
Expand Down
4 changes: 2 additions & 2 deletions providers/os/resources/procfs/processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type LinuxProcessStatus struct {
Ngid int64 `json:"ngid"` // NUMA group ID (0 if none)
}

var LINUX_PROCES_STATUS_REGEX = regexp.MustCompile(`^(.*):\s*(.*)$`)
var LINUX_PROCESS_STATUS_REGEX = regexp.MustCompile(`^(.*):\s*(.*)$`)

func ParseProcessStatus(input io.Reader) (*LinuxProcessStatus, error) {
lps := &LinuxProcessStatus{}
var err error
scanner := bufio.NewScanner(input)
for scanner.Scan() {
line := scanner.Text()
m := LINUX_PROCES_STATUS_REGEX.FindStringSubmatch(line)
m := LINUX_PROCESS_STATUS_REGEX.FindStringSubmatch(line)

if m == nil {
log.Warn().Str("entry", line).Msg("ignore process status entry")
Expand Down
Loading