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

Prevent the retrieval of API tokens after creation #8853

Closed
jeremystretch opened this issue Mar 11, 2022 · 6 comments
Closed

Prevent the retrieval of API tokens after creation #8853

jeremystretch opened this issue Mar 11, 2022 · 6 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

NetBox version

v3.1.9

Feature type

New functionality

Proposed functionality

I'm opening this FR to explore the idea of preventing the export of API tokens after their creation. Upon creating a token, users would have one opportunity to copy the token out of NetBox, after which it will be functional but no longer accessible.

As there are likely use cases where retaining the ability to retrieve tokens is necessary, this should be implemented as a configuration parameter (e.g. ALLOW_TOKEN_RETRIEVAL = False). I don't anticipate any changes to the database, unless agreement is reached to remove this ability entirely.

Use case

Provides greater security, as users can no longer retrieve API tokens from NetBox. If a token is lost, it will need to be replaced and all API consumers which used it will need to be updated with the new token.

Database changes

No response

External dependencies

No response

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Mar 11, 2022
@DanSheps
Copy link
Member

Just to add, as I can potentially see it being an ask in the future, maybe also have a "Allow Token Retrieval" permission so that that can be locked down to a specific user/group.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label May 18, 2022
@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation pending closure Requires immediate attention to avoid being closed for inactivity labels May 18, 2022
@PieterL75
Copy link
Contributor

you could show the first 4 and last 4 digits, so that there still is a way to link an token in a 'lost' script to an account

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Jul 27, 2022
@jeremystretch jeremystretch added this to the v3.4 milestone Jul 27, 2022
@arthanson arthanson self-assigned this Sep 22, 2022
@abhi1693
Copy link
Member

Would this also somehow scramble it in the DB? Because it's a simple query to retrieve it for anyone access to the shell.

@arthanson
Copy link
Collaborator

@jeremystretch do we want to encrypt this in the database? Or just mask it on the frontend?

@DanSheps
Copy link
Member

I personally don't see the point. Anyone who has access to the Shell has access to do a lot more then simply obtain the API key, all without logging as well.

@jeremystretch jeremystretch self-assigned this Nov 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

5 participants