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

Defect Dojo can't connect to JIRA - HTTP 500/ Issue not created in JIRA #3130

Closed
2 of 3 tasks
nbublikov opened this issue Oct 30, 2020 · 36 comments
Closed
2 of 3 tasks
Labels

Comments

@nbublikov
Copy link

nbublikov commented Oct 30, 2020

Bug description
I can't integrate Defect Dojo with JIRA. After filling in the configuration, the error "unable to authenticate, wrong password or ext .." but always right. Done with instruction https://defectdojo.readthedocs.io/en/latest/features.html#jira-integration

Steps to reproduce
Steps to reproduce the behavior:
image

when i click 'submit' in the UI i get this error in the logs
Screenshot_1

Expected behavior
I expect that the configuration with findinds will be added, marked active and verified will be launched in JIRA

Deployment method (select with an X)

  • Kubernetes
  • Docker
  • setup.bash / legacy-setup.bash

Environment information

  • Operating System: Ubuntu 18.04

If additional information is required, please write

@nbublikov nbublikov added the bug label Oct 30, 2020
@madchap
Copy link
Contributor

madchap commented Oct 30, 2020

It seems you're integrating with JIRA servicedesk and not JIRA software. It's possible that the API is not the same, hence why it'd be failing.

The JIRA integration is only tested on JIRA software.

@nbublikov
Copy link
Author

now a Jira Software + Jira SD instance, i.e. on one instance and then and then.

Could this be a problem?

@madchap
Copy link
Contributor

madchap commented Oct 30, 2020

It's not because they run on the same instance that the products share the same APIs.

@nbublikov
Copy link
Author

We sorted it out!!! On the JIRA side there were problems with the JIRA account rights

But there another question. I have project with finding and i want to push this finding in JIRA
image

I tap this
image

Then
image

Then i tap
image

Then
image

But issue in JIRA was not created, whats wrong in this way?
image

@nbublikov
Copy link
Author

Nothing in logs, after successfull add JIRA configuration
image

@nbublikov
Copy link
Author

or example with active, verified finding, but no issue in JIRA was created
image

@nbublikov nbublikov changed the title Defect Dojo can't connect to JIRA - HTTP 500 Defect Dojo can't connect to JIRA - HTTP 500/ Issue not created in JIRA Oct 30, 2020
@valentijnscholten
Copy link
Member

1: What version / branch / commit are you running
2: defect review has nothing to do with JIRA. To push to jira go to edit finding and on the bottom check push to jira checkbox and press save/submit/done

@nbublikov
Copy link
Author

  1. Tell me please, do you mean which version of defect dojo I'm using? Defect Dojo 1.7.1
  2. Reproduce step
    image

image
image
image

After finished
image
image

Nothing in logs
image

@nbublikov
Copy link
Author

In settings it connect to JIRA
image
image

@valentijnscholten
Copy link
Member

Please update to 1.9.0 or latest dev

@nbublikov
Copy link
Author

Thank you! Either today or on Monday we will update and write how it goes

@nbublikov
Copy link
Author

nbublikov commented Oct 30, 2020

update to 1.9.0, something goes on

image
image
image
Screenshot_1

@valentijnscholten
Copy link
Member

If you click see all alerts you can see the error. I doubt the error in the logs is from jira integration as it doesn't use oauth but basic authentication to connect to JIRA.

@nbublikov
Copy link
Author

I will try to make finding Active and Verified
image

@valentijnscholten
Copy link
Member

yeah, jira integration runs in the background so it's not always clear.

@nbublikov
Copy link
Author

Ok!

  1. I select finding
    image

  2. checkbox at verified, active
    image

image

  1. This finding
    image

  2. Select this finding and click there
    image

  3. This error in logs
    image

  4. In UI error log nothing about last finding 1098
    image

In JIRA in project SECURE, no new issues

Maybe somethins wrong, maybe need restart dojo?

@valentijnscholten
Copy link
Member

check the uwsgi and celery logs. just this one logline about oauth2 doens't really provide any insight.

@nbublikov
Copy link
Author

image

not very informative, right? (

@nbublikov
Copy link
Author

Perhaps only Oauth2.0 is configured in JIRA and basic is disabled, I will clarify

@nbublikov
Copy link
Author

Good day! Clarified.

1.OAuth2.0 is used in JIRA
2. Basic auth is also used in JIRA and it is not disabled

Any ideas?

@nbublikov
Copy link
Author

it's maybe similar issue?
#1487

@nbublikov
Copy link
Author

I also looked at this script, I don't see any mention of OAuth.2.0, hmmm

def new_jira(request):

I do not understand the reason for the error

@nbublikov
Copy link
Author

nbublikov commented Nov 2, 2020

Here's what I found.

  1. When the defectdojo creds knocks on the jira - all the rules (Authorization passed).
  2. When sending a webhook from jira - 403 error

httpclient-callbacks: thread-1627 WARN anonymous [cawebhooks.plugin.PublishTaskFactoryImpl $ PublishTaskImpl]

Client error - 403 when posting to webhook at https: //defectdojo.trarara.co/webhook/ '

@nbublikov
Copy link
Author

nbublikov commented Nov 2, 2020

I tried curl from the server jira address above -

<h1> 403 </h1>
    <hr />
    <h2>
        You don't have permission to do that. Contact your administrator for additional accesss.
    </h2>

@nbublikov
Copy link
Author

@valentijnscholten

@nbublikov
Copy link
Author

@nbublikov
Copy link
Author

Hi! I think we found error, but what is the best thing to do with it? Can this be the case in 1.9.1 too?
log.txt

@valentijnscholten
Copy link
Member

What kind of project is it? next gen projects can give this error.
Or are you saying it starts working if the jira account has admin rights?

@nbublikov
Copy link
Author

nbublikov commented Nov 9, 2020

Hi! It's not start working.

  1. What you mean "next gen projects"?
    next gen project is in JIRA Cloud, as I understand it, we don't have this, I have regular jira software, so it should be ok

2.attached 2 screenshots, with errors, when JIRA service account with and without global admin rights, according #3180 (comment)
with global admin rights

without global admib rights

image

Should JIRA have previously created the necessary issue types, for example: low, medium, high, etc ...?

@nbublikov
Copy link
Author

nbublikov commented Nov 9, 2020

image

The logs showed that he was trying to create a security task in the secure project. There is such a project, but there is no task type.

I am trying to transfer from Security to Task, I get an error,

I already saw that you are preparing a fix, we will update and I will try to do everything and write

UPD; after update to 1.9.2 config was successfully added, thanks!

@nbublikov
Copy link
Author

nbublikov commented Nov 9, 2020

Latest status:

kubectl -n prod logs -f defectdojo-celery-worker-xyz | grep "jira"

  1. I see this error
    log JIRA-DD 1.9.2.txt

  2. Question: Should JIRA have previously created the necessary issue types, for example: low, medium, high, etc ...?

@valentijnscholten
Copy link
Member

No. You need to configure the correct values in DD that are existing in your JIRA instance.

@nbublikov
Copy link
Author

Should I somehow modify these types in JIRA?
image

@nbublikov
Copy link
Author

Question: We have status id and category id
What id i should paste here?

image

@valentijnscholten
Copy link
Member

Better come to slack for support: https://github.com/DefectDojo/django-DefectDojo#getting-involved

@nbublikov
Copy link
Author

It was about the license. It was for Jira SD but not for Jira Software)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants