示例#1
0
        public void SetupFromConfiguration()
        {
            foreach (var app in application_profiles)
            {
                _dscLogic.MakeItSoPolicy(app, app.policy);
                _dscLogic.MakeItSoApp(app);
                _dscLogic.MakeItSoTeam(app);
                _dscLogic.MakeItSoSandboxes(app);
                foreach (var user in app.users)
                {
                    user.teams         = app.application_name;
                    user.email_address = _rand.Next(1000000).ToString() + user.email_address;
                    _dscLogic.MakeItSoUser(user, app);
                }
                Assert.IsTrue(_veracodeService.DoesAppExist(app));
                Assert.IsTrue(_veracodeService.DoesPolicyExist(app));
                Assert.IsTrue(_veracodeService.DoesTeamExistForApp(app));
                Assert.IsTrue(_veracodeService.DoSandboxesExistForApp(app));

                foreach (var user in app.users)
                {
                    Assert.IsTrue(_veracodeService.DoesUserExist(user));
                }
            }
        }
示例#2
0
        static int Configure(ConfigureOptions options)
        {
            _logger.LogDebug($"Entering {LoggingHelper.GetMyMethodName()} with scan options {options}");
            var _localizationRepository = LoggingHelper.GetLocalizationRepository(options.Language);

            _logger.LogInformation(_localizationRepository.GetText("INFO00001", options.ToString()));

            var declareConfigRepository = new DeclareConfigurationRepository(options.JsonFileLocation);

            foreach (var app in declareConfigRepository.Apps())
            {
                _logger.LogInformation($"Starting build for {app.application_name}");

                _dscLogic.MakeItSoPolicy(app, app.policy);

                if (!_dscLogic.MakeItSoApp(app))
                {
                    return(0);
                }

                _dscLogic.MakeItSoTeam(app);
                foreach (var user in app.users)
                {
                    user.teams = app.application_name;
                    _dscLogic.MakeItSoUser(user, app);
                }
                _dscLogic.MakeItSoMitigations(app);
                _dscLogic.MakeItSoSandboxes(app);
                _logger.LogInformation($"build complete for {app.application_name}");
            }

            _logger.LogDebug($"Exiting {LoggingHelper.GetMyMethodName()} with value {1}");
            return(1);
        }