Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

Conversation

@baude
Copy link
Member

@baude baude commented Aug 17, 2016

Allow atomic users to sign an images that has been pulled
from a repository. This uses GPG, skopeo, and friends and
creates a local signature file for a image that has been
pulled locally. Signatures are stored in the dir:

/etc/pki/containers/registry/image_name@sha256:image_id/

Individual signature files are then stored as:

../signature-(INTEGER)

where INTEGER is incremented each time a signature
is added.

@rhatdan
Copy link
Member

rhatdan commented Aug 17, 2016

Please resync your pull .

Atomic/atomic.py Outdated
results = '/var/lib/atomic'
skull = (u"\u2620").encode('utf-8')


Copy link
Member

Choose a reason for hiding this comment

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

Remove

@baude baude force-pushed the sign_verify branch 7 times, most recently from e3ebf04 to c754981 Compare August 18, 2016 15:37
Atomic/client.py Outdated
def ids_same(id1, id2):
if id1 == id2:
return True
if no_shaw(id1) == no_shaw(id2):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this discarding the algorithm identifier? At a first glance I can’t see any reason for this, and it could allow attacks using a weaker algorithm against a stronger one.

Copy link
Member Author

Choose a reason for hiding this comment

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

In atomic, the image/container ids are exposed without the sha256 pre-pended. There was confusion about what sha sum was being used in the local filesystem. We thought it was the image ID but if it is the manifest, this is no longer needed.

@rh-atomic-bot
Copy link

☔ The latest upstream changes (presumably f97e97f) made this pull request unmergeable. Please resolve the merge conflicts.

Atomic/sign.py Outdated
fq_sig_path = os.path.join(self.args.output)
self.make_sig_dirs(os.path.dirname(fq_sig_path))

util.skopeo_standalone_sign(sign_image, manifest_file.name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does sign_image here really work, always, when verifying against a policy? AFAICS it would be necessary to do the equivalent of reference.WithDefaultTag.

@baude
Copy link
Member Author

baude commented Aug 24, 2016

@rhatdan @mtrmac look better now?

atomic Outdated
signp = subparser.add_parser("sign", help="Sign an image",
epilog="Create a signature for an image which can be used later to verify it.")
signp.set_defaults(_class=Sign, func="sign")
signp.add_argument("sign_targets", nargs="*", help=_("images to sign"))
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 images?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok changed.

if sigs[0] == 0:
del sigs[0]
missing = missing_ints(sigs)
if missing == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAICS this can never happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

resolved by a different solution.

@rh-atomic-bot
Copy link

☔ The latest upstream changes (presumably 84cc530) made this pull request unmergeable. Please resolve the merge conflicts.

@rhatdan
Copy link
Member

rhatdan commented Aug 30, 2016

@baude sorry doing some shuffling of code around in atomic command, so this needs a rebase.

Atomic/util.py Outdated
# If signature path is defined, get it; else return default
signature_path = get_atomic_config_item(['default-sigstore-path'], atomic_config=atomic_conf)
if signature_path is None:
signature_path = '/var/lib/atomic/containers'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is redundant.

Copy link
Contributor

Choose a reason for hiding this comment

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

(See above; I don’t think there even should be a default location to be used for the whole internet, and then the issue of redundancy between the signing code and the argument parsing + help disappears.)

Allow atomic users to sign an images that has been pulled
from a repository.  This uses GPG, skopeo, and friends and
creates a local signature file for a image that has been
pulled locally.  Signatures are stored in the dir:

/var/lib/atomic/containers/registry/image_name@sha256:image_id/

Individual signature files are then stored as:

  ../signature-(INTEGER)

where INTEGER is incremented each time a signature
is added.
@baude
Copy link
Member Author

baude commented Sep 2, 2016

@rh-atomic-bot r+

@rh-atomic-bot
Copy link

📌 Commit 90a595a has been approved by baude

@rh-atomic-bot
Copy link

⌛ Testing commit 90a595a with merge 683c0fa...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: baude
Pushing 683c0fa to master...

@rh-atomic-bot rh-atomic-bot changed the title Introduce signing [merged] Introduce signing Sep 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants