DataMasque Portal

Management Commands

DataMasque provides several Django management commands for administrative and operational tasks.

Running Management Commands

To run a management command in a Docker deployment:

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh <command_name> [arguments]'

For Podman deployments:

podman exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh <command_name> [arguments]'

For Kubernetes deployments:

kubectl exec -it <admin-server-pod> -- bash -c 'bash django_manage.sh <command_name> [arguments]'

Available Commands

set_config

Set a DataMasque configuration setting by key and value.

The following arguments are required:

  • key (required): Configuration key to set
  • value (required): Value to set

DataMasque will automatically convert the value to the correct type for the configuration key:

  • Text values - Provided as-is (e.g., "smtp.example.com")
  • Numbers - Provided as digits (e.g., 587)
  • Boolean values - Use true/false, yes/no, 1/0, or on/off (case-insensitive)
  • Dates - Use format YYYY-MM-DD (e.g., 2025-01-15)
  • Date/times - Use format YYYY-MM-DD HH:MM:SS or YYYY-MM-DDTHH:MM:SS

Examples:

Set the SMTP server hostname:

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh set_config EMAIL_HOST "smtp.example.com"'

Set the SMTP port:

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh set_config EMAIL_PORT 587'

Configuration Keys Reference

Common configuration keys that can be modified with set_config:

Key Type Description
ALLOWED_HOSTS str Comma-separated list of allowed hosts
ALLOWED_CIDR_NETS str Comma-separated list of allowed CIDR networks
EMAIL_HOST str Hostname or IP address of SMTP server
EMAIL_PORT int Port to connect to SMTP server
EMAIL_HOST_USER str SMTP username
EMAIL_HOST_PASSWORD str SMTP password
EMAIL_TLS_SSL str SSL/TLS connection type (SSL, TLS, or empty)
SENDER str The email address that emails will be sent "from"
DISABLE_LOCAL_LOGINS bool Whether to disallow login from non-admin local accounts
RECEIVE_CC_EMAIL bool Whether to receive emails from DataMasque
GIT_REPOSITORY_URL str Git URL to connect to remote repository
GIT_BRANCH str Target branch name to push/pull rulesets
GIT_DIRECTORY_PATH str Target directory path to push/pull rulesets
LOCALITY str Locality for DataMasque seed files
DM_AI_ENGINE_URL str URL for the DataMasque AI Engine service used for unstructured data masking

For a complete list of available configuration keys, run set_config with an invalid key to see all options.

reset_allowed_hosts

Reset the ALLOWED_HOSTS configuration to allow access from any IP address.

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh reset_allowed_hosts'

This command is useful if the hostname or IP address of your DataMasque instance has changed.

axes_reset_username

Reset the failed login attempt counter for a user account that has been locked due to exceeding the maximum number of login attempts.

The following argument is required:

  • username (required): The username of the account to reset

Example:

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh axes_reset_username johndoe'

changepassword

Change the password for a user account. This command will prompt you to enter and confirm the new password.

The following argument is required:

  • username (required): The username of the account to change the password for

Example:

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh changepassword johndoe'

set_smtp_benefits_flag

Set the flag indicating that the SMTP benefits email has been sent. This prevents DataMasque from repeatedly sending the SMTP benefits email.

docker exec -ti datamasque_admin-server_1 bash -c 'bash django_manage.sh set_smtp_benefits_flag'