Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(anta): Remove paswsord field in get inventory and debug #338

Merged

Conversation

titom73
Copy link
Collaborator

@titom73 titom73 commented Aug 4, 2023

Get inventory update:

❯ anta get inventory
Current inventory content is:
{
    'spine01': AsyncEOSDevice(
        name='spine01',
        tags=['fabric', 'spine', 'all'],
        hw_model=None,
        is_online=False,
        established=False,
        host='192.168.0.10',
        eapi_port=443,
        username='ansible',
        enable=False,
        insecure=False
    )
}

Passwords have been hidden in data structures shown in ANTA DEBUG mode:

ANTA_DEBUG=true anta get inventory
{
    'spine1': AsyncEOSDevice(
        name='spine1',
        tags=['clab', 'spine', 'all'],
        hw_model=None,
        is_online=False,
        established=False,
        host='clab-evpn-vxlan-fabric-spine1',
        eapi_port=443,
        username='admin',
        enable=True,
        insecure=True,
        _session={
            'port': 443,
            'host': 'clab-evpn-vxlan-fabric-spine1',
            'auth': <httpx.BasicAuth object at 0x7fcb10fcba30>,
            '_base_url': URL('https://clab-evpn-vxlan-fabric-spine1'),
            '_auth': <httpx.BasicAuth object at 0x7fcb10fcba30>,
            '_params': QueryParams(''),
            '_headers': Headers({'accept': '*/*', 'accept-encoding': 'gzip, deflate', 'connection': 'keep-alive', 'user-agent': 'python-httpx/0.23.3', 'content-type':
'application/json-rpc'}),
            '_cookies': <Cookies[]>,
            '_timeout': Timeout(timeout=500),
            'follow_redirects': False,
            'max_redirects': 20,
            '_event_hooks': {'request': [], 'response': []},
            '_trust_env': True,
            '_default_encoding': 'utf-8',
            '_netrc': <httpx._utils.NetRCInfo object at 0x7fcb10fe6d00>,
            '_state': <ClientState.UNOPENED: 1>,
            '_transport': <httpx.AsyncHTTPTransport object at 0x7fcb10fe6ee0>,
            '_mounts': {}
        },
        _ssh_opts={
            'kwargs': {
                'last_config': None,
                'host': 'clab-evpn-vxlan-fabric-spine1',
                'port': 22,
                'username': 'admin',
                'password': '<removed>,
                'known_hosts': None
            },
      
            <truncated>

            'username': 'admin',
            'password': '<removed>',
            
            <truncated>
        }
    )
}

@titom73 titom73 linked an issue Aug 4, 2023 that may be closed by this pull request
@titom73 titom73 added this to the v0.8.0 milestone Aug 4, 2023
@titom73 titom73 added the framework-enhancement New feature or request label Aug 4, 2023
@mtache mtache marked this pull request as ready for review August 4, 2023 09:18
Copy link
Collaborator

@mtache mtache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐜

@mtache mtache merged commit 328ad45 into arista-netdevops-community:main Aug 4, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passwords should not be in clear text
2 participants