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

403 Forbidden to read the SSH public key from Vault #46

Open
dzintars opened this issue Jan 14, 2021 · 5 comments
Open

403 Forbidden to read the SSH public key from Vault #46

dzintars opened this issue Jan 14, 2021 · 5 comments
Assignees
Labels
solved Issue solved and left for visibility

Comments

@dzintars
Copy link
Owner

dzintars commented Jan 14, 2021

Basically by some reason cloud-init is not able to read the key which it is supposed to be able to do.
curl https://vault.oswee.com/v1/ssh-client-signer/public_key returns just an HAproxy's Forbidden HTML error page.
Not sure how curl handles https requests.

5c3527c

@dzintars dzintars self-assigned this Jan 14, 2021
@dzintars
Copy link
Owner Author

In general i should not request the public key.
Instead i should use app roles

@dzintars
Copy link
Owner Author

Turns out it's the issue of my curling.
FF devtools#networking provides option to Copy as cURL which lead me to this simple requests:

curl 'https://vault.oswee.com/ui/vault/auth?with=token' -H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'TE: Trailers'

This requests works just fine for me now inside of VM and i need to figure out which flags are mandatory.

@dzintars
Copy link
Owner Author

OK. In my case the User-Agent is the required flag.

@dzintars
Copy link
Owner Author

This is the minimal valid request, but the user agent is wrong.

curl 'https://vault.oswee.com/v1/ssh-client-signer/public_key' -H 'User-Agent: Mozilla/5.0' -H 'Upgrade-Insecure-Requests: 1'

@dzintars
Copy link
Owner Author

http-request deny if { req.hdr(user-agent) -i -m sub curl phantomjs slimerjs }

Curl was blocked. :)

@dzintars dzintars added the solved Issue solved and left for visibility label Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved Issue solved and left for visibility
Projects
None yet
Development

No branches or pull requests

1 participant