Skip to main content

aegis 0.17.0 copy "aegis: ^0.17.0" to clipboard
aegis: ^0.17.0 copied to clipboard

Security audit for Flutter, React Native, KMP and native Android/iOS apps: OWASP MASVS-mapped rules, MAS profile scoring (L1/L2/R), and reports in English and Arabic.

example/example.dart

// Audits a project from Dart code instead of the `aegis` command.
//
//   dart run example/example.dart example/vulnerable_app
//
// The bundled `vulnerable_app` is intentionally insecure, so it reports
// findings and a low score.
import 'dart:io';

import 'package:aegis/aegis.dart';

Future<void> main(List<String> args) async {
  final path = args.isEmpty ? 'example/vulnerable_app' : args.first;

  // `offline` skips the dependency advisory lookup, the only network call.
  final report = await runAudit(path, offline: true);

  stdout.writeln(
      ConsoleReporter(color: stdout.supportsAnsiEscapes).render(report));

  // The same report in machine-readable form.
  File('aegis-report.json').writeAsStringSync(renderJson(report));

  for (final rule in report.failed) {
    stdout.writeln('${rule.meta.id} ${rule.severity.name}: '
        '${rule.findings.length} finding(s)');
  }
  stdout.writeln('Score: ${report.score.value}/100, '
      'complete: ${report.complete}');

  // Mirror the CLI: a non-zero exit code when something needs fixing.
  exitCode = report.failed.isEmpty ? 0 : 1;
}
2
likes
0
points
692
downloads

Publisher

unverified uploader

Weekly Downloads

Security audit for Flutter, React Native, KMP and native Android/iOS apps: OWASP MASVS-mapped rules, MAS profile scoring (L1/L2/R), and reports in English and Arabic.

Repository (GitHub)
View/report issues

Topics

#security #static-analysis #cli #owasp #flutter

License

unknown (license)

Dependencies

archive, args, crypto, path, xml, yaml

More

Packages that depend on aegis