Skip to content

Conversation

aaronlippold
Copy link
Member

@aaronlippold aaronlippold commented Mar 4, 2022

MVP of the saf-cli lambda function. The function will supporting reading HDF data out of an s3 bucket and providing those file(s) to the SAF CLI app and then either pushing the result to the saf convert functions end-point and or writting the result to the perscribed s3 target bucket.

Items Left To Resolve

  • Properly param the input and outputs of the function, right now we are hardcoded to hdf2splunk
  • Remove any hard-coded data from above
  • Update the README and document installing the function
  • add unit-tests and mocks
  • add unit-test and mock data
  • Document local / mock testing
  • Document installation and update process
  • Break any repeated code into seperate file modules for import
  • Decide if we Migrate to the serverless framework to get some of the above
  • Publish on the AWS Marketplace of Functions - find out what that means :)
  • have a 🍺
yarick and others added 7 commits February 25, 2022 15:17
Signed-off-by: yarick <yarick@yarick.net>
Signed-off-by: yarick <yarick@yarick.net>
- added TODO items - paramaterized things that we have Signed-off-by: Aaron Lippold <lippold@gmail.com>
Signed-off-by: GitHub <noreply@github.com>
Added simple logging Fixed S3 get/save Signed-off-by: yarick <yarick@yarick.net>
Added winston template to match Lambda CloudWatch format Signed-off-by: yarick <yarick@yarick.net>
- adding logger to our throw/error cases - moved error checking to the top of the process so we did not start down a road that we couldn't go down for no reason - added lagger to the remaining console.log statments - fixed incorrect License reference in package.json - removed all unused commented code from files - removed unused files from project - standardized formatting and linting on files Signed-off-by: Aaron Lippold <lippold@gmail.com>
@aaronlippold aaronlippold added the enhancement New feature or request label Mar 4, 2022
@aaronlippold aaronlippold requested a review from yarick March 4, 2022 00:41
Signed-off-by: Aaron Lippold <lippold@gmail.com>
@aaronlippold aaronlippold changed the title Basic s3 MVP saf-cli Lambda Function Mar 4, 2022
@aaronlippold aaronlippold requested review from camdenmoors, ejaronne and em-c-rod and removed request for yarick March 4, 2022 01:11
Signed-off-by: Aaron Lippold <lippold@gmail.com>
Signed-off-by: Aaron Lippold <lippold@gmail.com>
Comment on lines +62 to +63
const HEC_TOKEN = "473b3297-1d88-4740-96ff-e6048e51b785";
const SPLUNK_SERVER = "splk1.efficacy.online";

Choose a reason for hiding this comment

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

Might want to remove this and clear git history

Suggested change
const HEC_TOKEN = "473b3297-1d88-4740-96ff-e6048e51b785";
const SPLUNK_SERVER = "splk1.efficacy.online";
const HEC_TOKEN = "YOUR_HEC_TOKEN";
const SPLUNK_SERVER = "YOUR_SPLUNK_SERVER";
app.js Outdated
let HDF_FILE = path.resolve("/tmp/", params.Key.toString());
Body = Body.toString();

const command_string = [CLI_COMMAND + ":" + CLI_FUNCTION, "-i", HDF_FILE, "-H", SPLUNK_SERVER, "-t", HEC_TOKEN];
Copy link

@camdenmoors camdenmoors Mar 4, 2022

Choose a reason for hiding this comment

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

The HDF2Splunk mapper is going to be taking a username/password or token in the future once moved to the splunk-sdk library.

Splunk options: mitre/heimdall2@d183b12#diff-19410c8789053ca0d35bbdd8acd403aa1e4165ed4b17d9733d763242817e9694R21-R26

yarick added 2 commits March 3, 2022 22:40
Signed-off-by: yarick <yarick@yarick.net>
app.js Outdated
}

// TODO: REMOVE ALL THESE COMMENTS
// TODO: Decide is we want to catch undefined saf-cli command groupings https://stackoverflow.com/questions/15201939/jquery-javascript-check-string-for-multiple-substringsa
Copy link
Contributor

Choose a reason for hiding this comment

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

I added this check in saf_action if that helps.
https://github.com/mitre/saf_action/blob/main/index.js#L9

- main

branches: [ main ]
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you want to draft releases on pull requests?

yarick added 3 commits March 4, 2022 09:56
Signed-off-by: yarick <yarick@yarick.net>
Signed-off-by: yarick <yarick@yarick.net>
Signed-off-by: yarick <yarick@yarick.net>
@aaronlippold
Copy link
Member Author

Closing in favor of #3

Please move your comments and reviews there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

4 participants