如何使用 HP SCA 扫描我的 iOS 项目并获取报告

How to use HP SCA to scan my iOS project and get a report

Windows:

我在我的 Windows7 64 位机器上安装了 HP SCA 4.21,带有许可证和规则包。

我在同一台机器上下载了我的 iOS 项目。

然后我做了以下事情:

  1. 我打开AuditWorkbench,"Start New Project"下只有两个选项:"Scan Java Project"和"Advance Scan..."。我选择高级扫描

  2. 我选择了iOS项目的根目录,.h和.m文件根本没有显示,只显示了html文件。

  3. 我一直坚持到最后发现它只扫描了那些 html 个文件。

Mac:

然后我在我的 Mac mini(OSX-10.10, Xcode-6.2, iOS-8.2) 上安装了 SCA 4.21 并下载了 iOS 项目。

我按照同样的步骤得到了同样的结果,它也没有识别 .h 和 .m 文件。

然后我在终端中使用sourceanalyze命令:

sourceanalyzer -b YYYY -clean
sourceanalyzer -b YYYY xcodebuild -project YYYY.xcodeproj -target YYYY -configuration Debug =sdk iphonesimulator8.2 ARCHS=i386 GCC_TREAT_WARNINGS_AS_ERRORS=NO OTHER_CFLAGS="-w"

然后xcodebuild编译了项目,但是产生了很多错误,比如:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:86:1: error: 'objc_returns_inner_pointer' attribute only applies to methods
@property (readonly) __strong const char *fileSystemRepresentation NS_RETURNS_INNER_POINTER NS_AVAILABLE(10_9, 7_0);
^                                                                  ~~~~~~~~~~~~~~~~~~~~~~~~
9 errors generated.

然后我输入了命令:

sourceanalyzer -b buildID -scan -f buildID.fpr

这给了我这样的东西:

[warning]: NST file: /Users/xxx/.fortify/sca6.2/build/yyy/Users/xxx/Documents/workspace/YYYY/AFNetworking/AFNetworkReachabilityManager.m.nst does not exist or removed.
[warning]: Some errors or warnings were suppressed.  Check the results file for a full listing of all warnings and errors.

我打开buildID.fpr,workbench告诉我:

我的直觉告诉我一个可能的事实,那就是出了点问题,而且非常错误。

刚好不知道这里的问题

我在 Windows 机器上成功完成了 运行 Android 项目。

好像不支持Object-C,不过我怀疑。

我是否需要支持 iOS object-c 的特殊许可证?我不这么认为,但我不确定。

那么,著名的问题来了:

How to use HP SCA to scan my iOS project and get a report?

任何人,任何建议,任何帮助?

好的,我通过应用修补程序解决了我的问题。但我认为他们现在可以通过最新版本支持它。

在 Mac 上,但是 SCA 4.21 不支持 Xcode 6.2,因此我们实际上并未扫描任何源。对 Xcode 6.2 的支持将作为我没有尝试的 v4.30 的一部分发布。

有一个可用的实验性修补程序,它至少可以让我们在 v4.21 中获得一些结果 - 要获得此修补程序,请发送电子邮件至 fortifytechsupport@hp.com 的支持团队。他们将能够提供进一步的帮助。

或者,search/posting 在 protect724.hp.com 结束。那就是 Fortify 社区。 感谢@Eric