Comments (6)
The rule giving you issues is controlled at:
https://github.com/Netflix/bless/blob/master/bless/request/bless_request.py#L11
Linux Distributions have a mixed bag of allowable usernames.
See the Caveats of
http://man7.org/linux/man-pages/man8/useradd.8.html#CAVEATS ( most restricted )
http://manpages.ubuntu.com/manpages/trusty/man8/useradd.8.html ( suggested to use most restricted rules, but allows more )
http://linux.die.net/man/8/useradd ( most permissive )
I wouldn't object to a config that controlled which of the 3 regex patterns validated usernames.
from bless.
@russell-lewis I have a use case where I want to be able to provide certain characters, e.g. '@' or '.' (I want to pass an email address as bastion_user to BLESS). Currently, that is not possible. I was thinking about introducing the flag to turn the username validation on/off. However, I am not sure if such functionality would be accepted nor how to tackle it.
I can easily introduce new directive in the configuration file, but bless_request.py does not touch the config file. I can introduce it and do something like:
VALIDATE_USER = config.get(VALIDATE_USER) def validate_user(user): if VALIDATE_USER: if len(user) > 32: raise ValidationError('Username is too long.') if USERNAME_PATTERN.match(user) is None: raise ValidationError('Username contains invalid characters.')
However, I don't consider this to be a good solution. I have looked at marshallow documentation on how to extend the schema with new attributes (https://marshmallow.readthedocs.io/en/latest/extending.html) and maybe that would be acceptable. What would you suggest?
from bless.
@russell-lewis ping
from bless.
@xen0l it looks like @diasjorge has gone ahead and taken an approach along the lines of what you were trying to avoid. I agree with you that using schema.context to control the validation would be more desirable. Next week I should have some time to take a pass at enhancing #43 accordingly.
from bless.
It looks like there are use cases for the following validations:
The current useradd behavior.
A relaxed debian behavior. (This would work for @diasjorge and @Nr18 )
An e-mail validator. ( Can use Marshmallow's fields.Email )
Disabled validation. (Fields.String, no length checks)
from bless.
This issue should now be resolved in master.
from bless.
Related Issues (20)
- Is Marshmellow<3 required to function? HOT 4
- Invalid Key length when using gpg-agent
- Is this project still under development HOT 1
- Ability to sign SSH certificate with SHA2 HOT 4
- hope
- Nonstandard SSH port HOT 1
- Add optional parameters HOT 3
- Optional parameter [kmsauth token] cannot be passed in HOT 3
- Are you guys aware of anything similar to this for Google Cloud Platform? HOT 2
- How has to be the kmsauth token created? HOT 1
- Amazonlinux make bug HOT 2
- Unable to login with the cert got from lambda function HOT 1
- make test fails on deprecated warnings [linting] HOT 5
- document `-m PEM` option to ssh-keygen
- .travis.yml: The 'sudo' tag is now deprecated in Travis CI
- Authorization with BLESS? HOT 1
- Support authentication with OpenID Connect HOT 4
- How to make the bastion transparent for users
- Add the possibility to use encrypted private key with KMS HOT 2
- Potential dependency conflicts between bless and boto3 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bless.