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

RAS Update #70

Merged
merged 28 commits into from
Feb 13, 2024
Merged

RAS Update #70

merged 28 commits into from
Feb 13, 2024

Conversation

lcarcaramo
Copy link
Member

@lcarcaramo lcarcaramo commented Feb 6, 2024

💡 Issue Reference

Issue: #60

💻 What does this address?

  • When the result XML returned by IRRSMO00 cannot be parsed, a dump of the raw result XML returned by IRRSMO00 should be created to aid in problem determination.
  • All post processing of the result returned by IRRSMO00 should be done on the Python side. The C code should return an exact copy of what IRRSMO00 returned back to Python.
  • Enable testing of IRRSMO00.call_racf()
  • Add testing to make sure all class attributes work with all function groups.
  • Update dependency versions.
  • Add dump_mode toggle to force the creation of dumps of the raw result XML returned by IRRSMO00 on all requests (failure and success).
  • Add irrsmo00_result_buffer_size to enable the size of the IRRSMO00 result buffer to be customized.
  • IRRSMO00 result buffer size defaults to 16KB.
  • IRRSMO00 result buffer size cannot be less than 10000 and should not be larger than 100000000 since it can lead to a SIGKILL signal being raised, which will result in the Python process that pyRACF runs under being kill.
  • Fixed bug in definition of _valid_segment_traits dictionary for DataSetAdmin. Updating _valid_segment_traits after calling the parent constructor breaks "Replace Existing Segment Traits" and "Update Existing Segment Traits" functionally. Moving this code to before calling the parent constructor fixes the problem.
  • Log warning messages for functionality that should only be used for development and debugging
  • Log warning messages for functionality that is experimental.
  • Added folders for exceptions and utilities for better organization.
  • Add Dumper for creation of dump files.
  • Hex Dumps get written to the console when debug is enabled and a dump of the raw IRRSMO00 result XML is created.
  • Hex Dumps written to the console are redacted.
  • raw dumps written to the file system are NOT redacted. These files are protected by being created with 600 permissions and IRRSMO00 already redacts passwords and passphrases which are among the most sensitive information that could be included in a security result. So, given the dump files are protected and sensitive information is more or less already redacted by IRRSMO00, it makes seems to dump the raw result XML from IRRSMO00 with no post processing at all to ensure that during problem determination, an exact copy of what IRRSMO00 returned is available to better determine if there is a problem with IRRSMO00 or if there is a problem pyRACF.

📟 Implementation Details

  • "Null byte fix logic" moved from the C side to the Python side.
  • Use y# in Py_BuildValue() to return an unmodified copy of the raw result XML from IRRSMO00.
  • Dump files are created at ~/.pyracf/dumps with the naming convention pyracf.<timestamp>.<md5>.dump.
  • All folders under ~/.pyracf (including the .pyracf folder itself) are created with 700 permissions and dump files are created with 600 permissions.
  • If any folders under ~/.pyracf (including the .pyracf folder itself) have any permissions other than 700, they will be dynamically updated during dump processing. This handles scenarios where the user sets incorrect/insecure permissions on these directories and when umask changes the permissions on folder creation.
  • Mocking IRRSMO00.__init__() is no longer necessary since updating the C code to function as a Python Extension and it also breaks new test cases introduced here. All Mocks of IRRSMO00.__init__() have been removed.

📋 Is there a test case?

Run test cases and try out new functionality manually.

Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
…ode.

Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
…mo00 response buffer size configurable.

Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
…d redaction to hex dump logging.

Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
…ssions.

Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
@lcarcaramo lcarcaramo added bug Something isn't working enhancement New feature or request labels Feb 6, 2024
@lcarcaramo lcarcaramo added this to the Beta 1.0b5 milestone Feb 6, 2024
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
Copy link
Collaborator

@ElijahSwiftIBM ElijahSwiftIBM left a comment

Choose a reason for hiding this comment

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

All looks good minus 1 minor typo. I do like the additional validation you added for buffer size. Good idea, and the test for it looks solid.

Signed-off-by: Leonard Carcaramo <lcarcaramo@ibm.com>
@ElijahSwiftIBM ElijahSwiftIBM self-requested a review February 13, 2024 13:36
Copy link
Collaborator

@ElijahSwiftIBM ElijahSwiftIBM left a comment

Choose a reason for hiding this comment

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

Looks great!

@ElijahSwiftIBM ElijahSwiftIBM merged commit dd23a06 into main Feb 13, 2024
4 checks passed
@ElijahSwiftIBM ElijahSwiftIBM deleted the feat/ras_security_updates branch February 13, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants