-
Couldn't load subscription status.
- Fork 2.8k
refactor: move internal packages to internal/ directory #9606
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
Open
knqyf263
wants to merge
10
commits into
aquasecurity:main
Choose a base branch
from
knqyf263:refactor/move-packages-to-internal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ff8d12a
refactor: move internal packages from pkg/ to internal/ directory
knqyf263 0330e3b
refactor: update import paths for moved packages
knqyf263 1293801
refactor: update magefiles paths for moved packages
knqyf263 aba6d6f
refactor: move public API packages back to pkg/
knqyf263 d1320de
refactor: expose compliance API in pkg/compliance
knqyf263 8447d01
refactor: move k8s back to pkg/ as public API
knqyf263 4cddf9f
refactor: move policy back to pkg/ as public API
knqyf263 e7b9571
refactor: move iac/severity back to pkg/ as public API
knqyf263 1a0ddde
refactor: move iac/scanners/kubernetes back to pkg/ as public API
knqyf263 869a6b0
style: fix linter issues
knqyf263 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package arm | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/appservice" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/authorization" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/compute" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/container" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/database" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/datafactory" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/datalake" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/keyvault" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/monitor" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/network" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/securitycenter" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/storage" | ||
| "github.com/aquasecurity/trivy/internal/iac/adapters/arm/synapse" | ||
| "github.com/aquasecurity/trivy/internal/iac/providers/azure" | ||
| scanner "github.com/aquasecurity/trivy/internal/iac/scanners/azure" | ||
| "github.com/aquasecurity/trivy/internal/iac/state" | ||
| ) | ||
|
|
||
| // Adapt adapts an azure arm instance | ||
| func Adapt(_ context.Context, deployment scanner.Deployment) *state.State { | ||
| return &state.State{ | ||
| Azure: adaptAzure(deployment), | ||
| } | ||
| } | ||
|
|
||
| func adaptAzure(deployment scanner.Deployment) azure.Azure { | ||
|
|
||
| return azure.Azure{ | ||
| AppService: appservice.Adapt(deployment), | ||
| Authorization: authorization.Adapt(deployment), | ||
| Compute: compute.Adapt(deployment), | ||
| Container: container.Adapt(deployment), | ||
| Database: database.Adapt(deployment), | ||
| DataFactory: datafactory.Adapt(deployment), | ||
| DataLake: datalake.Adapt(deployment), | ||
| KeyVault: keyvault.Adapt(deployment), | ||
| Monitor: monitor.Adapt(deployment), | ||
| Network: network.Adapt(deployment), | ||
| SecurityCenter: securitycenter.Adapt(deployment), | ||
| Storage: storage.Adapt(deployment), | ||
| Synapse: synapse.Adapt(deployment), | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/appservice/adapt.go → ...rnal/iac/adapters/arm/appservice/adapt.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/authorization/adapt.go → ...l/iac/adapters/arm/authorization/adapt.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/compute/adapt.go → internal/iac/adapters/arm/compute/adapt.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/container/adapt.go → internal/iac/adapters/arm/container/adapt.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/database/adapt.go → internal/iac/adapters/arm/database/adapt.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/database/firewall.go → ...nal/iac/adapters/arm/database/firewall.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
pkg/iac/adapters/arm/database/maria.go → internal/iac/adapters/arm/database/maria.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivy-aws uses this package - https://github.com/aquasecurity/trivy-aws/blob/6e28982904fb3a988cfdfcd41a63ac0caac6e8d4/pkg/commands/run.go#L32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default settings and trivial logic are used to load the AWS config, so I think it can be reimplemented in trivy-aws.