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

Roadmap for cli tools: repo.py, client.py #881

Closed
lukpueh opened this issue May 27, 2019 · 13 comments
Closed

Roadmap for cli tools: repo.py, client.py #881

lukpueh opened this issue May 27, 2019 · 13 comments
Labels
client Related to the client (updater) implementation discussion Discussions related to the design, implementation and operation of the project repository Related to the repository implementation

Comments

@lukpueh
Copy link
Member

lukpueh commented May 27, 2019

Description of issue or feature request:
Recently, several issues and some fixes related to the TUF command line tools repo.py and script.py have been brought forward: #873, #874, #876, #877, #878, #879, #880 and "Some comments on TUF..." on the mailinglist. These include concerns about the script names, unexpected behavior, missing TUF features, etc.

@awwad has pointed out that repo.py and client.py are mostly tutorial tools, useful to get familiar with TUF (see QUICKSTART.md). Whereas an actual TUF integration will require direct use of the underlying libraries tuf.repository_tool and tuf.client.updater.

Given the recent GitHub and mailing list activity around these tool, we need to either clarify that these tools are purely for educational purpose, or develop them more actively so that they can actually used by an integrator.

Thanks, @cminyard and @lixuefeng2 for bringing this to our attention!

Current behavior:
The use of and plans for repo.py and client.py are unclear.

Expected behavior:
Decide to what extent repo.py and client.py should be enhanced, maintained, etc.

@trishankatdatadog
Copy link
Member

trishankatdatadog commented May 28, 2019

I think we should just remove these old document and code altogether. I think it confuses people more than it does help them. What do others think?

@cminyard
Copy link

cminyard commented May 28, 2019 via email

@trishankatdatadog
Copy link
Member

@cminyard I don't disagree with you, but I think as a compromise we could move this code and documentation elsewhere. Does that sound agreeable to you?

@cminyard
Copy link

cminyard commented May 28, 2019 via email

@lukpueh
Copy link
Member Author

lukpueh commented May 29, 2019

Thanks for chiming in, @trishankatdatadog and @cminyard! Here are my 2 cents.

IMHO, the higher level of API abstraction should be split out of the repo code, cleaned up, and extended. Then a repo tool that is thought through well should be created on top of it in a way that it can be extended by others.

yes! Let's try to identify what parts, currently in repo.py/client.py (or missing from it), should be in repository_lib or repository_tool, and client.updater respectively, e.g. "add this set of files to the repository as this role", etc. (see #878 (review) for related observations).

...could move this code and documentation elsewhere

yes. The cli script(s) could live in a separate repo, e.g. tuf-cli, along with related documentation. Ideally, all they do is parsing arguments and call into the corresponding library functions (similar to what we do in in-toto/in-toto#in_toto_run.py). I am also happy to reconsider using an alternative to argparse. @trishankatdatadog, you seemed very fond of click?

@trishankatdatadog
Copy link
Member

@lukpueh click is awesomeness

@lukpueh
Copy link
Member Author

lukpueh commented Sep 17, 2019

Consider re-visiting related stale PRs, when addressing this issue:

Same goes for CLI-related issues:

@lukpueh
Copy link
Member Author

lukpueh commented Mar 13, 2020

@Silvanoc kindly provided the following bug reports related to repo.py:

This was referenced Jun 11, 2020
@joshuagl joshuagl added this to the 1.0.0 milestone Jul 7, 2020
@lukpueh
Copy link
Member Author

lukpueh commented Aug 21, 2020

More issues with the the cli tools, kindly reported by @Jakeler:

@lukpueh
Copy link
Member Author

lukpueh commented Aug 21, 2020

Maybe we should add a disclaimer to the cli tool docs that references this collection of issues. And maybe we should create an issue label instead of listing the issues here. :)

@Jakeler
Copy link

Jakeler commented Aug 21, 2020

Let's try to identify what parts, currently in repo.py/client.py (or missing from it), should be in repository_lib or repository_tool, and client.updater respectively, e.g. "add this set of files to the repository as this role", etc. (see #878 (review) for related observations).

How is the current state, has someone already looked at this?
Is there anything missing that blocks making repo.py/tuf-cli just a cmdline abstraction around repository_tool?

@lukpueh
Copy link
Member Author

lukpueh commented Aug 24, 2020

Is there anything missing that blocks making repo.py/tuf-cli just a cmdline abstraction around repository_tool?

Not directly missing, but we are in the process of planning a larger refactor of repository_tool and repository_lib, which should also make it a lot easier to build a command line interface. We will update about the status of the planned work here too.

@joshuagl joshuagl removed this from the 1.0.0 milestone Sep 8, 2020
@lukpueh lukpueh added this to the Alternative Interfaces milestone Sep 10, 2020
@joshuagl joshuagl added client Related to the client (updater) implementation discussion Discussions related to the design, implementation and operation of the project labels Sep 10, 2020
@joshuagl joshuagl added the repository Related to the repository implementation label Sep 10, 2020
lukpueh added a commit to lukpueh/tuf that referenced this issue Nov 6, 2020
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see theupdateframework#881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
lukpueh added a commit to lukpueh/tuf that referenced this issue Nov 9, 2020
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see theupdateframework#881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
lukpueh added a commit to lukpueh/tuf that referenced this issue Nov 11, 2020
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see theupdateframework#881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
lukpueh added a commit to lukpueh/tuf that referenced this issue Nov 11, 2020
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see theupdateframework#881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
MVrachev pushed a commit to MVrachev/tuf that referenced this issue Nov 11, 2020
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see theupdateframework#881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
MVrachev pushed a commit to MVrachev/tuf that referenced this issue Nov 13, 2020
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see theupdateframework#881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
lukpueh added a commit to lukpueh/tuf that referenced this issue Jan 25, 2022
TODO: polish commit message

-----
  - Remove outdated ATTACKS.md
    requires basic_client.py which was renamed to client.py in 2018
    and is removed in theupdateframework#1790 (host of problems with client.py described in theupdateframework#881)

    --> reference ticket TODO: create ticket

  - QUICKSTART.md also based on cli tools (see above)
    --> reference ticket TODO: create ticket

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@lukpueh
Copy link
Member Author

lukpueh commented Feb 23, 2022

Since the release of v1.0.0, python-tuf no longer provides repo.py and client.py cli tools.

  • Development of tutorial/quick-start -like CLI tools tracked in #1797 (alternatives are already available)
  • Development of production-use CLI tools (repository-side) tracked in #1136

@lukpueh lukpueh closed this as completed Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to the client (updater) implementation discussion Discussions related to the design, implementation and operation of the project repository Related to the repository implementation
Projects
None yet
Development

No branches or pull requests

5 participants