aquasecurity / aquasecurity/cloudsploit

Parsing GCP Collector for App Engine Support

Open
#236 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
751
Avg merge
11d 9h
Merged PRs (30d)
3

Description

Are there any plans to include App engine support to the GCP collector?

I have attempted to include a custom app engine api, however am encountering issues in the way the execution method parses the query and calls the google module:

I have added the following snipped:

`collectors/google/collector.js`
```js
service: {
app: {
list: {
api: 'appengine',
version: 'v1',
location: null,
parent: true,
}
},
manyApi: true
},
```

and

`helpers/google/regions.js`
```js
service: {
app: ['global']
},
```

I then make use of the new API in a plugin with `apis: ['service:app:list']`

---

All of this results in errors, however.

It appears the issue is located in the `helpers/google/index.js` file. Specifically at line 325:
```js
} else if (callObj.parent) {
parentParams = {auth: callObj.params.auth, parent: callObj.params.parent};
executor['projects'][service][callKey](parentParams, LocalGoogleConfig, executorCb);
}
```

As this runs `executor = Appengine {context: , apps: {..., services: {..., list, ... }}`, however, `service = services`.

This results in the executor objecting being dereferenced incorrectly as the full expectation would be `executor['apps']['services']['list']`.

As it doesn't seem possible to have a three level executor call, I can only assume there must be a way to bring the executor object one level lower to start at `apps`.

I believe this is in someway related to the `myEngine` element.

---

I would greatly appreciate any feedback anyone has, whether related to any issues in my implementation or technical constrains within the original source.

Please let me know if I can provide any additional clarification or details.

Thanks

Contributor guide

Open the contributing guide

Research direction

Start by tracing the App Engine configuration in collectors/google/collector.js and helpers/google/regions.js into helpers/google/index.js, especially the execution path around line 325. Reproduce the service:app:list plugin call and inspect how myEngine and the executor are selected. Done means the GCP collector can invoke the App Engine list API without incorrect executor dereferencing.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, javascript
Domain
cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.