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

Implement encrypted push and pull/bud/from using encrypted images #2271

Merged
merged 6 commits into from
May 21, 2020

Conversation

lumjjb
Copy link
Contributor

@lumjjb lumjjb commented Apr 3, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR introduces the ability to encrypt an OCI container image when pushing, and also allows the use of encrypted OCI container images when building a Dockerfile or pulling an encrypted image from the registry.

This is the initial implementation idea. There are a few more things that I am working on right now before taking out of DRAFT, but would like some feedback on the general idea.

TODO in progress by me:

  • Remove ufave/cli and some additional imports which are not necessary from upstream ocicrypt lirbary
  • Add tests

How to verify it

# Create keypair
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ openssl genrsa -out mykey.pem 1024
Generating RSA private key, 1024 bit long modulus (2 primes)
...........+++++
.......+++++
e is 65537 (0x010001)
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ openssl rsa -in mykey.pem -pubout > mykey.pub
writing RSA key

# Encrypt an image to local registry
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah images
REPOSITORY   TAG   IMAGE ID   CREATED   SIZE
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah pull docker://docker.io/library/nginx:latest
Getting image source signatures
Copying blob ffadbd415ab7 done
Copying blob c499e6d256d6 done
Copying blob 74cda408e262 done
Copying config ed21b7a8ae done
Writing manifest to image destination
Storing signatures
ed21b7a8aee9cc677df6d7f38a641fa0e3c05f65592c592c9f28c42b3dd89291
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
f91d02361eae        registry:2.7.1      "/entrypoint.sh /etc…"   4 months ago        Up 2 days           0.0.0.0:5000->5000/tcp   registry
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah push --tls-verify=false --encryption-key jwe:./mykey.pub docker.io/library/nginx:latest docker://localhost:5000/test_enc_img
Getting image source signatures
Copying blob d37eecb5b769 done
Copying blob 99134ec7f247 done
Copying blob c3a984abe8a8 done
Copying config 3f9bb7a003 done
Writing manifest to image destination
Storing signatures

# Try pulling encrypted image without key
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah pull --tls-verify=false docker://localhost:5000/test_enc_img
Getting image source signatures
Getting image source signatures
Getting image source signatures
Getting image source signatures
while pulling "docker://localhost:5000/test_enc_img" as "localhost:5000/test_enc_img": Error decrypting layer sha256:ae69626ca4b44e82dce805f5f7be5272c5651bd75e19aa38ec2f5ef78986f3ff: missing private key needed for decryption
ERRO exit status 1

# Try pulling encrypted image with key
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah pull --tls-verify=false --decryption-key ./mykey.pem docker://localhost:5000/test_enc_img
Getting image source signatures
Copying blob ae69626ca4b4 done
Copying blob de5dd0ed1059 done
Copying blob 4071791f0baf done
Copying config 3f9bb7a003 done
Writing manifest to image destination
Storing signatures
3f9bb7a003b412bc186a8437e2d2246f42a6bb7488458585948e50be00a9037d

# Cleanup
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah rmi --all -f
ed21b7a8aee9cc677df6d7f38a641fa0e3c05f65592c592c9f28c42b3dd89291
3f9bb7a003b412bc186a8437e2d2246f42a6bb7488458585948e50be00a9037d

# Create dockerfile that uses encrypted image
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ vi enc_dockerfile/Dockerfile
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ cat enc_dockerfile/Dockerfile
FROM localhost:5000/test_enc_img

# buildah bud without key
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah bud --tls-verify=false ./enc_dockerfile/
STEP 1: FROM localhost:5000/test_enc_img
Getting image source signatures
Getting image source signatures
Getting image source signatures
Getting image source signatures
error creating build container: Error decrypting layer sha256:ae69626ca4b44e82dce805f5f7be5272c5651bd75e19aa38ec2f5ef78986f3ff: missing private key needed for decryption
ERRO exit status 1

