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

Configure New Relic #1077

Merged
merged 6 commits into from
May 4, 2023
Merged

Configure New Relic #1077

merged 6 commits into from
May 4, 2023

Conversation

mogul
Copy link
Contributor

@mogul mogul commented May 3, 2023

No description provided.

@mogul mogul temporarily deployed to dev May 3, 2023 17:36 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 3, 2023 17:36 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

Terraform plan for management

No changes. Your infrastructure matches the configuration.
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

✅ Plan applied in Deploy to the dev and management cloud.gov environments #74

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

Terraform plan for dev

Plan: 1 to add, 2 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.dev.cloudfoundry_app.swagger will be updated in-place
  ~ resource "cloudfoundry_app" "swagger" {
      ~ docker_image                    = "swaggerapi/swagger-ui:latest" -> "swaggerapi/swagger-ui"
        id                              = "9d37d378-b26e-44ca-9e53-994224c903b4"
      ~ id_bg                           = "************************************" -> (known after apply)
        name                            = "swagger"
        # (13 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.dev.cloudfoundry_user_provided_service.credentials will be created
  + resource "cloudfoundry_user_provided_service" "credentials" {
      + credentials = (sensitive value)
      + id          = (known after apply)
      + name        = "newrelic-creds"
      + space       = "06525ba3-19c2-451b-96e9-ea4a9134e8b9"
    }

  # module.dev-egress.module.egress-proxy.cloudfoundry_app.egress_app will be updated in-place
  ~ resource "cloudfoundry_app" "egress_app" {
      ~ environment                     = (sensitive value)
        id                              = "f90568e3-36de-4ba6-bd86-666b11429754"
      ~ id_bg                           = "************************************" -> (known after apply)
        name                            = "egress"
        # (17 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 2 to change, 0 to destroy.

❌ Error applying plan in Deploy to the dev and management cloud.gov environments #74

@asteel-gsa asteel-gsa temporarily deployed to dev May 3, 2023 17:43 — with GitHub Actions Inactive
@asteel-gsa asteel-gsa temporarily deployed to management May 3, 2023 17:43 — with GitHub Actions Inactive
@asteel-gsa asteel-gsa temporarily deployed to dev May 3, 2023 18:03 — with GitHub Actions Inactive
@asteel-gsa asteel-gsa temporarily deployed to management May 3, 2023 18:03 — with GitHub Actions Inactive
@mogul mogul linked an issue May 3, 2023 that may be closed by this pull request
@mogul mogul temporarily deployed to dev May 3, 2023 23:05 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 3, 2023 23:05 — with GitHub Actions Inactive
@mogul mogul marked this pull request as ready for review May 3, 2023 23:22
@mogul
Copy link
Contributor Author

mogul commented May 3, 2023

I put the NEW_RELIC_LICENSE_KEY into the GitHub repository-level secrets. Let's review and merge this, and leave further customization of the newrelic.ini to future PRs!

@mogul mogul temporarily deployed to dev May 3, 2023 23:38 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 3, 2023 23:38 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 3, 2023 23:40 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 3, 2023 23:40 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 4, 2023 00:01 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 4, 2023 00:01 — with GitHub Actions Inactive
@mogul mogul mentioned this pull request May 4, 2023
@mogul mogul temporarily deployed to dev May 4, 2023 00:05 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 4, 2023 00:05 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 4, 2023 00:17 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 4, 2023 00:17 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 4, 2023 00:23 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 4, 2023 00:54 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 4, 2023 00:54 — with GitHub Actions Inactive
@JeanMarie-PM
Copy link
Contributor

You can run make lint locally to catch linting errors. You have have all the packages in place first - make compile, ptenv activate, etc.
We should probably create a make docker-lint

@mogul mogul temporarily deployed to dev May 4, 2023 02:27 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to management May 4, 2023 02:27 — with GitHub Actions Inactive
mogul and others added 5 commits May 3, 2023 22:32
Note that while the settings.py call to initialize() has no arguments,
it will make use of the environment variables set in .profile.
The proxy's not in use yet, but we'll probably forget to add this later.
@mogul mogul temporarily deployed to management May 4, 2023 05:32 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 4, 2023 05:32 — with GitHub Actions Inactive
@mogul
Copy link
Contributor Author

mogul commented May 4, 2023

We should probably create a make docker-lint

It might help me. I have a hard time investing effort in installing and configuring a bunch of toolchain pieces locally that I only occasionally use! Also it would help keep everyone developing using the same versions of tools, and allow us to control updates explicitly. The devContainer spec is for addressing exactly these problems, but I haven't ever had time to invest in making one for any of my projects!

@asteel-gsa
Copy link
Contributor

@mogul There is something we may want to consider, and we should probably have a discussion about it with @ChrisB-16. We should assess the "sensitivity" level of the data being ingested via new relic, and we should probably consider adding the newrelic.ini at some point, or if not, then we should export an evironment var to set high security mode to true. Documentation is provided here and can be utilized with the NEW_RELIC_HIGH_SECURITY var.

Something to noodle on for data security and submission.

@mogul
Copy link
Contributor Author

mogul commented May 4, 2023

That looks like something we'd definitely want to turn on for staging and prod. Devs might want it off for their local work and the dev environment though, so we should look into how hard it would be to have a separate account set up just for that.

Can you add a checklist item to the "Could" section of the main ATO issue? (Can't easily find it via the mobile client right now.)

@mogul
Copy link
Contributor Author

mogul commented May 4, 2023

Got it, it's #725. (The tasklists don't show up in GitHub Mobile so I wasn't sure if I had the right one.)

@asteel-gsa
Copy link
Contributor

asteel-gsa commented May 4, 2023

That looks like something we'd definitely want to turn on for staging and prod. Devs might want it off for their local work and the dev environment though, so we should look into how hard it would be to have a separate account set up just for that.

Can you add a checklist item to the "Could" section of the main ATO issue? (Can't easily find it via the mobile client right now.)

Another option we could do is just write it into the .profile as default. So if we are logging to the dev env, then we dont want it. Because it is a boolean and not a string, we shouldnt need to walk through the VCAP to determine if we need it. We already have the ENV based on the space_name.

if [$NEW_RELIC_ENVIRONMENT = 'dev'] then  
    export NEW_RELIC_HIGH_SECURITY = false
else
    export NEW_RELIC_HIGH_SECURITY = true
fi 

Just something to think about. It probably isnt a necessity now, but I think for our first implementation, it would be nice to set that value to false so we can see exactly what "sensitive" data is being sent to NR. My hunch, is that when we submit through the workflow, and the api returns back to the "browser" section of NR, it will likely contain sensitive data. I am fairly certain that would be just cause for a POAM, and we should implement this before we move into Staging/Production.

The other side of the coin, if the NR account for FAC is accessible via the whole TTS org, even for dev, we may want to turn this on anyway.

The other question, that perhaps @ChrisB-16 or @jadudm could answer, is exactly how sensitive the audit workflow is. If we are dealing with PII in any form, we should have this implemented anyway, because we probably don't want to be exposing PII to the NR telemetry for the entire org to see.

@mogul
Copy link
Contributor Author

mogul commented May 4, 2023

Another option we could do is just write it into the .profile as default. So if we are logging to the dev env, then we dont want it. Because it is a boolean and not a string, we shouldnt need to walk through the VCAP to determine if we need it. We already have the ENV based on the space_name.

if [$NEW_RELIC_ENVIRONMENT = 'dev'] then  
    export NEW_RELIC_HIGH_SECURITY = false
else
    export NEW_RELIC_HIGH_SECURITY = true
fi 

We can do that easily, sure, but if the feature is turned on server-side, then everything would be rejected from the dev environment...

If the agent is configured for high security via the UI but not locally, then the agent connections are rejected, and the agent will shut down. However, this won't shut down your application.

@mogul
Copy link
Contributor Author

mogul commented May 4, 2023

This PR should be ready to go btw, please review @JeanMarie-TTS!

@mogul mogul merged commit bdbaabb into main May 4, 2023
@mogul mogul deleted the 1007-setup-new-relic branch May 4, 2023 17:45
@mogul mogul mentioned this pull request May 4, 2023
@mogul mogul temporarily deployed to management May 4, 2023 18:05 — with GitHub Actions Inactive
@mogul mogul temporarily deployed to dev May 4, 2023 18:05 — with GitHub Actions Inactive
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.

Set up New Relic service
3 participants