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

Spelling #402

Merged
merged 4 commits into from
Jan 20, 2025
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SCALIBR (Software Composition Analysis Library) is an extensible file system sca

The scanner can either be used as a standalone binary to scan the local machine or as a library with a custom wrapper to perform scans on e.g. container images or remote hosts. It comes with built-in plugins for inventory extraction and vulnerability detection and it also allows users to run their custom plugins.

See [here](docs/supported_inventory_types.md) for the list of currently supported software inventory types.
See the [list of currently supported software inventory types](docs/supported_inventory_types.md).

## Prerequisites

Expand Down
18 changes: 9 additions & 9 deletions artifact/image/layerscanning/image/file_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestRead(t *testing.T) {
isWhiteout: false,
mode: filePermission,
}
fileNodeNonExistentFile := &fileNode{
fileNodeNonexistentFile := &fileNode{
extractDir: tempDir,
originLayerID: "",
virtualPath: "/dir1/xyz",
Expand Down Expand Up @@ -227,8 +227,8 @@ func TestRead(t *testing.T) {
want: "foo",
},
{
name: "non-existent file",
erikvarga marked this conversation as resolved.
Show resolved Hide resolved
node: fileNodeNonExistentFile,
name: "nonexistent file",
node: fileNodeNonexistentFile,
wantErr: true,
},
{
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestReadAt(t *testing.T) {
isWhiteout: false,
mode: filePermission,
}
fileNodeNonExistentFile := &fileNode{
fileNodeNonexistentFile := &fileNode{
extractDir: tempDir,
originLayerID: "",
virtualPath: "/dir1/xyz",
Expand Down Expand Up @@ -370,8 +370,8 @@ func TestReadAt(t *testing.T) {
wantErr: io.EOF,
},
{
name: "non-existent file",
node: fileNodeNonExistentFile,
name: "nonexistent file",
node: fileNodeNonexistentFile,
wantErr: os.ErrNotExist,
},
{
Expand Down Expand Up @@ -411,7 +411,7 @@ func TestClose(t *testing.T) {
isWhiteout: false,
mode: filePermission,
}
fileNodeNonExistentFile := &fileNode{
fileNodeNonexistentFile := &fileNode{
extractDir: tempDir,
originLayerID: "",
virtualPath: "/dir1/xyz",
Expand All @@ -428,8 +428,8 @@ func TestClose(t *testing.T) {
node: fileNodeWithUnopenedFile,
},
{
name: "non-existent file",
node: fileNodeNonExistentFile,
name: "nonexistent file",
node: fileNodeNonexistentFile,
},
}
for _, tc := range tests {
Expand Down
20 changes: 10 additions & 10 deletions artifact/image/layerscanning/image/layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func TestChainFSOpen(t *testing.T) {
wantErr error
}{
{
name: "non-existent tree",
name: "nonexistent tree",
chainfs: FS{
tree: nil,
},
Expand Down Expand Up @@ -264,9 +264,9 @@ func TestChainFSOpen(t *testing.T) {
},
},
{
name: "error opening symlink due to non-existent target",
name: "error opening symlink due to nonexistent target",
chainfs: populatedChainFS,
path: "/symlink-to-non-existent-file",
path: "/symlink-to-nonexistent-file",
wantErr: fs.ErrNotExist,
},
{
Expand Down Expand Up @@ -317,7 +317,7 @@ func TestChainFSStat(t *testing.T) {
wantErr error
}{
{
name: "non-existent tree",
name: "nonexistent tree",
chainfs: FS{
tree: nil,
},
Expand Down Expand Up @@ -374,7 +374,7 @@ func TestChainFSReadDir(t *testing.T) {
wantErr error
}{
{
name: "read directory from non-existent tree",
name: "read directory from nonexistent tree",
chainfs: FS{
tree: nil,
},
Expand Down Expand Up @@ -479,10 +479,10 @@ func TestChainFSReadDir(t *testing.T) {
{
extractDir: extractDir,
originLayerID: "layer2",
virtualPath: "/symlink-to-non-existent-file",
virtualPath: "/symlink-to-nonexistent-file",
isWhiteout: false,
mode: fs.ModeSymlink,
targetPath: "/non-existent-file",
targetPath: "/nonexistent-file",
},
{
extractDir: extractDir,
Expand Down Expand Up @@ -711,13 +711,13 @@ func setUpChainFS(t *testing.T, maxSymlinkDepth int) (FS, string) {
mode: fs.ModeSymlink,
targetPath: "/dir2",
},
"/symlink-to-non-existent-file": &fileNode{
"/symlink-to-nonexistent-file": &fileNode{
extractDir: tempDir,
originLayerID: "layer2",
virtualPath: "symlink-to-non-existent-file",
virtualPath: "symlink-to-nonexistent-file",
isWhiteout: false,
mode: fs.ModeSymlink,
targetPath: "/non-existent-file",
targetPath: "/nonexistent-file",
},
"/symlink-cycle1": &fileNode{
extractDir: tempDir,
Expand Down
6 changes: 3 additions & 3 deletions artifact/image/pathtree/pathtree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestNode_Get(t *testing.T) {
want: &testVal{"value"},
},
{
name: "non-existent node in single node tree",
name: "nonexistent node in single node tree",
tree: func() *Node[testVal] {
tree := NewNode[testVal]()
_ = tree.Insert("/a", &testVal{"value"})
Expand All @@ -141,7 +141,7 @@ func TestNode_Get(t *testing.T) {
want: &testVal{"value3"},
},
{
name: "non-existent node",
name: "nonexistent node",
tree: testTree(t),
key: "/a/b/g",
want: nil,
Expand Down Expand Up @@ -200,7 +200,7 @@ func TestNode_GetChildren(t *testing.T) {
},
},
{
name: "non-existent node",
name: "nonexistent node",
tree: testTree(t),
key: "/a/b/g",
want: nil,
Expand Down
2 changes: 1 addition & 1 deletion artifact/image/unpack/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (u *Unpacker) UnpackSquashedFromTarball(dir string, tarPath string) error {
}
}

// Remove symlinks that have a non-existent destination file or non-existent destination directory.
// Remove symlinks that have a nonexistent destination file or nonexistent destination directory.
if err := symlink.RemoveObsoleteSymlinks(dir); err != nil {
return fmt.Errorf("failed to remove obsolete symlinks from dir %q: %w", dir, err)
}
Expand Down
2 changes: 1 addition & 1 deletion detector/weakcredentials/winlocal/samreg/userinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (s *UserInfo) decryptHashes(syskey, lmData, ntData []byte) ([]byte, []byte,
// Hashes returns the LM and NT hashes of the user.
// Note that the syskey is expected to be already derived.
func (s *UserInfo) Hashes(syskey []byte) ([]byte, []byte, error) {
lmHash, ntHash, err := s.userV.EncrytpedHashes()
lmHash, ntHash, err := s.userV.EncryptedHashes()
if err != nil {
return nil, nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions detector/weakcredentials/winlocal/samreg/userv.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func (s *userV) Username() (string, error) {
return string(decoded), nil
}

// EncrytpedHashes returns the encrypted LM and NT hashes of the user.
// EncryptedHashes returns the encrypted LM and NT hashes of the user.
// Note that at this point, the hashes are still encrypted with RC4 or AES.
func (s *userV) EncrytpedHashes() ([]byte, []byte, error) {
func (s *userV) EncryptedHashes() ([]byte, []byte, error) {
if s.header.NtHashLength == 0 {
return nil, nil, errNoHashInfoFound
}
Expand Down
10 changes: 5 additions & 5 deletions detector/weakcredentials/winlocal/samreg/userv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestUserVUsername(t *testing.T) {
}
}

func TestUserVEncrytpedHashes(t *testing.T) {
func TestUserVEncryptedHashes(t *testing.T) {
tests := []struct {
name string
buffer []byte
Expand Down Expand Up @@ -195,21 +195,21 @@ func TestUserVEncrytpedHashes(t *testing.T) {
t.Fatalf("Failed to create userV for tests: %v", err)
}

gotLM, gotNT, gotErr := userV.EncrytpedHashes()
gotLM, gotNT, gotErr := userV.EncryptedHashes()
if gotErr != tc.wantErr {
t.Errorf("EncrytpedHashes(): unexpected error, got: %v, want: %v", gotErr, tc.wantErr)
t.Errorf("EncryptedHashes(): unexpected error, got: %v, want: %v", gotErr, tc.wantErr)
}

if tc.wantErr != nil {
return
}

if !slices.Equal(gotLM, tc.wantLM) {
t.Errorf("EncrytpedHashes(): got LM hash: %v, want: %v", gotLM, tc.wantLM)
t.Errorf("EncryptedHashes(): got LM hash: %v, want: %v", gotLM, tc.wantLM)
}

if !slices.Equal(gotNT, tc.wantNT) {
t.Errorf("EncrytpedHashes(): got NT hash: %v, want: %v", gotNT, tc.wantNT)
t.Errorf("EncryptedHashes(): got NT hash: %v, want: %v", gotNT, tc.wantNT)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion detector/weakcredentials/winlocal/winlocal_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (d Detector) findingForFormatLM(users []string) *detector.Finding {
Severity: detector.SeverityHigh,
},
Type: detector.TypeVulnerability,
Description: "Password hashes are stored in the LM format. Please switch local storage to use NT format and regerenate the hashes.",
Description: "Password hashes are stored in the LM format. Please switch local storage to use NT format and regenerate the hashes.",
Recommendation: "Change the password of the user after changing the storage format.",
},
Extra: fmt.Sprintf("%v", users),
Expand Down
Loading