# buildah bud with key
vagrant@ubuntu-bionic:~/go/src/github.com/containers/buildah$ ./buildah bud --tls-verify=false --decryption-key ./mykey.pem ./enc_dockerfile/
STEP 1: FROM localhost:5000/test_enc_img
Getting image source signatures
Copying blob ae69626ca4b4 done
Copying blob 4071791f0baf done
Copying blob de5dd0ed1059 done
Copying config 3f9bb7a003 done
Writing manifest to image destination
Storing signatures
STEP 2: COMMIT
--> 3f9bb7a003b
3f9bb7a003b412bc186a8437e2d2246f42a6bb7488458585948e50be00a9037d

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Yes

  • it provides a new flag for buildah push with --encryption-key
  • it provides a new flag for buildah pull with --decryption-key
  • it provides a new flag for buildah bud with --decryption-key

// decryption
dcc, err := enchelpers.CreateCryptoConfig([]string{}, iopts.decryptionKeys)
if err != nil {
return fmt.Errorf("Invalid decryption keys: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please Use errors.Wrapf

commit.go Outdated
@@ -451,7 +465,22 @@ func Push(ctx context.Context, image string, dest types.ImageReference, options
systemContext.DirForceCompress = true
}
var manifestBytes []byte
if manifestBytes, err = retryCopyImage(ctx, policyContext, dest, maybeCachedSrc, dest, "push", getCopyOptions(options.Store, options.ReportWriter, nil, systemContext, options.ManifestType, options.RemoveSignatures, options.SignBy), options.MaxRetries, options.RetryDelay); err != nil {
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not big fans of commented out code...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have squashed my commits, my bad. I will squash current commits and then changes on top of that.

@@ -76,6 +80,9 @@ func init() {
flags.BoolVarP(&opts.removeSignatures, "remove-signatures", "", false, "don't copy signatures when pushing image")
flags.StringVar(&opts.signBy, "sign-by", "", "sign the image using a GPG key with the specified `FINGERPRINT`")
flags.StringVar(&opts.signaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
flags.StringSliceVar(&opts.encryptionKeys, "encryption-key", nil, "*Experimental* key with the encryption protocol to use needed to encrypt the image (e.g. jwe:/path/to/key.pem)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both flags required to push? If yes, there should be an error returned by the CLI if only one is specified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experiemental->experimental

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encryptLayers is optional. Let me add additional text to the tooltip to communicate that.

@@ -76,6 +80,9 @@ func init() {
flags.BoolVarP(&opts.removeSignatures, "remove-signatures", "", false, "don't copy signatures when pushing image")
flags.StringVar(&opts.signBy, "sign-by", "", "sign the image using a GPG key with the specified `FINGERPRINT`")
flags.StringVar(&opts.signaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
flags.StringSliceVar(&opts.encryptionKeys, "encryption-key", nil, "*Experimental* key with the encryption protocol to use needed to encrypt the image (e.g. jwe:/path/to/key.pem)")
flags.IntSliceVar(&opts.encryptLayers, "encrypt-layer", nil, "*Experimental* the 0-indexed layer indices, with support for negative indexing (e.g. 0 is the first layer, -1 is the last layer)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experiemental->experimental

encLayers = &iopts.encryptLayers
ecc, err := enchelpers.CreateCryptoConfig(iopts.encryptionKeys, []string{})
if err != nil {
return fmt.Errorf("Invalid encryption keys: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors.Wrapf

pull.go Outdated
@@ -275,7 +280,8 @@ func pullImage(ctx context.Context, store storage.Store, srcRef types.ImageRefer
}()

logrus.Debugf("copying %q to %q", transports.ImageName(srcRef), destName)
if _, err := retryCopyImage(ctx, policyContext, maybeCachedDestRef, srcRef, srcRef, "pull", getCopyOptions(store, options.ReportWriter, sc, nil, "", options.RemoveSignatures, ""), options.MaxRetries, options.RetryDelay); err != nil {
logrus.Debugf("OCI Decrypt config : %v", options.OciDecryptConfig)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we only output this iff there is an encrypted layer

decConfig = cc.DecryptConfig
} else {
// Buildah pull should always try to decrypt image when pulled
decConfig = &encconfig.DecryptConfig{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this the default and when initilizing, then eliminate the else block

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2020

command completions changes required.

@lumjjb
Copy link
Contributor Author

lumjjb commented Apr 3, 2020

Thanks for comments @rhatdan ! Addressed them.

command completions changes required.

Forgive my ignorance.. Is there a process to do this? Or is this a manual edit of contrib/completions/bash/buildah?

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2020

Manually edit them. Just add the options.

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2020

Now I will ask for the Big pain. some tests to make sure this works.
Also I think you will need this option for buildah from

@TomSweeneyRedHat
Copy link
Member

Concept looks good to me, nothing out of whack that I spotted. We will most likely need to do this for at least 'podman pull' too, maybe others as well. The build side of things should go in without a problem, but we'll need to touch up the podman build man page to capture the new options.

FYI: @mheon @baude

@lumjjb
Copy link
Contributor Author

lumjjb commented Apr 6, 2020

i'm running into some weird flag issues in running the tests out of master. Having issues with running the integration tests. Am i missing some configuration? I get similar errors when I run make test-integration.

# bats ./tests/push.bat
...
 ✗ push
...
   $ /home/vagrant/go/src/github.com/containers/buildah/tests/../buildah commit
   -D
   --format docker
   --reference-time
   /tmp/tmpdbb3572b5a974dc1a0dd361f/reference-time-file
   --signature-policy
   /home/vagrant/go/src/github.com/containers/buildah/tests/policy.json
   working-container
   scratch-image-docker
   unknown flag: --format docker
   [ rc=1 (** EXPECTED 0 **) ]
   #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
   #| FAIL: exit code is 1; expected 0
   #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

 ✗ buildah push image to docker and docker registry
   (from function `_prefetch' in file tests/helpers.bash, line 71,
    in test file tests/push.bats, line 148)
     `_prefetch busybox' failed with status 125
   # [checking for: busybox]
   # [restoring from cache: /tmp/buildah-image-cache.4027 / busybox]
   Error: unknown flag: --root /tmp/tmp9db9842473732348fdfd7845/root --storage-driver vfs

@rhatdan
Copy link
Member

rhatdan commented Apr 6, 2020

No idea what is going on.

@lumjjb
Copy link
Contributor Author

lumjjb commented Apr 7, 2020

EDIT: looks like it was a mismatch version with podman , should be good now.
looks like it wasnt.

@openshift-ci-robot
Copy link
Collaborator

@lumjjb: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lumjjb
Copy link
Contributor Author

lumjjb commented Apr 7, 2020

@rhatdan figured it out... looks like it was an outdated bats version which was parsing the arguments in a different way.

@openshift-ci-robot
Copy link
Collaborator

@lumjjb: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

3 similar comments
@openshift-ci-robot
Copy link
Collaborator

@lumjjb: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Collaborator

@lumjjb: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Collaborator

@lumjjb: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lumjjb lumjjb force-pushed the enc_cont branch 2 times, most recently from a7763b9 to 8aaba12 Compare April 13, 2020 19:09
@lumjjb lumjjb marked this pull request as ready for review April 14, 2020 01:28
@lumjjb lumjjb changed the title [DRAFT] Implement encrypted push and pull/bud using encrypted images Implement encrypted push and pull/bud using encrypted images Apr 14, 2020
@lumjjb
Copy link
Contributor Author

lumjjb commented Apr 14, 2020

@rhatdan @TomSweeneyRedHat Added the tests and buildah from. Ready for review!

@lumjjb lumjjb changed the title Implement encrypted push and pull/bud using encrypted images Implement encrypted push and pull/bud/from using encrypted images Apr 14, 2020
Copy link
Member

@rhatdan rhatdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few nits.

@@ -66,6 +68,7 @@ func init() {
// BUD is a all common flags
budFlags := buildahcli.GetBudFlags(&budFlagResults)
budFlags.StringVar(&budFlagResults.Runtime, "runtime", util.Runtime(), "`path` to an alternate runtime. Use BUILDAH_RUNTIME environment variable to override.")
flags.StringSliceVar(&budFlagResults.DecryptionKeys, "decryption-key", nil, "*Experimental* key needed to decrypt the image")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lower case for help messages.. But I would drop "Experimental" and just leave that in the man page.

// decryption
dcc, err := enchelpers.CreateCryptoConfig([]string{}, iopts.BudResults.DecryptionKeys)
if err != nil {
return errors.Wrapf(err, "Invalid decryption keys")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower case error.

@@ -72,6 +75,7 @@ func init() {
flags.BoolVar(&opts.pullAlways, "pull-always", false, "pull the image even if the named image is present in store")
flags.BoolVar(&opts.pullNever, "pull-never", false, "do not pull the image, use the image present in store if available")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "don't output progress information when pulling images")
flags.StringSliceVar(&opts.decryptionKeys, "decryption-key", nil, "*experimental* key needed to decrypt the image")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove experimental

// decryption
dcc, err := enchelpers.CreateCryptoConfig([]string{}, iopts.decryptionKeys)
if err != nil {
return errors.Wrapf(err, "Invalid decryption keys")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower case error.

@@ -57,6 +60,7 @@ func init() {
flags.StringVar(&opts.creds, "creds", "", "use `[username[:password]]` for accessing the registry")
flags.BoolVarP(&opts.removeSignatures, "remove-signatures", "", false, "don't copy signatures when pulling image")
flags.StringVar(&opts.signaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
flags.StringSliceVar(&opts.decryptionKeys, "decryption-key", nil, "*experimental* key needed to decrypt the image")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove experimental

@@ -76,6 +80,9 @@ func init() {
flags.BoolVarP(&opts.removeSignatures, "remove-signatures", "", false, "don't copy signatures when pushing image")
flags.StringVar(&opts.signBy, "sign-by", "", "sign the image using a GPG key with the specified `FINGERPRINT`")
flags.StringVar(&opts.signaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
flags.StringSliceVar(&opts.encryptionKeys, "encryption-key", nil, "*experimental* key with the encryption protocol to use needed to encrypt the image (e.g. jwe:/path/to/key.pem)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove experimental.

@@ -76,6 +80,9 @@ func init() {
flags.BoolVarP(&opts.removeSignatures, "remove-signatures", "", false, "don't copy signatures when pushing image")
flags.StringVar(&opts.signBy, "sign-by", "", "sign the image using a GPG key with the specified `FINGERPRINT`")
flags.StringVar(&opts.signaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
flags.StringSliceVar(&opts.encryptionKeys, "encryption-key", nil, "*experimental* key with the encryption protocol to use needed to encrypt the image (e.g. jwe:/path/to/key.pem)")
flags.IntSliceVar(&opts.encryptLayers, "encrypt-layer", nil, "*experimental* the 0-indexed layer indices, with support for negative indexing (e.g. 0 is the first layer, -1 is the last layer), if not defined, will encrypt all layers if encryption-key flag is specified")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

encLayers = &iopts.encryptLayers
ecc, err := enchelpers.CreateCryptoConfig(iopts.encryptionKeys, []string{})
if err != nil {
return errors.Wrapf(err, "Invalid encryption keys")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower case

commit.go Outdated
@@ -132,6 +133,19 @@ type PushOptions struct {
MaxRetries int
// RetryDelay is how long to wait before retrying a push attempt.
RetryDelay time.Duration

// If OciEncryptConfig is non-nil, it indicates that an image should be encrypted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should start with OciEncryptConfig not If.

commit.go Outdated
@@ -319,7 +333,8 @@ func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options
}

var manifestBytes []byte
if manifestBytes, err = retryCopyImage(ctx, policyContext, maybeCachedDest, maybeCachedSrc, dest, "push", getCopyOptions(b.store, options.ReportWriter, nil, systemContext, "", false, options.SignBy), options.MaxRetries, options.RetryDelay); err != nil {
logrus.Debugf("Calling from Commit")
if manifestBytes, err = retryCopyImage(ctx, policyContext, maybeCachedDest, maybeCachedSrc, dest, "push", getCopyOptions(b.store, options.ReportWriter, nil, systemContext, "", false, options.SignBy, nil, nil, nil), options.MaxRetries, options.RetryDelay); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather then extending retryCopyImage, could you just pass in options...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're extending getCopyOptions here. Is this fine or are you thinking something like this?

options := getCopyOptions(...)
options.decryptionKey = ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ready this wrong. I was thinking the copy options and options.MaxRetries, I hate functions which just keep growing their params. Is there a way we can consolidate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a couple ideas ... But seems like this would be a separate PR.

For getCopyOptions it looks like the only special case is the store... Maybe something like this? I guess it would be a different PR for this though.

initCopyOptionsWithStore(store, &cp.Options{
                ReportWriter:          reportWriter,
                SourceCtx:             sourceCtx,
                DestinationCtx:        destinationCtx,
                ForceManifestMIMEType: manifestType,
                RemoveSignatures:      removeSignatures,
                SignBy:                addSigner,
                OciEncryptConfig:      ociEncryptConfig,
                OciDecryptConfig:      ociDecryptConfig,
                OciEncryptLayers:      ociEncryptLayers,
        })

Consolidating the retry options

type copyRetryOptions struct{
    maxRetries int
    retryDelay time.Duration
}

@rhatdan
Copy link
Member

rhatdan commented Apr 15, 2020

@mtrmac @vrothberg @nalind PTAL

@rhatdan
Copy link
Member

rhatdan commented Apr 15, 2020

getEncryptConfig is not used?
This looks good, but we will want you to squash the commits when you are done.

@lumjjb lumjjb force-pushed the enc_cont branch 2 times, most recently from 88c1934 to db18a06 Compare April 15, 2020 17:25
@lumjjb
Copy link
Contributor Author

lumjjb commented Apr 15, 2020

Thanks. good catch. Rebased master and squashed as well.

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK (but I didn’t review the CLI machinery in detail, I only read the PR diffs without full context).

commit.go Outdated Show resolved Hide resolved
commit.go Outdated Show resolved Hide resolved
docs/buildah-bud.md Outdated Show resolved Hide resolved
docs/buildah-pull.md Outdated Show resolved Hide resolved
docs/buildah-push.md Outdated Show resolved Hide resolved
@lumjjb lumjjb force-pushed the enc_cont branch 4 times, most recently from a6074a9 to 13337bb Compare May 18, 2020 19:45
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
@lumjjb
Copy link
Contributor Author

lumjjb commented May 19, 2020

@mtrmac @TomSweeneyRedHat Addressed the comments!

I am thinking that I could do another PR after this one to write something in docs/tutorials on image security - including both signing and encryption as part of that tutorial to provide more context.

**--encryption-key** *key*

The [protocol:keyfile] specifies the encryption protocol, which can be JWE (RFC7516), PGP (RFC4880), and PKCS7 (RFC2315) and the key material required for image encryption. For instance, jwe:/path/to/key.pem or pgp:admin@example.com or pkcs7:/path/to/x509-file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -178,6 +178,10 @@ The [username[:password]] to use to authenticate with the registry if required.
If one or both values are not supplied, a command line prompt will appear and the
value can be entered. The password is entered without echo.

**--decryption-key** *key*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest the following, ditto for the other man pages with decryption-key

Suggested change
**--decryption-key** *key*
**--decryption-key** *key[:passphrase]*

@TomSweeneyRedHat
Copy link
Member

One nit scattered across several of the pages, otherwise LGTM.
A follow up tutorial and/or blog for buildah.io would be very welcomed!

Signed-off-by: Brandon Lum <lumjjb@gmail.com>
@lumjjb
Copy link
Contributor Author

lumjjb commented May 19, 2020

Fixed!

@rhatdan
Copy link
Member

rhatdan commented May 19, 2020

Tests are still failing?

@lumjjb
Copy link
Contributor Author

lumjjb commented May 19, 2020

Interesting, it was just passing the last commit and just doc changes... let me check it out.

@lumjjb
Copy link
Contributor Author

lumjjb commented May 19, 2020

Ah - seems to have something to do with Quay.io being down.

[+0028s] Error: unable to pull quay.io/libpod/in_podman:master: unable to pull image: Error initializing source docker://quay.io/libpod/in_podman:master: unexpected http code: 500 (Internal Server Error), URL: https://quay.io/v2/auth?scope=repository%3Alibpod%2Fin_podman%3Apull&service=quay.io

@TomSweeneyRedHat
Copy link
Member

bors retest

@TomSweeneyRedHat
Copy link
Member

Kicked the test runs again, hopefully quay.io is happy again.

@rhatdan
Copy link
Member

rhatdan commented May 21, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented May 21, 2020

Build succeeded:

@bors bors bot merged commit ab1adf1 into containers:master May 21, 2020
@lumjjb
Copy link
Contributor Author

lumjjb commented May 21, 2020

🎉

@TomSweeneyRedHat
Copy link
Member

Awesome work @lumjjb !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants