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

Whitelist cloud.gov IPs for server-side API keys [Due 12/29/19] #3979

Closed
2 tasks
lbeaufort opened this issue Sep 30, 2019 · 3 comments
Closed
2 tasks

Whitelist cloud.gov IPs for server-side API keys [Due 12/29/19] #3979

lbeaufort opened this issue Sep 30, 2019 · 3 comments
Assignees
Labels
High priority Security: low Remediate within 90 days

Comments

@lbeaufort
Copy link
Member

lbeaufort commented Sep 30, 2019

We should whitelist cloud.gov IPs for server-side API keys.

Private API keys (to be documented in fec-accounts repo) should only be used by cloud.gov apps, which have egress IPs.

We have TRUSTED_PROXY_IPS that are in environment vars for API umbrella and should follow a similar route for whitelisting the private api keys. When rotating the keys, we'll need to update the Key-ID env var. See

DOWNLOAD_WHITELIST_API_KEY_ID = env.get_credential('DOWNLOAD_WHITELIST_API_KEY_ID')

Completion criteria

  • put a note in the code to update the fec-accounts wiki if the key is rotated.
  • update the fec-accounts wiki with instructions on updating the env vars if the key is rotated.
@lbeaufort lbeaufort changed the title Whitelist cloud.gov IPs for server-side API keys Whitelist cloud.gov IPs for server-side API keys [Due 12/29/19] Sep 30, 2019
@lbeaufort lbeaufort added this to the Sprint 10.6 milestone Sep 30, 2019
@lbeaufort lbeaufort added Security: low Remediate within 90 days Needs refinement labels Sep 30, 2019
@pkfec
Copy link
Contributor

pkfec commented Dec 20, 2019

For private keys, mainly used for the server side calls, there is a setting in api umbrella that we can update to include the cloud.gov IP's. Thanks @lbeaufort for pointing this out. I have updated the setting for stage private key and tested the server side calls. They all seems to work as expected.

I will update the settings on prod space coming Monday 12/23.
cc @lbeaufort

@pkfec
Copy link
Contributor

pkfec commented Dec 26, 2019

In api umbrella, I have added clould.gov IP's to the prod private api key.

@pkfec pkfec closed this as completed Dec 26, 2019
@lbeaufort
Copy link
Member Author

@pkfec thanks so much for your work on this! I tried to use the private key on my local machine with curl and got the following error message:

{
  "error": {
    "code": "API_KEY_UNAUTHORIZED",
    "message": "The api_key supplied is not authorized to access the given service. Contact us at https://github.com/fecgov/openFEC/issues for assistance"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High priority Security: low Remediate within 90 days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants