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

Investigate local Aqua scanning #144

Closed
michaelsauter opened this issue Aug 12, 2021 · 2 comments
Closed

Investigate local Aqua scanning #144

michaelsauter opened this issue Aug 12, 2021 · 2 comments
Labels
question Further information is requested

Comments

@michaelsauter
Copy link
Member

Since we use Buildah, it would be possible to scan the OCI archive with Aqua before pushing to the registry. We need to research what the benefits and drawbacks are compared to the push-first approach.

@michaelsauter michaelsauter added the question Further information is requested label Aug 12, 2021
@michaelsauter
Copy link
Member Author

michaelsauter commented Aug 12, 2021

Some implementation hints:

// buildahPush pushes a local image to the given imageName.
func buildahOCIArchive(opts options, workingDir, imageName string) ([]byte, []byte, error) {
	return command.Run("buildah", []string{
		fmt.Sprintf("--storage-driver=%s", opts.storageDriver),
		"push",
		imageName, fmt.Sprintf("oci-archive:/%s:%s", filepath.Join(workingDir, "image.tar"), imageName),
	})
}

// aquaImport runs an Aqua scan on given imageRef.
func aquaImport(opts options, workingDir, jsonReportFile string) ([]byte, []byte, error) {
	return command.Run(aquasecBin, []string{
		"import",
		fmt.Sprintf("--user=%s", opts.aquaUsername),
		fmt.Sprintf("--password=%s", opts.aquaPassword),
		fmt.Sprintf("--host=%s", opts.aquaURL),
		jsonReportFile,
		"-w", "/tmp",
	})
}

@michaelsauter michaelsauter added this to the 0.3.0 milestone Aug 26, 2021
@michaelsauter michaelsauter modified the milestones: 0.3.0, 0.4.0 Nov 23, 2021
@michaelsauter michaelsauter removed this from the 0.4.0 milestone Apr 6, 2022
@michaelsauter
Copy link
Member Author

Closing in favour of opendevstack/ods-pipeline-image#3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant