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

First commits #1

Merged
merged 92 commits into from
Nov 12, 2021
Merged

First commits #1

merged 92 commits into from
Nov 12, 2021

Conversation

jsf9k
Copy link
Member

@jsf9k jsf9k commented Nov 4, 2021

🗣 Description

This pull request contains the initial commits for this project.

💭 Motivation and context

This project's functionality is necessary for the RPT UAT taking place in the COOL.

See also:

🧪 Testing

I have applied these changes to env0 in our staging COOL environment and verified that they function as expected.

✅ Checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.
  • Finalize version.

They are really doing the same thing, and the OS doesn't matter in this case.
Also add a new function for removing ghost instances, i.e. instances
in the DB that no longer exist in AWS.  Such a thing can happen if
instances are terminated while the Guacamole server is down.
They do not appear to do what I thought they would.
This is useful for testing, although it isn't the way the utility is usually run.
This allows us to wrap it in a try block, so we can repeat the loop if
the connection fails.
@jsf9k jsf9k requested review from mcdonnnj and dav3r November 10, 2021 18:35
LGTM complains about this on the grounds that it is confusing.
We must use the same password hashing algorithm as is used in the
Guacamole source code, so we cannot avoid the LGTM warning.
Our linters think this is logging of sensitive information, which is
reasonable.
@lgtm-com
Copy link

lgtm-com bot commented Nov 10, 2021

This pull request introduces 1 alert and fixes 1 when merging da2df6b into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

@lgtm-com
Copy link

lgtm-com bot commented Nov 10, 2021

This pull request introduces 1 alert and fixes 1 when merging 70e3616 into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

👍 👍

src/guacscanner/guacscanner.py Outdated Show resolved Hide resolved
src/guacscanner/guacscanner.py Outdated Show resolved Hide resolved
tests/test_guacscanner.py Outdated Show resolved Hide resolved
jsf9k and others added 2 commits November 10, 2021 15:09
… variables together

Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
@lgtm-com
Copy link

lgtm-com bot commented Nov 10, 2021

This pull request introduces 1 alert and fixes 1 when merging 36025de into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

…on inputs

This simplifies function signatures and makes modifying the list of
connection parameters less error-prone.

Co-authored-by: Nick M <50747025+mcdonnnj@users.noreply.github.com>
@jsf9k jsf9k requested review from dav3r and felddy November 11, 2021 04:16
@lgtm-com
Copy link

lgtm-com bot commented Nov 11, 2021

This pull request introduces 1 alert and fixes 1 when merging 95de413 into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Strong work again 💪💪💪Thank you for taking my suggestions into consideration. I had one question below that isn't an immediate blocker.

src/guacscanner/guacscanner.py Outdated Show resolved Hide resolved
@mcdonnnj pointed out that psycopg.connect() does not entirely act as
expected in that it does not automatically close the connection when
you exit the context.  It only rolls back transactions in the event
that one fails.

Since we are managing transactions in this code via explicit calls to
psycopg.Connection.commit(), the context manager isn't actually buying
us anything; therefore, I have gotten rid of it.

I added an explicit psycopg.Connection.close() at the bottom of the
loop.  I don't want to create the connection outside the loop and
leave it open because the guacscanner may be up and running for months
at a time, and who knows what could go wrong.  It seems safer to just
recreate the connection at the top of the loop.
@lgtm-com
Copy link

lgtm-com bot commented Nov 12, 2021

This pull request introduces 1 alert and fixes 1 when merging 51bf9d2 into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

@lgtm-com
Copy link

lgtm-com bot commented Nov 12, 2021

This pull request introduces 1 alert and fixes 1 when merging 73e625f into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

@lgtm-com
Copy link

lgtm-com bot commented Nov 12, 2021

This pull request introduces 1 alert and fixes 1 when merging d3887b2 into 361a06a - view on LGTM.com

new alerts:

  • 1 for Use of a broken or weak cryptographic hashing algorithm on sensitive data

fixed alerts:

  • 1 for Clear-text logging of sensitive information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants