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

Inclui novas variáveis de ambiente. #196

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

samuelveigarangel
Copy link
Contributor

@samuelveigarangel samuelveigarangel commented Oct 16, 2024

O que esse PR faz?

Incluí novas váriaveis de ambiente.

Onde a revisão poderia começar?

Indique o caminho do arquivo e o arquivo onde o revisor deve iniciar a leitura do código.

Como este poderia ser testado manualmente?

Estabeleça os passos necessários para que a funcionalidade seja testada manualmente pelo revisor.

Algum cenário de contexto que queira dar?

De acordo com Readme do projeto opac_5, foi incluído novas variáveis.

Screenshots

N/A

Quais são tickets relevantes?

#184
#206

Referências

N/A

Copy link

gitguardian bot commented Oct 16, 2024

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
13840232 Triggered Generic High Entropy Secret ff66c41 .envs/.production-template/.flask View secret
13840232 Triggered Generic High Entropy Secret b51f7f6 .envs/.production-template/.flask View secret
13840232 Triggered Generic High Entropy Secret 7df7246 .envs/.production-template/.flask View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@gitnnolabs
Copy link
Collaborator

@samuelveigarangel @robertatakenaka sobre essa atividade tenho dúvida sobre a definição dela, me explico:

É para termos todas as variáveis de ambientes na pasta .envs? ou é para termos as variáveis mais utilizadas?

De fato olhando o PR e olhando os arquivos não temos todas as variáveis de ambiente no diretório .envs, exemplo:

  • GOOGLE_VERIFY_RECAPTCHA_KEY
  • GOOGLE_RECAPTCHA_SECRET_KEY

Esse é um exemplo de variável que deve está em .envs pensado nos países é uma variável que deve ser trocada, cada país deve term sua conta de recaptcha.

A variável DEFAULT_EMAIL e OPAC_EMAIL_ACCOUNTS_RECEIVE_ERRORS são outros exemplos.

Sugiro que todos as variáveis de ambiente estejam nesses arquivos da pasta .envs ou tenha um cabeçalho que indica as variáveis, assim com existe no arquivo default.py que indicar todas as variáveis de ambiente possíveis.

Vejam: https://github.com/scieloorg/opac_5/blob/master/opac/webapp/config/default.py#L6

@@ -21,12 +21,24 @@ OPAC_SECRET_KEY=NWhWFn_ScpW6YR9yJKDLxg
# Name for MongoDB host
OPAC_MONGODB_HOST=opac_mongo

# Activate/Desactivate the cache of redis (default: True)
# Activate/Desactivate the cache of redis (default: False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show.

Comment on lines 44 to 47
- ./.envs/.production-template/.flask
- ./.envs/.production-template/.redis
- ./.envs/.production-template/.monitoring-apm
- ./.envs/.production-template/.metrics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel manter .production

Copy link
Member

@robertatakenaka robertatakenaka Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel o .envs/.production-template é para que ao baixar não sobrescreva o .envs/.production existente


# ORCID URL. default: http://orcid.org/
OPAC_ORCID_URL=http://orcid.org/
# enables/disables the presentation of collection metrics data (default: False). Possible values: True or False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel adicionar o conteúdo de .metrics para .flask. Como .metrics e .server não são aplicações, a configuração deveria estar em .flask. @gitnnolabs o que acha?

@robertatakenaka
Copy link
Member

@samuelveigarangel variáveis duplicadas, remover do redis:

# True or False
OPAC_CACHE_ENABLED=True

# Cache timeout (in seconds). Ex: 3600
OPAC_CACHE_DEFAULT_TIMEOUT=3600

OPAC_CACHE_CONTROL_MAX_AGE_HEADER=604800


OPAC_FORCE_USE_HTTPS_GOOGLE_TAGS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel faltou o = com o valor default

@@ -4,6 +4,30 @@
# This set the IP that the app will bind to run, default: 0.0.0.0
OPAC_SERVER_NAME=0.0.0.0

# Domain for the session cookie (default: OPAC_SERVER_NAME)
OPAC_SESSION_COOKIE_DOMAIN=OPAC_SERVER_NAME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel o valor default não pode ser OPAC_SERVER_NAME

@@ -0,0 +1,15 @@
# -------------------- Twitter ----------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel mover estas variáveis para o .flask

@robertatakenaka robertatakenaka changed the title Incluí novas variáveis de ambiente. Inclui novas variáveis de ambiente. Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants