jonathanmorley / oktaws

Apache License 2.0
15 stars 10 forks source link

Errant linefeed in credentials file #163

Closed alfunk-cvent closed 1 year ago

alfunk-cvent commented 3 years ago

In some rare cases, the credentials file that Oktaws creates has a carriage return near the end of one of the secrets

It seems to happen for unknown reasons, and when the tokens change after a time period it goes away.

but here’s a simulated example of what it looked like:

aws_session_token=IQoJb3JpZ2luX2VjEND//////////wEaCXVzLWVhc3QtMSJHMEUCIQCvSw68s4gLV5AhSf4kdl/RXeXF2ZuyOBQ00Qiqb1jrOwIgYjI50QHHlSeZEPSSWzhS51r74YqL5YfXYbDuFXtkMlMqzAIIGRAAGgw1NzI3MjQyMDczNjQiDELNBO/7JQ5V0qjw6iqpAva5RNUEAjK2ZcWKqpFxTYNd5N6Q49Cxun/NYGT/uSKxN80UBiqpRaEngle1QD6J5b0bKzG1HYcCD95GfP6nPIUtbrU15e9s3VOZS7DpGGXNi7lSDlxwOgRqjHoNHO7bgtVMdltbWEJihCqAxaKrHEXHxYYqVNKnsLd1QoHoJO3OPrN/ 2qqynBCfzrn+tdqiPh05En2RdaNz2JncGJ/4lp1F6xjHaf87YVzIL+hS3v5YR59sQDGwyHs4Lfa8KGYIra8f9Qv3Ppr4KitgqINOreHDdWq8SWtScIUiLdGIvXtD71qM8ZakDtt6cmlD5w+Tss1om2wKpZWs+WFkYgLFBszlaxSkkCxqFSbArA98u/wZ58GWJTNJ0KWVDN1KqE6ejWt2DX5gFohTbjCYh/iCBjqbAcoYXfexRdkWDK0yCK5sY/G54lBpl9fCMa1m01UV4hSfhMZSayihUZxNc/r/DA0EMo1OOGhww8z5B9M2x0MWAXOyGdqqOAzCCytMkohWbzEcEYLKX9heyrWP8A9BhgnNSBVLWb+ eX95spbTWyiWqSKQSNjWWcOEC1foJVkkVHCkLDxgfwYngWDv/V/me6 rqBYSUEW6pY30iWebEy

In this case, the token was a problem with the sandbox account.

in the above, the rqBYSUEW6pY30iWebEy needs to be joined with the rest, but there’s an \n right after the me6

Replication process: Unknown. Running oktaws creates the issue, and I saw it happen multiple consecutive times during a specific period of time.

Command executed: "oktaws"

jonathanmorley commented 1 year ago

I believe this is because of oktaws not clearing the credentials file when writing to it