Skip to content

Commit

Permalink
chore: remove aws from config (#40)
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Rumney <[email protected]>
  • Loading branch information
owenrumney authored Jan 31, 2023
1 parent 1a6f607 commit 099dd0e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 143 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ lazydocker, lazynpm, lazygit)
- [Scan all images on your system](#scanning-all-local-images)
- [Scan a single image](#scanning-a-specific-image)
- [Scan a remote image](#scanning-a-remote-image)
- AWS Scanning
- [Scan your cloud account](#scanning-an-aws-account)
- File System Scanning
- [Scan a filesystem for vulnerabilities and misconfigurations](#scanning-a-filesystem)

Expand Down Expand Up @@ -58,9 +56,6 @@ Alternatively, you can get the latest releases from [GitHub](https://github.com/
A config file can be added to `~/.config/lazytrivy/config.yml` to set default options.

```yaml
aws:
accountno: "464897523927"
region: us-east-1
vulnerability:
ignoreunfixed: false
filesystem:
Expand Down Expand Up @@ -91,7 +86,6 @@ Usage:
lazytrivy [command]
Available Commands:
aws Launch lazytrivy in aws scanning mode
filesystem Launch lazytrivy in filesystem scanning mode
help Help about any command
image Launch lazytrivy in image scanning mode
Expand Down Expand Up @@ -122,7 +116,7 @@ The default docker host is `unix:///var/run/docker.sock`. If you are running Doc
### Starting in a specific mode
You can start `lazytrivy` in a specific mode using `aws`, `images` or `filesystem`:
You can start `lazytrivy` in a specific mode using `images` or `filesystem`:

For example, to scan a specific filesystem folder, you could run:

Expand Down Expand Up @@ -172,13 +166,6 @@ To scan an image that is not already locally on the machine, you can use the `r`

![Scanning a remote image](./.github/images/scan_remote_image.gif)

### Scanning an AWS Account

To scan an AWS account, you can use the `w` key to switch to AWS mode, from there you can use the `s` key to scan, it will detect any valid credentials it can.

![Scanning an AWS account](./.github/images/scan_aws_account.gif)

By pressing `r` you can switch region in results you already have.

### Scanning a filesystem

Expand Down
11 changes: 0 additions & 11 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

type Config struct {
AWS AWSConfig
Vulnerability VulnerabilityConfig
Filesystem FileSystemConfig
CacheDirectory string `json:"-"`
Expand All @@ -18,12 +17,6 @@ type Config struct {
DockerEndpoint string
}

type AWSConfig struct {
AccountNo string
Region string
CacheDirectory string
}

type VulnerabilityConfig struct {
IgnoreUnfixed bool
}
Expand All @@ -47,14 +40,10 @@ func createDefaultConfig() error {
homeDir = os.TempDir()
}
trivyCacheDir := filepath.Join(homeDir, ".cache", "trivy")
awsCacheDir := filepath.Join(trivyCacheDir, "cloud", "aws")

defaultConfig = &Config{
CacheDirectory: trivyCacheDir,
Debug: false,
AWS: AWSConfig{
CacheDirectory: awsCacheDir,
},
Vulnerability: VulnerabilityConfig{
IgnoreUnfixed: false,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/filesystem/key_bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func (c *Controller) configureKeyBindings() error {
logger.Debugf("Configuring global AWS Controller keyboard shortcuts")
logger.Debugf("Configuring global Filesystem Controller keyboard shortcuts")
if err := c.ConfigureGlobalKeyBindings(); err != nil {
return fmt.Errorf("error configuring global keybindings: %w", err)
}
Expand Down
7 changes: 0 additions & 7 deletions pkg/widgets/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ type vulnerabilityContext interface {
ScanImage(ctx context.Context)
}

type awsContext interface {
baseContext
ScanService(ctx context.Context)
UpdateAccount(account string) error
UpdateRegion(region string) error
}

type fsContext interface {
baseContext
ShowTarget(ctx context.Context)
Expand Down
109 changes: 0 additions & 109 deletions pkg/widgets/services.go

This file was deleted.

1 change: 0 additions & 1 deletion pkg/widgets/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ type Tab string

const (
VulnerabilitiesTab Tab = "Vulnerabilities"
AWSTab Tab = "AWS"
FileSystemTab Tab = "FileSystem"
)

0 comments on commit 099dd0e

Please sign in to comment.