-
Notifications
You must be signed in to change notification settings - Fork 23
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
[WIP] ⭐️ atlassian provider #2042
Conversation
Connecting to atlassian and receiving organizations is working at this point
|
Atlassian APIs seem to have a few limitations, for example it doesn't seem possible to get all users within an organization but only managed users with verified domains |
Found out that the |
Got receiving users from jira to work - I still need to figure out limits / pagination for this
|
be777c9
to
4840891
Compare
asset.Name = conn.Host() | ||
|
||
asset.Platform = conn.PlatformInfo() | ||
asset.PlatformIds = []string{"//platformid.api.mondoo.app/runtime/atlassian"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work. Each asset needs to have a unique and consistent platform ID. This provider can produce 3 different assets now - jira, confluence and admin. Each of them needs to have unique platform ID that also contains the specific ID of the product instance that is being scanned. For example, when I scan 2 different Jira instances I need to have 2 different platform IDs. What probably makes most sense is to generate the platform ID in the specific connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be looking better now
conn := a.MqlRuntime.Connection.(*jira.JiraConnection) | ||
jira := conn.Client() | ||
validate := "" | ||
jql := "order by created DESC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this can be defined as a const
mqlAtlassianJiraIssue, err := CreateResource(a.MqlRuntime, "atlassian.jira.issue", | ||
map[string]*llx.RawData{ | ||
"id": llx.StringData(issue.ID), | ||
"project": llx.StringData(issue.Fields.Project.Name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess we can get more than this data. At least the name/description would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the description, I actually can't find a field name or title or anything similar
var conn shared.Connection | ||
var err error | ||
fmt.Println("Product: ", conf.Options["product"]) | ||
switch conf.Options["product"] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use the conf.Type
field for this. This is exactly what it is intended for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type just ends up being "atlassian" all the time, looking into it
Signed-off-by: Marius Kimmina <[email protected]>
bcab6d9
to
4969478
Compare
Work in progress