DefectDojo默认的用户名和密码

时间:2019-12-03 23:42:55

标签: passwords

我已经安装了一个devdodojo的DEV实例,我需要找到默认的登录名和密码。在安装过程中,状态为:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!  WARNNING: Dev install has hard coded credentials - you have been warned.  !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

,但不提供登录凭据,仅提供其创建的数据库的凭据。 如果我进入数据库,我唯一能找到的就是这个:

mysql> select * from dojo_cred_user;
Empty set (0.01 sec)

官方安装guide指出它是用户名:admin密码:administrator,但这不起作用。

默认密码和用户名是什么?

3 个答案:

答案 0 :(得分:0)

来自:https://github.com/DefectDojo/django-DefectDojo/blob/master/DOCKER.md

访问应用程序 导航到http://localhost:8080,您可以使用用户名admin登录。要查找管理员密码,请检查初始化容器的控制台输出的开头,通常将其命名为“ django-defectdojo_initializer_1”,或运行以下命令:

using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;


namespace UploadVideoBlob
{
    public static class Function1
    {
        [FunctionName("Function1")]
        public static async Task Run([BlobTrigger("video/{name}", 
            Connection = "DefaultEndpointsProtocol=https;AccountName=uploadvideoblob;AccountKey=XXXX;EndpointSuffix=core.windows.net")]Stream videoBlob, string name,
            Microsoft.Azure.WebJobs.ExecutionContext context, ILogger log)
        {
            UserCredential credential;
            using (var stream = new FileStream(System.IO.Path.Combine(context.FunctionDirectory, "client_secrets.json"), FileMode.Open, FileAccess.Read))
            {
                credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets,
                    // This OAuth 2.0 access scope allows an application to upload files to the
                    // authenticated user's YouTube channel, but doesn't allow other types of access.
                    new[] { YouTubeService.Scope.YoutubeUpload },
                    "user",
                    CancellationToken.None
                );
            }

            var youtubeService = new YouTubeService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = Assembly.GetExecutingAssembly().GetName().Name
            });

            var video = new Video();
            video.Snippet = new VideoSnippet();
            video.Snippet.Title = "Default Video Title";
            video.Snippet.Description = "Default Video Description";
            video.Snippet.Tags = new string[] { "tag1", "tag2" };
            video.Snippet.CategoryId = "22"; // See https://developers.google.com/youtube/v3/docs/videoCategories/list
            video.Status = new VideoStatus();
            video.Status.PrivacyStatus = "unlisted"; // or "private" or "public"
            var videosInsertRequest = youtubeService.Videos.Insert(video, "snippet,status", videoBlob, "video/*");
            await videosInsertRequest.UploadAsync();
        }
    }
}

或:

container_id=(`docker ps -a \ --filter "name=django-defectdojo_initializer_1" \ | awk 'FNR == 2 {print $1}'`) && \ docker logs $container_id 2>&1 | grep "Admin password:"

请确保记下重新生成应用程序时所需的第一个密码。

答案 1 :(得分:0)

如果您不记得管理员密码,可以使用以下命令创建新的超级用户:

$ docker-compose exec uwsgi /bin/bash -c 'python manage.py createsuperuser'

答案 2 :(得分:0)

您可以从官方 docker 文档中执行此命令,link

$ docker-compose logs initializer | grep "Admin password:"
initializer_1   | Admin password: XXXXXXXXXXXXXXXXXXXXXXXX