Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Getting enroll secret from osctrl-api endpoint #459

Closed
peterbogdan opened this issue Jul 11, 2024 · 6 comments
Closed

Getting enroll secret from osctrl-api endpoint #459

peterbogdan opened this issue Jul 11, 2024 · 6 comments
Assignees
Labels
osctrl-api osctrl-api related changes question❓ Further information is requested

Comments

@peterbogdan
Copy link
Contributor

Hello

I want to enroll some osquery nodes using osctrl but I have a bit of an question of where can I get the secret for this.

I see that the secret is refreshed or extended from the UI but I would like to be able to get this from the API endpoint directly using a Token.

I tried to look into the API endpoints but I am a bit lost and could not find a path that could return this info for me?
Is it possible to get this information via the API? can anyone with more knowledge point me in the right place to look for that?

Thank you.

@peterbogdan peterbogdan changed the title Getting enroll secret from osctrl-api endpoit Getting enroll secret from osctrl-api endpoint Jul 11, 2024
@peterbogdan
Copy link
Contributor Author

peterbogdan commented Jul 11, 2024

Managed to get the info I need using the /api/v1/environments/ endpoint.

But I see it has the authorization permissions is set to read & write: https://github.com/jmpsec/osctrl/blob/main/osctrl-api.yaml#L393-L395

should that be the case if only retrieving this info? I can see that in the UI I can access this information even if the user only has Read permissions

@javuto javuto self-assigned this Jul 12, 2024
@javuto javuto added question❓ Further information is requested osctrl-api osctrl-api related changes labels Jul 12, 2024
@javuto
Copy link
Collaborator

javuto commented Jul 12, 2024

Let me look into this and see what we can do

@peterbogdan
Copy link
Contributor Author

hello @javuto

Did you have some time to look into this?

@javuto
Copy link
Collaborator

javuto commented Aug 4, 2024

I am updating the documentation for the API first, until that is done, please look in the code of osctrl-api, thanks!

@javuto
Copy link
Collaborator

javuto commented Aug 10, 2024

Please check the up-to-date osctrl-api documentation in https://osctrl.net/openapi/doc.html

@javuto
Copy link
Collaborator

javuto commented Aug 12, 2024

Implemented in #475

@javuto javuto closed this as completed Aug 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
osctrl-api osctrl-api related changes question❓ Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants