|
| 1 | +# ABAP Code Scanner Framework |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The ABAP Code Scanner Framework is a powerful tool designed to analyze ABAP (Advanced Business Application Programming) code for potential security vulnerabilities, code quality issues, and best practice violations. This framework provides a flexible and extensible way to scan ABAP code and generate comprehensive reports on various aspects of code security and quality. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- Multiple security checks including: |
| 10 | + - Cross-Site Scripting (XSS) vulnerabilities |
| 11 | + - Directory Traversal vulnerabilities |
| 12 | + - Hardcoded credentials |
| 13 | + - Weak cryptographic algorithms |
| 14 | + - And many more... |
| 15 | +- Customizable and extensible architecture |
| 16 | +- Command-line interface for easy integration into CI/CD pipelines |
| 17 | +- Detailed reporting in XLSX format |
| 18 | +- Configurable scan settings |
| 19 | + |
| 20 | +## Upcoming Feature: Dataflow Analysis |
| 21 | + |
| 22 | +We are excited to announce that we are working on implementing a dataflow analysis feature. This enhancement will significantly improve the accuracy and depth of our security scans. |
| 23 | + |
| 24 | +### What is Dataflow Analysis? |
| 25 | + |
| 26 | +Dataflow analysis is a technique used to track how data moves through an application. In the context of security, it helps identify how potentially tainted data (e.g., user inputs) propagates through the system and whether it reaches sensitive sinks (e.g., database queries, output functions) without proper sanitization. |
| 27 | + |
| 28 | +### Planned Functionality |
| 29 | + |
| 30 | +Our dataflow analysis will: |
| 31 | + |
| 32 | +- Track parameters and their contents from the beginning of functions, reports, forms, includes, or other ABAP structures. |
| 33 | +- Follow the data as it flows through the code, monitoring transformations and assignments. |
| 34 | +- Identify potential injection points where tainted data might be used unsafely. |
| 35 | +- Provide more accurate and context-aware vulnerability detection. |
| 36 | + |
| 37 | +This feature will enable the framework to: |
| 38 | +- Reduce false positives by understanding the context and transformations of data. |
| 39 | +- Detect complex vulnerabilities that simple pattern matching might miss. |
| 40 | +- Offer more detailed and actionable reports on potential security issues. |
| 41 | + |
| 42 | +We're working hard to integrate this feature and will update the framework once it's ready. Stay tuned for updates! |
| 43 | + |
| 44 | +## Prerequisites |
| 45 | + |
| 46 | +- Python 3.9 or higher |
| 47 | +- pip (Python package installer) |
| 48 | + |
| 49 | +## Installation |
| 50 | + |
| 51 | +1. Clone the repository: |
| 52 | + ``` |
| 53 | + git clone https://github.com/yourusername/AbapCodeScannerFramework.git |
| 54 | + cd AbapCodeScannerFramework |
| 55 | + ``` |
| 56 | + |
| 57 | +2. Install the required dependencies: |
| 58 | + ``` |
| 59 | + pip install -r requirements.txt |
| 60 | + ``` |
| 61 | + |
| 62 | +## Usage |
| 63 | + |
| 64 | +To run the ABAP Code Scanner: |
| 65 | + |
| 66 | +``` |
| 67 | +python main.py path/to/abap/code |
| 68 | +``` |
| 69 | + |
| 70 | +Optional arguments: |
| 71 | +- `-c`, `--config`: Path to the configuration file (default: config.yml) |
| 72 | + |
| 73 | +## Report |
| 74 | +When the program finishes successfully, you will find the abap_security_scan_report.xlsx file in the project folder. |
| 75 | +Below, you can see an example of the report file. |
| 76 | + |
| 77 | + |
| 78 | +## Configuration |
| 79 | + |
| 80 | +The scanner can be configured using a YAML file. By default, it looks for `config.yml` in the project root. You can specify a different configuration file using the `-c` or `--config` option. |
| 81 | + |
| 82 | +Example configuration: |
| 83 | + |
| 84 | +```yaml |
| 85 | +checks: |
| 86 | + - CheckCrossSiteScripting |
| 87 | + - CheckSQLInjection |
| 88 | + - CheckDirectoryTraversal |
| 89 | + |
| 90 | +file_extensions: |
| 91 | + - .abap |
| 92 | + - .txt |
| 93 | + |
| 94 | +exclude_patterns: |
| 95 | + - "**/test/**" |
| 96 | +``` |
| 97 | +
|
| 98 | +## Adding New Checks |
| 99 | +
|
| 100 | +To add a new security check: |
| 101 | +
|
| 102 | +1. Create a new Python file in the `checks` directory. |
| 103 | +2. Define a class that inherits from a base check class. |
| 104 | +3. Implement the required methods, including the main `run` method. |
| 105 | +4. Add the new check to the configuration file. |
| 106 | + |
| 107 | +## Running Tests |
| 108 | + |
| 109 | +To run the test suite: |
| 110 | + |
| 111 | +On Windows: |
| 112 | +``` |
| 113 | +run_tests.bat |
| 114 | +``` |
| 115 | + |
| 116 | +On Unix-like systems: |
| 117 | +``` |
| 118 | +./run_tests.sh |
| 119 | +``` |
| 120 | + |
| 121 | +## Contributing |
| 122 | + |
| 123 | +Contributions to the ABAP Code Scanner Framework are welcome! Please feel free to submit pull requests, create issues or spread the word. |
| 124 | + |
| 125 | +## License |
| 126 | + |
| 127 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 128 | + |
| 129 | +## Acknowledgments |
| 130 | + |
| 131 | +- Thanks to all contributors who have helped to improve this framework. |
| 132 | +- Special thanks to the ABAP community for their invaluable resources and documentation. |
| 133 | + |
0 commit comments